MQTT entities show as "unavailable" in dashboard despite messages in logs

In my setup, Home assistant, zigbee2mqtt, and node red all communicate via mosquitto, all four of them are run using podman. I decided to change my zigbee channel in zigbee2mqtt since I thought I was getting some interference from the wifi in my house. I removed all devices from zigbee2mqtt, made the changes, then repaired all my devices. The wifi interference seems to be gone.

However, when I went back into HA after repairing everything in z2m, all entities in HA showed as unavailable. All entties in HA were defined in configuration.yaml. That was with the last HA 2022.9.x. I restarted HA, restarted the whole machine, but unavailable persisted. I’ve since tried HA 2022.10.5 and 2022.11.0, and the same problem persists. I’ve disabled the mosquitto credentials and definition in HA’s configuration.yaml and used the GUI to setup the MQTT integration (since it seems using yaml is deprecated). I’ve readded one entity via configuration.yaml because I don’t use autodiscovery

z2m is in the newest version, and mosquitto is in the latest v2.

The issue seems to be with the home assistant GUI, as I can successfully do the following things:

  • all devices work in the z2m GUI. I can turn all the lights on/off etc
  • I can see z2m publishing changes in mosquitto when I toggle the lights in the z2m GUI
  • I can use mosquitto_pub to turn on/off the lights by publishing to mosquitto topics, and I see the mqtt messages in the HA logs
  • zigbee buttons and automations via node red → mosquitto → z2m all work fine
  • Settings > Devices and Settings > MQTT > Confgure button allows you to publish and subscribe to MQTT topics. I can turn on/off the light from there

The YAML I have for the one light I’m testing now is:

mqtt:
  light:
    - name: "Right Living Room Light"
      unique_id: right_living_room_light
      schema: json
      command_topic: "zigbee2mqtt/right_living_room_light/set"
      state_topic: "zigbee2mqtt/right_living_room_light"
      availability_topic: "zigbee2mqtt/bridge/state"
      brightness: true
      color_temp: true
      xy: false
      hs: false
      brightness_scale: 254
      effect: true
      effect_list:
        - "blink"
        - "breathe"
        - "okay"
        - "channel_change"
        - "finish_effect"
        - "stop_effect"

And my full configuration.yaml is:

# Loads default set of integrations. Do not remove.
default_config:

# Enable HTTPS
http:
  ssl_certificate: fullchain.pem
  ssl_key: privkey.pem

mqtt:
  light:
    - name: "Right Living Room Light"
      unique_id: right_living_room_light
      schema: json
      command_topic: "zigbee2mqtt/right_living_room_light/set"
      state_topic: "zigbee2mqtt/right_living_room_light"
      availability_topic: "zigbee2mqtt/bridge/state"
      brightness: true
      color_temp: true
      xy: false
      hs: false
      brightness_scale: 254
      effect: true
      effect_list:
        - "blink"
        - "breathe"
        - "okay"
        - "channel_change"
        - "finish_effect"
        - "stop_effect"

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

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

I am unsure of how to continue troubleshooting.

Could you find a solution to this? I’m facing the same issue. When I click on an entity it does show values though. Does Home Assistent consider the data to old to display or something?

I disabled one integration (ring) and added another one (mqtt) with the same entities but the entities on the dashboard the old entities were shown. After deleting the ring integratoin they are gone and everything works as expected.

I ended up just enabling the automatic discovery in zigbee2mqtt.