Skip to content
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

zwave (deprecated) fails to start in 2021.2.x #46679

Closed
sbruggeman opened this issue Feb 17, 2021 · 8 comments · Fixed by #47566
Closed

zwave (deprecated) fails to start in 2021.2.x #46679

sbruggeman opened this issue Feb 17, 2021 · 8 comments · Fixed by #47566

Comments

@sbruggeman
Copy link

The problem

After upgrading from 2021.1.5 to 2021.2.0/1/2/3 the now deprecated zwave integration fails to start. The ability to even start the zwave network from the configuration page in the UI is gone.

Prior to 2021.2.x, I had defined the zwave configuration in configuration.yaml, while troubleshooting I noticed that under 2021.1.5, the deprecated zwave integration continues to work even after commenting the zwave configuration out of configuration.yaml

After a backup, I tried again to upgrade to 2021.2.3 and removed and re-added the deprecated zwave plugin from the UI using the same network key and USB device path as I had configured via configuration.yaml. After restarting homeassistant, the zwave network starts and works normally, but all of the entity IDs are reverted back to their defaults, effectively breaking all automations and lovelace.

I am running homeassistant in docker using the homeassistant/home-assistant:2021.2.3 image.

Other users experiencing something similar here: https://community.home-assistant.io/t/zwave-1-4-missing-after-update-to-2021-2-3

What is version of Home Assistant Core has the issue?

2021.2.3

What was the last working version of Home Assistant Core?

2021.1.5

What type of installation are you running?

Home Assistant Container

Integration causing the issue

zwave (deprecated)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave/

Example YAML snippet

zwave:
usb_path: /dev/ttyACM0
network_key: !secret zwave_network_key

Anything in the logs that might be useful for us?

# Put your logs below this line
@probot-home-assistant
Copy link

zwave documentation
zwave source
(message by IssueLinks)

@veilofsecurity
Copy link

Same issue, had to downgrade to 2021.1.5 (via backup restore). Relevant line in the logs during startup attempt:
"Received invalid command: zwave/network_status"

@sbruggeman
Copy link
Author

I think this issue is related to this commit: 8b72324

It looks like starting in this commit, HA is now importing zwave configuration parameters (such as network key and usb device path) to the openzwave component. I think what is happening in my case is that I have openzwave component installed but not used. I believe it is loading first and binding to the USB device which then makes it unavailable to the zwave integration later. Uninstalling openzwave and restarting the container does the trick.

@veilofsecurity
Copy link

Ya know, after I posted my comment I noticed I had left openzwave installed from when I moved to HomeAssistant but ultimately went with the built in. I had just removed it doing some cleanup as the thought did cross my mind that it might cause an issue. I will attempt an upgrade tonight or tomorrow and confirm if that was my issue as well.

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Feb 24, 2021

The OpenZWave integration doesn't bind directly to the USB device. This is done in a separate process usually by using the OpenZWave add-on if running the Supervisor.

If you're switching between integrations and their different connection methods you must make sure that only one process and one thing binds to the USB device. We don't recommend having both integrations installed at the same time since it increases the risk for this conflict.

@veilofsecurity
Copy link

I was just able to retry an upgrade and after removing the stopped openzwave add-on (i was never actually using it) and I still get the same result on upgrade. I noticed that the invalid command error only shows up when you visit the ZWave integration page. I do not see any other error logs about Z-Wave.

Had to downgrade back to 2021.1.5 again via restore.

@ronytomen
Copy link
Contributor

Issue was introduced in 8b72324

Specifically a circular dependency was introduced.... With.....

core/homeassistant/components/ozw/manifest.json

{
  "domain": "ozw",
  "name": "OpenZWave (beta)",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/ozw",
  "requirements": [
    "python-openzwave-mqtt[mqtt-client]==1.4.0"
  ],
  "after_dependencies": [
    "mqtt",
    "zwave"
  ],
  "codeowners": [
    "@cgarwood",
    "@marcelveldt",
    "@MartinHjelmare"
  ]
}

homeassistant/components/zwave/manifest.json

{
  "domain": "zwave",
  "name": "Z-Wave",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/zwave",
  "requirements": ["homeassistant-pyozw==0.1.10", "pydispatcher==2.0.5"],
  "after_dependencies": ["ozw"],
  "codeowners": ["@home-assistant/z-wave"]
}

They are both after_dependencies of each other so neither will load.

@veilofsecurity
Copy link

Excellent find. I was able to upgrade to 2021.3.2, z-wave failed to start. Removed the ozw requirement from the z-wave component and restarted the container. Came right up after the reboot. I see someone already added a commit to resolve, hopefully the fix makes it into the next release. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants