core: mqtt: Exception in availability_message_received

The problem

this error started showing up a few versions ago and similar error appears in this case: #40166 Opening a new issue as the previous one wasn’t properly resolved and the same error appears, but from a different mqtt entity: Valetudo robot vacuum

The issue has been investigated on the Valetudo side and the HA discovery is working properly. Repeated deletion and creation has been tested successfully. When newly discovered, the mqtt info tab in the device can be accessed, BUT at a later stage, clicking this tab does not open the detail window, instead the above error is logged in the log. The error will also occur at other random times. I do not notice any degradation, but there seems to be something not correctly set. Please let me know how I can provide any further necessary details.

What version of Home Assistant Core has the issue?

2021.12.10

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

mqtt

Link to integration documentation on our website

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

Example YAML snippet

no yaml, this uses HA discovery

Anything in the logs that might be useful for us?

Logger: homeassistant.util.logging
Source: util/logging.py:105
First occurred: 29 January 2022, 11:43:05 (24 occurrences)
Last logged: 29 January 2022, 11:43:05

Exception in availability_message_received when handling msg on 'valetudo/vacuum/$state': 'disconnected' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 36, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 26, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.valetudo_vacuum_main_brush'
Exception in availability_message_received when handling msg on 'valetudo/vacuum/$state': 'disconnected' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 36, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 26, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.valetudo_vacuum_right_brush'
Exception in availability_message_received when handling msg on 'valetudo/vacuum/$state': 'disconnected' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 36, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 26, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.valetudo_vacuum_main_filter'
Exception in availability_message_received when handling msg on 'valetudo/vacuum/$state': 'disconnected' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 36, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 26, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.valetudo_vacuum_sensor_cleaning'
Exception in availability_message_received when handling msg on 'valetudo/vacuum/$state': 'disconnected' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 36, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 26, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'camera.valetudo_vacuum_map_data'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (18 by maintainers)

Most upvoted comments

Thanks @pkishino 👍

I think this will fix the issue: https://github.com/home-assistant/core/pull/66104

Please enable MQTT debug logging and share a log from HA startup until the issue is reproduced.

Log settings:

 logger:
   default: info
   logs:
     homeassistant.core: debug
     homeassistant.components.mqtt: debug