How can I save a tag as an integer instead of a float?

I built an advanced flow that connects with four Homewizard devices during daytime to pull the power my solar panels generate. I then want to upload the data to a Google Sheet.

Apps used: Logic, Json Handler and Google sheets.

Basically the flow works, however, the number tags sometimes are stored as text instead of a float or integer. Which messes up my spreadsheet.

I think this is caused by the decimal separators and can’t get it fixed. I do not need numbers with three decimals. So my question is: How do I force the tag (Nummer 1) generated to be an integer instead of a float? I’ve tried {{round(x,0)}} but can’t get it to work properly.

With the numeric “calculate as” card, you can select stringVars, and save their numeric (make sure it holds numbers only) value in a numVar. You can also round to zero digits in one go
This works {{round([YourStringVarHoldingNumbersOnly],0)}}

Thank You, I have altered the flow, and it works.

1 Like