I wonder if you have a switch with power monitoring, what’s the response speed like and if it could pick up power draw as low as 5W.
If so, you could try this:
-
Setup a threshold on the power monitoring entity.
-
Install Home Assistants companion and monitor charging status.
-
Automation:
if device logs as charging, detect if one of the switches triggered the threshold in the last 20 mins (min update freq is 15mins on the app if I recall correctly).Mark a helper to tie a relationship between the phone and the switch.
If device reports battery at 100%, check if helper is populated with a value, if so, turn off the related switch and reset the helper.
But you’ll have to decide how long you want the automation to reset, eg after 4 hours, assume the device will be removed from the charging station and reset the switch to on state. I don’t have a great idea on how you can easily setup a reset, unless you have a convenient button lying around.
Maybe you can send a persistent notification to the device when it’s at 100% that allows you to reset the switch to on and ready to charge state. That’ll be quite a decent UI.
Shameless plug: I have a blueprint that can help with the persistent notification: 🔔 Notification with Confirm, Dismiss and Timeout