MQTT sensor stopped working after HA update

Hi, I have a MQTT problem where I need your help.

In my setup I use the HA MQTT integration to subscribe to some topics provided by the MQTT-Broker running on my ioBroker server. This worked perfect till HA version 2023.5.4, but every newer version didn’t work. After a HA restart the values in the entities list are updated exactly once and then never again.

From the MQTT debug I can see that the updates for all the configured topics are received. But the values are not processed by the system.

This is an example of my MQTT related part in configuration.yaml:

mqtt:
  sensor:
    - state_topic: "modbus/0/holdingRegisters/67_SolarPower"
      name: e3dc_power_from_solar
      unit_of_measurement: W
      device_class: power
      state_class: measurement
    - state_topic: "modbus/0/holdingRegisters/73_GridPower"
      name: e3dc_power_grid
      unit_of_measurement: W
      device_class: power
      state_class: measurement

MQTT debug log:

2023-10-22 11:56:05.149 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/67_SolarPower (qos=0): b'2603'
2023-10-22 11:56:05.155 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/69_BattPower (qos=0): b'-894'
2023-10-22 11:56:05.157 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/71_HomePower (qos=0): b'3505'
2023-10-22 11:56:05.162 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/73_GridPower (qos=0): b'8'
2023-10-22 11:56:05.230 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on 0_userdata/0/SolarSystem/fromBattery (qos=0): b'894'
2023-10-22 11:56:05.234 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on 0_userdata/0/SolarSystem/fromGrid (qos=0): b'8'
2023-10-22 11:56:15.198 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/67_SolarPower (qos=0): b'2576'
2023-10-22 11:56:15.200 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/69_BattPower (qos=0): b'-906'
2023-10-22 11:56:15.201 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/71_HomePower (qos=0): b'3482'
2023-10-22 11:56:15.203 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on modbus/0/holdingRegisters/73_GridPower (qos=0): b'0'
2023-10-22 11:56:15.221 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on 0_userdata/0/SolarSystem/fromBattery (qos=0): b'906'
2023-10-22 11:56:15.224 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on 0_userdata/0/SolarSystem/fromGrid (qos=0): b'0'

I would be very grateful for any advice.

Thanks.

BR, Chris

1 Like

Hi @brumark, did you find a solution for your problem? I’m having the same issuses with MQTT sensor states only updating when reloading configuration - but not while HA is running.

Thank you.

Hi @onkelfu, so far I wasn’t able to find a fix for this problem, but I found a few more people in this forum which are asking for help for the same issue.
Were you able to find a fix in the meantime?

BR, brumark