Scenes launched from node-red

Hi all
Just switching from 7 years of Domoticz to HA. I switched dzVents to Node-red.
Happy about that.

I am facing an issue with scenes (only lights) that are defined in HA, working fine from HA not in node red. Lights are flashing many times.

I have used a call service node with this parameters :

  • Domain : Scene
  • service : turn_on
  • entity : the scene name (auto filling)

When the script is running the scene is executed but all the lights are flashing many times and at the end some of them remains off after flashing.
I have the same issue with a light, if I apply the “turn_on”. Working well with JSON for the light with the good parameters.

I have managed to create template switch that I use in NR + automation in HA to launch the scene. This works fine but really complex to maintain !

How to launch a scene directly from node-red without lights flashes ?

This is not normal, so maybe something else is going on. Do you get the same effect if you call the service with the same details from the Developer Tools page? Is there any further info in the logbook?

unfortunately no…
at the moment it is under docker for HA and also for NR, I will switch soon to RPI.

Anyway, your answer looks interesting anyway. If it is supposed to work, it may work with a “normal” installation.

Today I notice similar issue. Long time ago I create ‘virtual’ switch to turn on/off LEDs from two gang switch on wall:

[{"id":"a266936299c8c09e","type":"server-state-changed","z":"6209116823974ee4","name":"LED On","server":"d7f5ad93.ff931","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.light_switch_4","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":60,"wires":[["5e40f2c47b467d62"],["bb7a828c4462e5c9"]]},{"id":"5e40f2c47b467d62","type":"api-call-service","z":"6209116823974ee4","name":"Led RTV","server":"d7f5ad93.ff931","version":5,"debugenabled":true,"domain":"light","service":"turn_on","areaId":[],"deviceId":["0f22eb6006923fc9c17266adc2a9ccd0"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":220,"y":40,"wires":[[]]},{"id":"bb7a828c4462e5c9","type":"api-call-service","z":"6209116823974ee4","name":"Led RTV","server":"d7f5ad93.ff931","version":5,"debugenabled":true,"domain":"light","service":"turn_off","areaId":[],"deviceId":["0f22eb6006923fc9c17266adc2a9ccd0"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":220,"y":80,"wires":[[]]},{"id":"d7f5ad93.ff931","type":"server","name":"Home Assistant","addon":true}]

And this works great up to today. I was able to control defined LEDs from HAS app and from wall switch with no issue. Today somethings brake, when LEDs are turned On from app, browser etc, Node Red turn them Off. When I turn On LEDs from switch, then they works.

I suspect this may be related to recent Home Assistant updates. This morning I installed 2023.4.4, until yesterday evening there were no problems.

1 Like