home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.48k stars 29.41k forks source link

OpenZWave (beta) - Message about multiple instances but seeing blank integration configuration screen with no options when MQTT is unavailable - v115.x #40733

Closed masonevans closed 3 years ago

masonevans commented 3 years ago

The problem

I've been testing the OZW beta integration with a single switch (Inovelli Black On/Off) and a USB stick (HUSBZB-1). I had things working fine with everything (HA/MQTT/OZW) in a single docker-compose stack. I then moved my mqtt & ozw docker containers into their own docker-compose.yml so they wouldn't be affected by HA restarts.

After moving mqtt/ozw to their own docker stack and restarting everything, my switch showed as unavailable. I tried to access the configuration of the ozw integration but I got a screen saying:

You have more than one OpenZWave instance running. Which instance would you like to manage?

Except there were no choices presented to me, just a blank screen with that message.

Next I tried removing and readding both the mqtt & ozw integrations. However even after doing that I'm still unable to configure ozw (I get the screen asking me to choose an instance but there are no choices). I've tried a number of times, with restarts of HA between each step (remove, restart, add, restart, configure) but nothing is working. I've restarted ozw/mosquitto as well. I also grepped through everything in the .storage directory for ozw but there's only a single entry in core.config_entries.

I can access the ozw admin just fine through VNC and I see my USB stick + switch in the admin console.

Update

After further investigation, it turns out that my MQTT broker had an ACL setup to deny all topics. Everything (HA & ozw) was able to connect to the broker so it appeared that things we were working but when I tried to view the MQTT messages as they came through I was not seeing any messages. Once I fixed the MQTT issue everything started working again.

I will leave this open unless the ozw owner wants to close it as the message is still super confusing and makes it ~impossible to understand the real issue.

Environment

Problem-relevant configuration.yaml

N/A - cannot configure in UI and there is no YAML config for this integration

Traceback/Error logs

There are no errors in the logs, the integration appears to set up fine

  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.cover] Setting up cover.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.climate] Setting up climate.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.fan] Setting up fan.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.light] Setting up light.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.lock] Setting up lock.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.ozw
  2020-09-28 16:44:54 INFO (MainThread) [homeassistant.components.switch] Setting up switch.ozw

Additional information

probot-home-assistant[bot] commented 3 years ago

ozw documentation ozw source (message by IssueLinks)

kpine commented 3 years ago

I logged the same issue here. https://github.com/home-assistant/frontend/issues/7088

I would double check your MQTT integation configuration, and make sure the OpenZWave topic has been published to that broker. Use the mqtt.dump service to ensure HA is seeing the OpenZWave topic (see dump file in /config), and optionally MQTT Explorer, especially since you mentioned re-configuring the docker containers. The lack of any visible topic due to MQTT being offline was what produced the blank page in my case. If you can access ozwd via ozw-admin, then that means it is talking to some MQTT broker at least, but is HA talking to it?

You can also turn on debug logging and confirm if the MQTT topics are being seen by HA. In configuration.yaml I use the following:

logger:
  default: info
  logs:
    homeassistant.components.ozw: debug
    homeassistant.components.mqtt: debug
masonevans commented 3 years ago

@kpine, thanks my MQTT broker was indeed the issue! When I switched my setup I ended up with an ACL file defined in the config but the file was empty, so it was blocking all topics. Once I fixed that everything started working again.

I'll update the original issue with those details.

MartinHjelmare commented 3 years ago

Please make a suggestion for what message you would expect in this situation.

masonevans commented 3 years ago

@MartinHjelmare If there are no OpenZWave instances available then message stating such seems appropriate. IMO the biggest issue is that it says there are multiple instances available when there are none, which makes it really tough to find a starting place for debugging.

I wouldn't expect the OpenZWave UI to try to figure out what's wrong with my MQTT setup. But I would expect it to tell me that there are no OpenZWave instances available instead of telling me that there are multiple.

Not sure on the HA style guide for error messages but something like:

"We couldn't find an OpenZWave instance. If you believe this is incorrect, check your OpenZWave and MQTT setups and ensure that Home Assistant can communicate with your MQTT broker."

Dizzyikea commented 3 years ago

I have this issue too, what are the steps to fix the MQTT issue as described in the quote below? "Once I fixed the MQTT issue everything started working again."

Never mind sorted It was not MQTT at all and a device name issue in YAML

thebradleysanders commented 3 years ago

What did you do to fix the issue, I am also having some issues.

MartinHjelmare commented 3 years ago

@masonevans thanks! Yes, we should improve the message.

cgarwood commented 3 years ago

Submitted frontend PR to fix the config panel. Using @masonevans suggested error message

https://github.com/home-assistant/frontend/pull/7176

LouiS22 commented 3 years ago

Can some write the steps to make this work and add this into the users manual?

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.