Node-red not firing events (at random)

Hi everyone

I have a simple flow that will turn on a socket when the sun sets. I have another flow that does the same but for my hot water heater in the morning and off again after 50 mins using the delay node.

Sometimes (I cannot see a pattern) the flows just does not fire. It does state underneath the call service node that 'switch.turn_on' called at: Aug 25, 18:27 but the socket didn’t actually turn on. Same with the hot water heater.

It sometimes works, sometimes it doesn’t.
I am using a Pi 4 with HA OS installed running 2021.8.8 and node-red version 10.0.0.

Any ideas or suggestions? Thank you

Look in the logbook of HA. Put in one of the entities, you should see “turned on by supervisor” if the command got to HA. If it did check the connection to the switches, are they dropping offline?

If it doesn’t show in HA, look at the nodered logs on the addon page and supervisor logs for clues

Thank you for the reply, Mikefila. I have turned on debug logging and will test soonest.

I have noticed that whenever the switch does not actually turn on, HA did not receive it. So the problem lies with Node-Red.

or Node Red HA integration, or HA itself
During last months I saw a lot of reported/discussed issues related to connectivity (web sockets) between NR and HA. Not tracking them since I’m on 2021.01 so don’t know whether the root-cause has been found or not

Something else to check, in a call service node the home assistant server drop down, is there more than one server defined? It should only be one. You’ll need to delete copies then update nodes using the deleted server.

I have looked at the logs over the last week and the only thing I see that is really odd is the constant disconnection and reconnection of the websockets to HA. The HA logs do show turned on by supervisor when it actually reaches HA. Otherwise the event will fire in NR but it being disconnected from HA, the request is never received.

I see it in the logs and also in NR under a HA node.

I backed up all my flows, credential secret and then uninstalled NR. After reinstallation, it seems to be more stable. Will report back if anything changes.

Thank you both for the replies.