Node red responsetime

Non-pi user here chiming in, I switched some light automations triggered via motion over to NodeRed and tested the response time when I initially did it, no change. I had it also triggering a WiFi light (over MQTT) and one over Zigbee just to make sure it wasn’t the end point. I also have a few motion sensors triggering into the pool to test to make sure it wasn’t a delay on the motion sensor either. Of course the Zigbee light was usually slower than the Sonoff WiFi light, but I haven’t seen any noticeable delay, it’s damn near instant and hard to measure. I did notice after the recent 0.73.2 upgrade that it was taking 3-4 seconds but a restart of the NodeRed container fixed the issue, not sure if something was hung up.

1 Like

I have a pi 3 non plus with ha, openhab, deconz and node red and since I’m doing rules with node red is instant. Which connector do you use? I’m using the web socket version.

I am using Hassio with the add-on made by Frenck .

So we have the possibility that it is Hassio that slow things down? Because if it is the Pi @sergi.suarezj should also see a slow down?

@sergi.suarezj is there any performance diffference between HA and openHab regarding node red or in general?

Openhab did not have web sockets and it’s a huge difference as I don’t need to poll anything it just arrives by magic. I realized that when started using web sockets in node red with deconz.

Okay, I have no idea if the add on for Hassio uses websockets @frenck do you know?

I would be curious to see if someone that is having performance issues would have NodeRed monitor a MQTT topic that the sensor would publish to see. Or if the sensor doesn’t have MQTT, have HA post the state to MQTT. Might help determine where the delay is happening?

I have had slowness issues on hassio. I wonder how may of you guys are using SSL and or port forwarding for HA?
if so do you have internal DNS setup for the external address? If not like I was your going through your router and back in on the external IP between NR and HA. This was introducing a delay for me.

My router does not support adding DNS entries so for me i remove SSL off everything and setup NGINX for external access. I then changed the NR configuration node for HA to http://127.0.0.1:8123.
I had to give NR a restart for it to take effect for some reason

And like magic the delays are gone.

1 Like

In my case no SSL or port forwarding. My Hassio instance is not exposed to the internet.

I moved my Node-Red onto a dedicated RPi a while back and have not had any long repsonse times since.

At the time the Node-Red and HA was running on the same RPi I realized some longer response times as well. This was mainly after I had done several noder-red deploy’s (more than 20 times) during debugging or testing activities. After a full restart of the RPi the long response times were usually sorted.

I do use internal DNS and don’t have any issues with response time, everything is instant.

If anyone else is using Pi Hole you can add your static hosts to /etc/hosts.local

I run HA on a HP micro server in a linux container (LXC not docker) and NR as another container. It is not exposed to the internet.

I use a combo of Hue motion sensors and Xiaomi motion sensors that I have in practically every room and as soon as I walk in the lights come on - whether that be a single colour or hue scene (I use predominantly hue bulbs, though I have a couple of lights hanging off Sonoff S20 sockets using mqqt). I am currently using the HA LLAT node (not websockets) for connection back to HA as the websocket one seems to work for an hour or two then go stale in my environment.

What I did notice is that i used to use a node called Hue Magic in NR to do all the automations and the response time was 3-4 seconds…way too slow for walking into a room. I now use the HA node for everything and it is pretty instant. It is ‘wife proof’ in that she never reaches for the switch so that in my book is ok :slight_smile:

1 Like

Hello, I suffer from the same issue (3-4 second response time when pressing a switch is not ok).
I am using Node-Red in a docker alongside Hassio running on a XU4. Bu default I use the home-assistant nodes (not sure if they are web nodes or not).

When you say HA LLAT node, can I check with you, do you meant this? https://www.npmjs.com/package/node-home-assistant-llat

Yes that is the one - I have tried moving to the web socket one a couple of times but I keep having timeout issues so have stuck with that one. I know it is not being actively updated, but it works :slight_smile:

I seem to have shaved quite a few seconds by moving the MQTT broker to Mosquito…
It looks like the move to LLAT will require me to ‘redo’ the automation flows (due to conflict with existing websocket package)

Node-RED in instant for me, very fast, no delays. Running v0.20.3 on Raspbian Stretch on a Raspberry Pi 2 along with the awesome Websockets Node.

You can measure the times using debug nodes.

1 Like

This fixed it for me, no more delays, thanks!

2 Likes

How do you changed the the NR configuration node for HA to the internal url? Can you share the configurations changues?.

Thanks,

Jose

Don’t use the Hue Magic node (node-red-contrib-huemagic). It’s slow!

As soon as I used the HA objects to interact with Hue devices, no lags anymore.

Maybe if you don’t use HA+Node-Red, you can use the Hue Magic without issues…

Can you tell me howto split up node red an home assistant on a separate raspi?

Having mayor delay problems that i havend had before and would like to try this.

I’m no big coder, so i’m using node red alot.

Thanks!

Yep. I’ve noticed that the issue is with NodeRed, specifically the output “buffer” where it sends data to HA via the “services” node, e.g. turn light on…

This seemed to start happening to me about a year ago, and since then I have run a script in NodeRed to restart itself. Sometimes I have to get this to happen once an hour, as over 2-3 hours the problem sets in.