Service turn_on instead of turn_off called by node-red

Hello,

I made a small automation so my lights would start blinking if I’ll get an incoming call on my phone (with automate and a binary.sensor). That works. However, node-red is calling turn_on instead of turn_off as a service. Is this a bug?

Thanks

Domain should be “homeassistant” instead of “light”

1 Like

The payload is being overridden by the lr2 node output, I think. You need to delete the payload before lr2_off

Hello,

homeassistant works too but still it just gets called turn_on instead of turn_off.

ok cool . How do I do this?
thanks

Ok I used the msg.payload delete node. Is there a more elegant way to do this? Maybe in the call service node?

No. The service node always gets their fields overridden by input. Put the delay before the lr2 turn on call service then check lr2 state and turn off if state is on, coming from the delay node.

3 Likes

it doesn’t need to be. You can use light.turn_on/off or switch.turn_on/off OR homeassistant.turn_on/off

Kermit,
If you don’t mind, can you give some insights what’s going wrong when login is inline like it was originally on Chris1 screenshot and why the one you’ve posted doesn’t have an issue with payload?

This issue had to do with an older version where you couldn’t stop/change the call-service node from outputting to msg.payload which then would override the settings of the next call-service node. So in the example, I posted above the call-service node isn’t passing its payload along so the config of the next one in line is not getting overwritten.

You are able to chain call-service nodes back to back in more recent versions because there’s now an option to set the Output Location. The default is set to None.

1 Like

Thank you so much for the clarification.
This was very helpful.