-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Z-Wave JS - entities disappear if zwave-js server restarts #46180
Z-Wave JS - entities disappear if zwave-js server restarts #46180
Comments
I also experience this, I am using HASS OS with a zwavejs2mqtt add-on. |
Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with an integration ( |
As additional information, I am running the zwavejs2mqtt docker container with mqtt/gateway disabled |
When the server restarts the integration will be reloaded. Currently that means the entities will be removed and then re-added when the server reports the corresponding nodes and values. So this is expected behavior currently. There's an improvement in progress that will turn the entities unavailable instead of removing them when the integration is reloaded. |
They should come back though, when the server reports them ready. What we are experiencing is that they don't come back, the integration doesn't attempt to reload, and the reload option is missing. |
hmmm, I wonder if there's a difference between official Z-Wave server add-on and zwavejs2mqtt. Even if that's the case, the heartbeat built-in to aiohttp should kick in after 55 seconds. |
I've tried giving it an hour or so... |
Just tried to grab logs. My laptop version (which is older) grabbed tons of logs but also worked just fine.
|
I noticed in the zwavejs2mqtt control panel, the home ID and home hex were blank during the first few stages of the interview. could be related, or could be unrelated. |
Updated my laptop version to 2021.2.1, got the same thing:
|
That's what I expected. This is a race condition. The reconnect happens when the server is just not ready yet and thus we get unexpected results. We should guard the code that we only continue if all expecting objects are present and else consider it not yet ready. |
Besides the home id, what else should be included in such a guard? I see you're already checking for server version here https://github.com/home-assistant-libs/zwave-js-server-python/blob/master/zwave_js_server/client.py#L93 |
@marcelveldt Does the server need updating to solve the TypeError? |
No, the server just dumps whatever is (already) there. What I suspect is that we just a get a partial dump if the above happens. So maybe we should check for a few properties to exist before assuming the connection is successful. From everything I read above, the python lib connects to the server just before it is even ready to dump something and will throw an error OR incomplete dump. |
Line 81 in the stack trace is still inside the Python client connect method. We don't have any data yet from the server at that point. |
Same/similar thing here with 2021.2.2 after restarting my custom zwjs2mqtt container:
Had to restart HA to get the network up and running, after which is was fine. |
The problem
When the zwave-js server restarts, some entities in Home Assistant disappear. In addition, the "reload" menu option for the configuration also disappears, thus requiring a restart of HA to get everything back.
What is version of Home Assistant Core has the issue?
2021.2.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Z-Wave JS
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zwave_js
Example YAML snippet
N/A
Anything in the logs that might be useful for us?
N/A
Tagging @jcam per request
The text was updated successfully, but these errors were encountered: