Frontend doesn't get updated when property "def available(self)" switch back to True

I have written my own ClimateDevice which also return in the property

    @property
    def available(self) -> bool:
        """Return True if entity is available."""
        return self._available

whether the device is available or not.

As soon as the property delivers False the frontend changes its look to the “unavailable” state:
2020-04-10 09_28_23-Window

But when the property delivers True after some time, the frontend doesn’t get updated to its “available” look/state back.
It stays in this “unavailable” state until I perform a refresh of the web page!

Any suggestions what’s the problem here?!

Regards,
Daniel.

For anyone coming across this you probably need to call self.async_update_ha_state(True) to trigger the sensor to update once the availability state is set.

1 Like