-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
websocket connection being made before component loaded #250
Comments
I have a similar issue. Once Home Assistant was restarted the function node seems not to be able to get a connection to Home Assistant and as a result the state of an entity cannot be read. An error "TypeError: Cannot read property 'state' of undefined" is thrown. When the connection to HA is updated via Configurations Node, the connection seems to be re-established and the function node works propery. A restart of the node-red container leads to teh same result. |
I had a similar issue. For some reason, all entities got duplicated in my case. I removed the old ones and corrected the Entity ID of the newer ones. Everything is working fine now. EDIT: By all entities, I mean the ones created by the Node-RED integration. |
It just happened to me, after upgrading HA to 0.112.3 the entities became unavailable. I had to restart Node-RED to have them working again. |
Currently remodeling my office so it will about another week before I can look into this. |
Just upgraded HA to 0.112.4 and found this in Node-RED logs.
Home Assistant logs.
I hope this helps in some way. |
@zachowj you get a chance to look at this? |
I wasn't able to reproduce this 100% of the time so not sure if this will completely fix it but you can try the latest version and test it or wait until I push the next release.
You can also change the logging level of NR to debug little more reporting of the client status. |
Found another edge case that needs to be fixed. |
so... it works sometimes. I did about 6 restarts of HA and 2 of the times it did not work (entities not available in HA). Here are debug logs from NR when it works:
and here's what it looks like when it doesn't:
Here's what happens in HA when the errors pop up in NR:
This was using version: 0.22.7-dev.8ec47fb2e |
Yes, it a race condition between the WebSocket client resubscribing and when the integration is loaded. At the moment I don't have any control over when the WS client sends the resubscribe messages. Still looking into a solution for this. |
@zachowj could do something as simple as re-connecting when you get |
This should be fixed now in the latest release. If you find that this is still occurring for you reopen the issue. |
Does this require a certain version of HA? |
No |
#247 is still happening in HA 0.112.0 and node-red-contrib-home-assistant-websocket 0.22.6
With debug logs turned on in the custom_component I still get this at startup:
Describe the bug
When I restart HA with node-red already running, all entities created by node-red-contrib-home-assistant-websocket are unavailable until I restart node-red.
To Reproduce
Steps to reproduce the behavior:
Environment (please complete the following information):
Other (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: