What does "enable device" really mean?

I have a functional HA installation with several integrations. One of them is MQTT, and species discovery.
I have a bunch of devices that send their discovery (and state) information via MQTT - all this works fine.

While extending my monitoring program, I wanted to test several edge cases - one of them was for a device that is available, then becomes unavailable (it breaks for instance) and finally is removed from the test pool (for instance I am getting rid of that broken switch).

In order to simulate that:

  • I plugged in a plug that was discovered via MQTT and which I configured in HA. It worked great.
  • I then unplugged it to simulate a fault. It switched to unavailable is HA (and alerts were raised in my monitoring). Still great.
  • I then wanted to simulate a “device removed” by switching off the “activate device” in its UI-based popup:

So far, so good the device does not appear anymore in the REST API response.

And now the problem: I cannot bring that device back to life.

I switched it back to “available” in the popup above (or clicked the blue “activate” button). The device itself seems to be fine, but its entity is not:

The highlighted red message means “this entity is currently not available”.

It has not been for a day now.

How to bring it back to life (I will ultimately delete the device and make it re-discover itself, but I would like to understand how the switch in the UI works)

1 Like