How to set entity values from Node red

I want to update the value of an entity (a light in this case) from Node red.

I have a light light.hallway_light defined and what I would like to do is update the values of that light (on, off, brightness) without triggering the service turn_on or turn_off or toggle (as that would create loops).

What node should I use for this ? The edit call service node changes the values but also triggers the turn on service

To clarify a bit, for those familiar with Openhab you have an ItemCommand and an ItemUpdate. The item update updates the values without triggering a command (the equivalent of a service). What is the HA equivalent of the ItemUpdate?

As I understand you can only do that in home assistant using dev-state tab, changing values of sensors or any entities without actually changing the real physical state, so it helps to trigger automations and events.

Nodered doesn’t have any nodes for dev-state. Also not sure if the ha api has access to dev-state.

Thanks I solved it by using MQTT from node red to both the OH and HA system

Can you show me how?

Been awhile since the question
I updated it through Helper input, and used a Call Service node.

image

2 Likes

Just in case someone stumbles upon this, the settings shown in the screenshot did not work for me. After some time, I finally figured it out:

5 Likes

this helped me too. just replace msg.curr_power with msg.payload or whatever you are using

1 Like