Hello there,
sorry for such easy question, probably I missed something, but I can't find a node for following thing.
I have system (Loxone) which feeds by flow by some values, for example "0" and "1" as a state of the button. And I need to convert these 0/1 to "on" / "off" string values and pass it as MQTT value to Zigbee2Mqtt system.
So, I can create "function" block and code this simple function in JS. Something like
if input=0 then output="off"
else if input="1" then output="on"
else ....
But because this will be used on several places, I would like to use some pre-build node. Is there something for this?
Because I can use "switch" block but then I have to also use some two other blocks (probably change") to modify the payload for the correct value.
But I would like to use only one element to do this thing. It's very inconvenient to create three nodes for every transformation. I would like to see something like this:
Where "TRANSFORM" node is a combination of switch and change node.
Is there any way how to do that?
Thanks