MQTT Switch in unavailable after Core 2024.5.5 Update

After core update switch became unavailable. Added a new switch and it shows up but is also available. Here is the original switch configuration.

mqtt:
  - switch:
      unique_id: bedroom_switch
      name: "Bedroom Switch"
      state_topic: "home/bedroom/switch1"
      command_topic: "home/bedroom/switch1/set"
      availability:
        - topic: "home/bedroom/switch1/available"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      optimistic: false
      qos: 0
      retain: true

Look for errors in your logs.

I did an HA reset. attached are the logs. Nothing here seems to point to switch being unavailable.

2024-05-28 13:30:16.437 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-05-28 13:30:16.440 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-05-28 13:30:16.442 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-05-28 13:30:16.444 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ble_monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-05-28 13:30:16.446 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration zha_toolkit which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-05-28 13:30:24.100 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-05-28 13:30:33.825 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: connection opened 58
2024-05-28 13:30:33.826 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: Starting client misc loop
2024-05-28 13:30:33.829 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: register write 58
2024-05-28 13:30:33.841 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: unregister write 58
2024-05-28 13:30:33.860 INFO (MainThread) [homeassistant.components.mqtt.client] Connected to MQTT server core-mosquitto:1883 (0)
2024-05-28 13:30:42.388 WARNING (MainThread) [async_upnp_client.profiles.dlna] Only InstanceID 0 is supported
2024-05-28 13:30:42.428 WARNING (MainThread) [async_upnp_client.profiles.dlna] Only InstanceID 0 is supported
2024-05-28 13:30:47.017 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: register write 58
2024-05-28 13:30:47.017 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to home/bedroom/switch1/available, mid: 1, qos: 0
2024-05-28 13:30:47.017 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to home/bedroom/switch1, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to homeassistant/+/+/config, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to homeassistant/+/+/+/config, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to drop_connect/discovery/#, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to dsmr/#, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to fully/deviceInfo/+, mid: 1, qos: 0
2024-05-28 13:30:47.018 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing to tasmota/discovery/#, mid: 1, qos: 0
2024-05-28 13:30:47.029 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: unregister write 58
2024-05-28 13:30:48.347 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.seeedstudio_mmwave_kit_body_movement_parameter (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('temperature') it is using; expected one of ['K', '°C', '°F']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-05-28 13:30:49.656 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for esphome-web-311680 @ 192.168.0.155: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.0.155', port=6053))]: [Errno 113] Connect call failed ('192.168.0.155', 6053) (SocketAPIError)
2024-05-28 13:30:55.969 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-05-28 13:31:03.053 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.blink_trail_cam_wi_fi_rssi (None) cannot be converted to the unit of previously compiled statistics (dBm). Generation of long term statistics will be suppressed unless the unit changes back to dBm or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-05-28 13:31:04.204 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: register write 58
2024-05-28 13:31:04.205 DEBUG (MainThread) [homeassistant.components.mqtt.client] Transmitting message on homeassistant/status: 'online', mid: 2, qos: 0
2024-05-28 13:31:04.206 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: unregister write 58
2024-05-28 13:31:04.207 INFO (MainThread) [homeassistant.components.mqtt.client] MQTT client initialized, birth message sent
2024-05-28 13:31:16.737 INFO (MainThread) [backoff] Backing off fetch_events(...) for 0.7s (pyoverkiz.exceptions.NotAuthenticatedException: Not authenticated)
2024-05-28 13:31:34.252 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: register write 58
2024-05-28 13:31:34.256 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: unregister write 58
2024-05-28 13:32:34.316 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: register write 58
2024-05-28 13:32:34.317 DEBUG (MainThread) [homeassistant.components.mqtt.client] core-mosquitto: unregister write 58
2024-05-28 13:32:47.730 INFO (MainThread) [backoff] Backing off fetch_events(...) for 0.8s (pyoverkiz.exceptions.NotAuthenticatedException: Not authenticated)

what’s currently in your state topic?

Not sure what you are asking. How do I find this info?

Is this what you are asking?

state_topic: “home/bedroom/switch1”

No, the topic itself holds information. Your configuration tells HA how to read the information in the topic.

Look at the topic and verify that it’s information matches what it’s configured to look for.

Sorry, but I do not understand what information you are looking for.

Maybe if I explain my setup a little it will help. I am using an Aduino to communicate with HA one MQTT. I am using Arduino to send a command to the Arduino. I can simulate HA sending the command to Arduino using the terminal and sending:

mosquitto_pub -h 127.0.0.1 -t home/bedroom/switch1/set -m "ON"

When I send that command from HA the Arduino receives it and operates a switch.

I also send state commands from the Arduin to HA.

mosquitto_pub -h 127.0.0.1 -t home/bedroom/switch1 -m "ON"

That allows me to set the state of the switch displayed on HA.

Just to be clear, this all worked fine yesterday. When I updated the core, it stopped working.

After messing around for an entire afternoon with the YAML configuration, I did mange to get my switch to work again.

For some reason the original config, does not seem to work. I added a second switch configuration and that worked. The first one still does not.

Here is my configuration:

mqtt:
  switch:
   -  unique_id: bedroom_switch
      name: "Bedroom Switch"
      state_topic: "home/bedroom/switch1"
      command_topic: "home/bedroom/switch1/set"
      availability:
        - topic: "home/bedroom/switch1/available"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      availability_mode: "all"
      optimistic: false
      qos: 0
      retain: true
      
   -  unique_id: switch_2
      command_topic: "cmd/switch2"
      state_topic: "state/switch2"
      name: "Switch 2"