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
71.11k stars 29.79k forks source link

Sometimes OZW integration doesn't work without doing an MQTT dump #40339

Closed foxy82 closed 3 years ago

foxy82 commented 3 years ago

The problem

Sometimes when I restart Home Assistant the OZW integration devices remain unavailable. To fix this I have to go into Deverloper Tools -> Service and call mqtt.dump with the following settings

topic: 'OpenZWave/#'
duration: 5

Then all the OZW components instantly become available.

Environment

Problem-relevant configuration.yaml

N/A mqtt integration and ozw integration are configured using the UI.

I am using the mqtt addon as my mqtt broker.

Traceback/Error logs

Not much in the logs at all:

$ grep -i mqtt home-assistant.log
2020-09-19 22:58:02 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'plex', 'rfxtrx', 'sun', 'mobile_app', 'input_number', 'default_config', 'tplink', 'switch', 'zeroconf', 'camera', 'ipp', 'logbook', 'home_connect', 'hacs', 'updater', 'metoffice', 'hue', 'unifi', 'persistent_notification', 'input_boolean', 'cover', 'harmony', 'influxdb', 'ozw', 'mqtt', 'climate', 'telegram_bot', 'nest', 'light', 'tts', 'ifttt', 'cast', 'deconz', 'system_health', 'map', 'zone', 'input_text', 'history', 'input_select', 'netatmo', 'binary_sensor', 'evohome', 'coronavirus', 'ssdp', 'group', 'braviatv', 'roomba', 'scene', 'spotify', 'notify', 'sensor', 'input_datetime', 'script', 'python_script', 'bhyve', 'automation', 'media_player', 'roku'}
2020-09-19 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up mqtt
2020-09-19 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.0 seconds
2020-09-19 22:58:08 INFO (Thread-16) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.cover] Setting up cover.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.cover] Setting up cover.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 22:58:09 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mqtt
2020-09-19 23:00:06 INFO (MainThread) [homeassistant.components.automation.mqtt_to_app_daemon] Initialized trigger MQTT to App Daemon
2020-09-19 23:07:47 INFO (MainThread) [homeassistant.components.automation.mqtt_to_app_daemon] Initialized trigger MQTT to App Daemon
$ grep -i ozw home-assistant.log
2020-09-19 22:58:02 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'plex', 'rfxtrx', 'sun', 'mobile_app', 'input_number', 'default_config', 'tplink', 'switch', 'zeroconf', 'camera', 'ipp', 'logbook', 'home_connect', 'hacs', 'updater', 'metoffice', 'hue', 'unifi', 'persistent_notification', 'input_boolean', 'cover', 'harmony', 'influxdb', 'ozw', 'mqtt', 'climate', 'telegram_bot', 'nest', 'light', 'tts', 'ifttt', 'cast', 'deconz', 'system_health', 'map', 'zone', 'input_text', 'history', 'input_select', 'netatmo', 'binary_sensor', 'evohome', 'coronavirus', 'ssdp', 'group', 'braviatv', 'roomba', 'scene', 'spotify', 'notify', 'sensor', 'input_datetime', 'script', 'python_script', 'bhyve', 'automation', 'media_player', 'roku'}
2020-09-19 22:58:10 INFO (MainThread) [homeassistant.setup] Setting up ozw
2020-09-19 22:58:10 INFO (MainThread) [homeassistant.setup] Setup of domain ozw took 0.0 seconds
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.cover] Setting up cover.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.climate] Setting up climate.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.light] Setting up light.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.switch] Setting up switch.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.lock] Setting up lock.ozw
2020-09-19 22:58:11 INFO (MainThread) [homeassistant.components.fan] Setting up fan.ozw

Additional information

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

Hey there @cgarwood, @marcelveldt, @martinhjelmare, mind taking a look at this issue as its been labeled with an integration (ozw) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

kpine commented 3 years ago

This was previously reported in #38658, but ended up being closed for some reason that I didn't understand.

MartinHjelmare commented 3 years ago

It was closed since it seemed to be a specific mqtt server problem.

ahknight commented 3 years ago

I'm seeing this issue with the standard MQTT add-on. I'm using the supervised image in a Proxmox VM.

The versions affected as of today are: HA: 0.117.4, MQTT add-on: 5.1, Supervisor: 2020.11.0, HassOS: 4.15

The MQTT dump call does appear to solve the issue when it happens, but is very much a work-around.

matejdro commented 3 years ago

Very good workaround for this issue is to just set up an automation that dumps ozw on boot:

- alias: 'Fix OZW on startup'
  trigger:
    platform: homeassistant
    event: start
  action:
    - service: mqtt.dump
      data:
        topic: 'OpenZWave/#'
        duration: 5
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.