[Solved] Math in a the device state node?

#1

Are there any helpers available in the Value field of the Device State node for simple path expressions on payload references before they are saved to the device attributes?

0 Likes

#2

There are some math helpers, yes. You can find a list of all the custom helpers we support here, and a list of built-in Handlebars helpers here.

0 Likes

#3

@Dylan_Schuster

Awesome! Can you next two math helpers using multiple and subtract? E.g. {{multiply 1.8 value}} and then add 32?

0 Likes

#4

So if I understand correctly, what you want is to multiply the value by 1.8 and then add 32 to that result? If so, you can nest helpers within helpers like so.

{{add (multiply 1.8 value) 32}}

Just like in the normal mathematical order of operations, the statement inside the parentheses will evaluate first.

1 Like

#5

@Dylan_Schuster

Yes that’s it! It was parantheses instead of curly braces that tripped me up.

0 Likes