Hey guys,
starting to learn Node-RED and hence running into some 'beginner-friendly' questions
screenshot 1
screenshot 2
The screenshots are taken from a switch node that I have attached to an 'mqtt in' node representing the output from a thermometer. The object that gets passed can be see in the second screenshot.
Now in my mind, it should be possible to parse the number from temperature and apply a simple logic: "If temperature below 18°C do this", else "do that".
I set this up in screenshot one. However this does not work. Even if the temp is below 18°C the node will always choose "otherwise".
Interestingly enough, if I ask it to proceed if regex matches \d*\.\d* it will correctly understand that there is a number and continue the flow. I must be missing something fundamental here, anyone willing to help?
PS. I already have the automation running by using a change node and moving msg.payload.temperature to msg.payload. Everything is running fine. I just want to understand the switch node better.
Thanks!