Node Red losing websocket connection

Actually it looks like the Websocket Out node has a Heartbeat option.

@wuench It works! Adding a Websocket Out node, unconnected to anything, but pointed at the same websocket URL, using the Heartbeat option, keeps the connection alive.

Glad it is working for you that’s good info.

Might be a good idea for the author of the HA node-red websocket node to compare code with the Websocket Out node and see if a heartbeat could be added. (To be fair I haven’t update in a while it may be in there already).

3 Likes

Seems to do the trick (had disconnect issues to HA, causing NR to restart). Added a web-socket out to the WebSocket of HA, with a heartbeat of 60 seconds, and restart that every 15 minutes.