Math in logic

Trying to calulcate total effekt from my floor heating.

but i only get error, and no value on the variable

What is wrong?
thanks

Should work. Please share the error message?

Than you for the response.


Right now the calculation will bee 0+0+0+0+0 becouse the heated floor have no effect on them. Guess many thats not possible ?

No, now it seems to be NaN + 0 + 0 + 0 + 0 + 0
(NaN = Not a Number)
The top variable seems to be empty. Make sure the numeric variables have a value, even a zero is valid.
When one of them hasn’t got a value, the calculation can’t be made.

The first one is the output, i try to change it to a number, but everytime the flow runs it just get back to NaN.

Oww my bad :grimacing:
Can you check if all variables actually do have a value when the calc is done?

You could add a notification card with all these variables added to it, to be able to see what’s happening.

Oh, try adding a 1s delay in between the calc and the ‘forbruk’ card.
Sometimes calculations can take just a bit more time. Maybe the calculation simply isn’t finished yet.

Tryed this, but it still makes the output go NaN?

Well enyways, just downloaded the app better logic, looks like that works great. So thank you for the help

It doesn’t hurt to assign 0 to the variable where and when you created it. That might do the trick.

Hmmmm, good point, but I can’t create numeric vars without an initial value at both web+phone app:

But that made me think of this:
@Fredrik3
Probably your variable got ‘stuck’ without a value, or something non-numeric somehow.
To possibly solve it:
My guess would be to remove that variable and then create a new one.

Me neighther :grin:.

Haha OK. I read your remark as “you’d add at least a 0 as initial value”.

But how should assigning a 0 as initial value give different results than, say, 19?
Just trying to get your point😊

I was thinking that adding a number to a non defined variable might result in an error. As a test I suggested to initiate the variable with the value zero, which does not ruin the calculation, of course. But would exclude a possible error cause. At the time of writing I was not aware one cannot create a number variable without a value.

EDIT: I see you point. Any value will be ok, as this value is overwritten by the formula, in this case.

1 Like

Check!

Thanks, made the variable again and that made the trick. Thanks for all help

1 Like