Help with Flow - Compare 2 temperatures and send pushover to close windows

Dear community,

I am quite new to node red and already managed some flows. But there is one thing I cannot figure out. I want to compare two temperature readings (one indoor, one outdoor)

and then send a pushover (know how to work with that node) to close the windows as the temperature outdoors is higher than indoors. The header of the pushover can be set with the node before, that worked with other flows as well.

Do I have to use a join? Or how can I compare the two sensors and then only if one temp is larger than the other, let the flow continue?

Thanks for the help!

Hi & welcome to the forum.

No.

You could (for example) use a function node and node.context - how is your JavaScript foo?

TBH, in this case, the join node is probably the best option.

Set the join node to 2 parts and to output a key/value object. Ensure each value has a topic.

See this article in the cookbook for an example of how to join messages into one object.

Once you have both values in the same msg, the docs that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

https://nodered.org/docs/user-guide/messages

Thanks so much. I managed to join the two messages into one object. But now the question is, how do I compare the two numbers of the two objects?

I want to have "If sensors/34 >= sensors/37, then continue". I was not able to manage it with a switch.

Guess I have to use a function and could also have send the right message payload for pushover.

Sure you can.

Did you use the "copy path" button that appears under your mouse when you hover over the item of interest as I pointed out?

copy the path to (for example) "CurrentTemperature" for sensor 37 and sensor 34 & use a switch node to determine if one is greater than other.

Thanks, managed to implement the switch

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.