Is it possible to update or modify an entity state from within a function node?

I understand that I can read the properties of an entity using the following command: thermostat01 = global.get('homeassistant').homeAssistant.states["climate.thermostat"].

Is it possible to modify any of those properties directly from a function node without using the call service node?.

I’d like to change the set point or turn on/off the thermostat.

Maybe, but it will just be for a few seconds.
You will be altering the value in HA, but there will be sent no message to the device about the change, so a few seconds later HA will get the value from the device nd overwrite the value you had set.

I understand that, but I was referring to changing the state of an entity in the same way that the calling service node does.

Is there a way to call a service from within a function node?

But you dont do that.
The state machine (the values you see in the node red) is just the values from the sensors of the devices.

When HA wants to change a value, then it sends a request to the device and then the device make the change, which HA then picks up and save in its state machine.

1 Like