Setting HA Generic Thermostat temperature from Node Red Function Node

Hi,
Im trying to set the temperature of the Home Assistant Generic Thermostat from a node red function node.
image

The attribute in node red is as follows

Have tried something like this.
global.set("homeassistant.homeAssistant.states['climate.central_heating'].new_state.attributes.temperature", temp);

Does anyone have any ideas on how to do this

Thanks Danny

Just to be sure. Do you run NR in HA?
And you want to modify the HA temperature entity from an NR flow?

Only a few HA users on this forum, you may be better of asking on HA forum

Is this thermostat setpoint entity value part of a service, if so you may get what you need using the call service node (i am not a HA user so this is my best guess)

Like many/most others here I don't use Home Assistant so this is just a wild guess:

Use a change node to set the value of msg.data.new_state.temperature.

Yes running Node red in HA. Yes I have created a scheduler in node red function node and want this to update the time setting in the intity for the generic thermostat in HA which has a thermostat card in the HA dashboard, which will inturn switch the heating on or off based on the current temperature.
Thanks Danny

Thanks. I have posted there too, but no responses yet.
Basically the thermostat is and entity which has a card on the HA Dashnoard.
Thanks for your response

Here's a demo of turning a switch on and off from NR inside HA.
I don't know if this will help you.

Capture2

Capture3

Thanks Jean,
Im am trying to set an attribute within the entity. Im not quite sure how the generic thermostat works in HA, but it has several attributes as well as can swtich the output. I am trying to set the attribute (temperarture setting) which will inturn switch the heater on an off, basically simulating switching up the temperature setting dial.

I think with this it should be possible

image
or by setting the mode and target temperature
image

That works and changes the temperature, however only lets you set a fixed temp when running the service
Could this be done from node red with a variable from a function node to set the temperature

worked it out. Thanks Jean, you got me on the right track.

basically used a call service node with the following
The temp variable is determined from my function node that sets the temp based on the period of the day (Mon -Fri, Sat, and Sun)

1 Like

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