Question about polling behavior in the battery low integration #2494
-
First of all, thank you for your work and dedication to this integration. However, I have a question about how it works. When does the integration perform polling to check the battery low status of devices? It has been 33 hours since I last restarted Home Assistant, and I don’t see any polling queries for battery status on my devices. I only notice these queries during Home Assistant's restart. Does the integration only check the battery status of all devices during the restart? I thought I had read that the "interview" with devices also occurred 24 hours after restarting Home Assistant. Thank you in advance for any clarification you can provide. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, there's a few things to explain on this
The battery_notes_battery_threshold and battery_notes_battery_increased events are fired immediately either 2 or 3 are updated and the criteria for threshold is met. They are only fired once automatically so a HA restart will not re-trigger them, but you can get all devices re-examined by calling the battery_notes.check_battery_low action. Hope that explains how things work, the community section of the docs has some examples of how you'd work with the events and actions that might help more. |
Beta Was this translation helpful? Give feedback.
Hi, there's a few things to explain on this
The interview every 24 hours after starting HA (and immediately on the start) is for device discovery, this is when it downloads the latest battery library and checks if you have any new devices that are in the library.
Assuming you have a typical device that has a Battery+ and Battery Low sensor added via battery notes, these will be updated whenever there is a change by the real battery entity.
A battery note with a Battery Low template will watch the entity within the template and change low when that entity value changes causing the template to return true.
The battery_notes_battery_threshold and battery_notes_battery_increased event…