Inconsistent mqtt reporting

I am running the following relevant software. This is all updated and latest:
Home Assistant 2022.11.4
Supervisor 2022.11.2
Operating System 9.3
Frontend 20221108.0 - latest
mosquito broker add-on 6.1.3

I accidentally discovered a situation where my shelly flood water sensor (wifi, reports over non-ssl mqtt periodically) showed 100% battery but was actually dead. This is obviously not good and I have some automation setup to notify me when the battery is low but it never triggered because home assistant thought it was still 100%.

I suspected the device had faulty reporting but just in case I checked all my water sensors. I found that they were all reported at 100% but most of them were lower and some of them were completely dead also. According to home assistant, none of them were reporting battery periodically.

However after connecting an mqtt client and watching for the reporting on wake-up, I see that battery, temperature and flood status are reported periodically and on-demand when i wake the device up. I watch my lovelace interface for these battery sensors at the same time and it doesn’t update (usually, see below). The mqtt client sees the updates every time for all the sensors.

These are manually configured sensors with the following example definition in configuration.yaml.

    - name: "SHL-Flood downstairs toilet Battery"  
      state_topic: "shellies/shellyflood-6138C7/sensor/battery"  
      unique_id: "SHL-FlooddownstairstoiletBattery"
      unit_of_measurement: "%"  
      device_class: battery

In lovelace for this sensor I’ve configured, I see that the battery was last updated when I last restarted home assistant. In home assistant developer tools → states, I see the same. It’s as if the device never updated.

Looking in the mosquitto broker log I just see what I would expect, the device wakes up, logs in and then it disconnects.

2022-11-27 07:25:04: New client connected from 192.168.30.78:17522 as shellyflood-6138C7 (p2, c1, k60, u'mqttuser').
2022-11-27 07:26:48: New connection from 172.30.32.2:38056 on port 1883.
2022-11-27 07:26:48: Client <unknown> closed its connection.
2022-11-27 07:27:46: Client shellyflood-6138C7 disconnected.

in mqtt.fx on my windows desktop, the battery update (for 1 device of 13 configured like this) comes in on topic ‘shellies/shellyflood-6138C7/sensor/battery’ with text ‘100’ (or whatever it is e.g. 98) whenever I wake the device up. There’s nothing else on this topic, just the value of the battery percentage so it’s very simple.

I’ve done quite a lot of testing with two of the devices where I watch them update themselves and also wake them up manually. I have noticed that if I pull the battery from the device and then put it back in, home assistant updates the battery value in lovelace and developer tools. This is always the case. The problem is, in mqtt.fx the battery remove/replace communication looks identical to when the device reports periodically or when I manually wake it with the button. This is as basic communication as it gets, it’s just a topic with a single number. So I’m stumped and would appreciate any advice.