How to handle a zombie device, Thermopro TP357 data is wedged

I have somehow managed to get a weird data corruption issue with one particular set of sensors and entities. I managed this entirely through the front end, but I really need (a) a way to get rid of the problems without simply wiping the whole system, and (b) a way to get these sensors showing correctly again.

The sensors are Thermopro sensors, TP357, and were created through the front end the correct integration.

I am now in a situation where one of those sensors (B687) is Unavailable, and the other (1AD6) is in a zombie state, with some residual entity identifiers, even though I attempted to delete the sensor. Those residual entity identifiers prevent me from adding the sensor back, at all. Both sensors show fine through bluetoothctl.

Now, four entities are shown in the developer states list: sensor.tp357_1ad6_humidity, sensor.tp357_1ad6_temperature, sensor.tp357_b687_humidity, and sensor.tp357_b687_temperature. Only one sensor is listed in the Devices page, (B687), and the Entities page shows the 1AD6 entities under the integration named as: sensor, flagged read only, and apparently, impossible to remove – selecting it shows an error: This entity (sensor.tp357_1ad6_temperature) does not have a unique ID, therefore its settings cannot be managed from the UI.

As I said, all done through the UI.

In other words, using the UI alone to manage these devices, I managed to get it into a state where the UI can do nothing, and none of the recommendations I can find allow me to get rid of them.

Does anyone have any hints that might get me out of this?

Oh well, after a core update, or something else, the zombie devices just disappeared. And I managed to delete the unavailable device, too. After a bluetoothctl scan, they reappeared and I could add them both back, and now all seems to be functioning within normal parameters. Maybe a regular “switch it off and back on again” might have done the trick – I never tried that.

Anyway, problem solved.

After a little more digging, and in case anyone else stumbles on these issues, a much bigger part of the problem was that I’d enabled passive scanning the Bluetooth integration. Basically, that doesn’t work with the Thermopro devices.

The way this showed up was that the devices updated fine when I was manually logged onto the server, and used bluetoothctl and scan on. As soon as I quit, they stopped working. So it looks like the external manual use of scan on provide the active scanning that made the devices update. So, passive scanning meant the device data just didn’t make into HA.

So, if anyone’s BT devices aren’t working, I’d suggest logging on and manually starting active scanning from outside HA, to see if that starts the data flowing again.