zachowj / node-red-contrib-home-assistant-websocket

Node-RED integration with Home Assistant
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/
MIT License
480 stars 85 forks source link

Nodered disconnects from Home Assistant #1425

Open schwickster opened 5 days ago

schwickster commented 5 days ago

Describe the bug

Hey,

The latest Nodered version (4.0.1) seems to constantly disconnect Home Assistant which prevents events from triggering. In the logging I do see a disconnection and it reconnects.. but.. it still does not seem to properly reconnect. Reverting back to Nodered 4.0.0 seems to work for now. So I don't know if it's a bug within Nodered or a bug within this addon in combination with the latest version.

To Reproduce

Seems random.. so can't reproduce. Nodered 4.0.1 just seems to disconnect events from Home Assistant. Restarting nodered seems to temporary resolve the issue. Downgrading to Nodered 4.0.0 seems to work for now.

Expected behavior

No response

Screenshots

See next response

Example Flow

No response

Environment Information

I'm not at my home computer right now. But using docker version 4.0.1 (and now 4.0.0 for the workaround) of nodered using the latest version of this addon (0.65.1). Home Assistant is also running on docker using version 2024.6.4

Additional context

No response

schwickster commented 5 days ago

IMG_2048

here's some logging.

juampe commented 5 days ago

Maybe the problem is related to a deprecated alias in HA

`2024-06-27 11:56:50.110 WARNING (ImportExecutor_0) [homeassistant.helpers.typing] HomeAssistantType was used from nodered, this is a deprecated alias which will be removed in HA Core 2025.5. Use homeassistant.core.HomeAssistant instead, please report it to the author of the 'nodered' custom integration

bogorad commented 5 days ago

Same issue here. However, the "NR websocket disconnect from HA" issue has been with us for a very, very long time, and nothing is being done, unfortunately. I ended up implementing a 30 second timer in HA, triggering it from NR, and waiting for 60 sec. If nothing happens, I just restart NR (via a webhook).