Node Red Thermostat Programming

Hi All. Long time ISY guy here. I’m used to if, then, else and I am not a programmer. I’m trying to under stand node red by mimicking my current ISY programs. I got stuck on the my first one! I’m trying to force a thermostat (Honeywell T6 Zwave) setpoint.
Here is what program I’m trying to mimic:
IF heat setpoint is greater than 70
THEN set heat setpoint to 70

Can someone help?

To mimic this program in Node-RED, you can use the following steps:

  1. Drag and drop an if node and a function node onto the canvas.
  2. Connect the output of the if node to the input of the function node.
  3. Double-click on the if node to edit its properties. In the Property dropdown, select heat setpoint from the list of available properties. In the Value field, enter 70 and select > from the Operator dropdown.
  4. Double-click on the function node to edit its properties. In the Function field, enter the following code:
msg.payload = 70; return msg;

This code will set the msg.payload to 70, which will be used to set the heat setpoint to 70.

  1. Save and deploy your Node-RED flow. When the heat setpoint is greater than 70, the if node will trigger the function node, which will set the heat setpoint to 70.

I hope this helps!

Thanks for getting back to me. Question - what is an “if node”? Events State?

In Node-RED, an “if node” is a type of node that allows you to specify a condition, and based on whether the condition is met or not, the node will route the incoming message to one of two outputs.

This is useful for creating conditional branches in your flow, where different actions can be taken depending on the value of a property or other condition. The “if node” is often used in combination with other nodes, such as a function node, to perform some action based on the condition.

As examples of these category of nodes: A ‘trigger state’, ‘event state’, ‘poll state’ node(s) all have the facility to ascribe a ‘if’ or logic condition.

An “event state” refers to the state of a particular event or condition. For example, in the case of the “if node” type of node mentioned in the previously, the event state would be whether the condition specified in the node is met or not.

If the condition is met, the event state would be “true”, and if the condition is not met, the event state would be “false”. The event state determines which output of the “if node” the incoming message is routed to. In this way, the event state can be used to control the flow of messages in a Node-RED flow.

Thank you for the explanation. I had a feeling it was one of those. Unfortunately, none of them have a drop down down for heat setpoint.

This is the way I do it with my thermostat. Yours may be different in the details, but this should be close.

Note: You may need to send both the “target low” and “target high” setpoints, in which case the Data field would contain this or something similar:

{
    "target_temp_high": "74",
    "target_temp_low": "70"
}

Thanks for this. What do i put in the switch?

not sure if this info is useful here but i pulled it from states in dev tools.

hvac_modes: off, heat, cool
min_temp: 44.6
max_temp: 95
fan_modes: Auto low, Low, Circulation
preset_modes: none, Energy heat, Energy cool
current_temperature: 79
temperature: 87
current_humidity: 35
fan_mode: Auto low
hvac_action: heating
preset_mode: none
fan_state: Idle / off
friendly_name: T6 Pro Z-Wave Programmable Thermostat
supported_features: 25

This is what’s in my “If” node:

And this is the prior step’s Current State node:

Note: I’m sure there are different/better ways to do this. I make no claim this is the ideal solution… just that it works for me :slight_smile:

more screenshots if helpful

No luck. I’ll keep trying though. Thanks for the examples!

My guess is that yours is slightly different because you appear to be using “Energy Save Heating” and “Energy Save Cooling”. My thermostat doesn’t have those options, just the first two you have (with values 87 and 88). A way to tinker/debug is to manually change a value on the thermostat unit, then see what values have changed on this screen… Good luck!