I noticed that even the ZigBee (ZHA) integration is listed as Local Polling. I guess if thereâs even a limited possibility of the integration performing polling, the convention is to classify it as âLocal Pollingâ.
Itâs slightly misleading because, for example, the Philips Hue integration is âLocal Pollingâ and it really polls periodically to ensure device states are synced with Home Assistant. Their API provides no means for a device to âpublishâ its state-changes (like a UPB device can do). So the three integrations, Hue, ZHA, and UPB, are all Local Polling but only Hue fits that description perfectly.
Anyway, the reason I asked is because Iâm trying to get the bottom of an issue with disabling/re-enabling an entity. Go to Configuration > Entities, click the filter icon (upper right hand corner) and select âShow disabled entitiesâ. Now click a UPB-based light, turn off Enable_entity, then click Update.
The lightâs name will now be Unavailable
and it will disappear from the States view and the auto-generated Lovelace UI. So far, everything works as one would expect of a disabled entity.
While still in the Entities page, click the disabled entity and re-enable it (donât overlook to click Update). The entityâs name remains Unavailable
and itâs still missing from the States page. Thatâs unexpected. However, wait about 20 seconds and its name will be restored and it will re-appear everywhere else as well. Note: if you refresh the web-page during this time period, it will not fix the problem.
This behavior can be duplicated in other integrations that use config-flow. However, the entityâs ârestoration timeâ varies from mere seconds to about a minute (based on the handful of integrations I have tried). My theory was that this time period was due to some sort of polling activity performed by the integration itself.
In contrast, the MQTT integrationâs IoT Class is Local Push. If you disable an auto-disovered MQTT entity, re-enabling it never restores it to full functionality. You have to restart Home Assistant. The same is true for any Helper (input_number, input_boolean, etc) created via the UI.
This is what led me to theorize that only âLocal Pollingâ integrations eventually restore the re-enable entity due to periodic refreshing. Well, it was my theory until it was discredited by the fact the UPB integration performs no periodic polling. If the 20-second delay to restore the entity is not the integrationâs doing then I donât know whatâs responsible for it.
tl;dr
Re-enabling a disabled entity produces inconsistent behavior that may even require restarting Home Assistant in order to truly re-enable the entity.