Preventing over-charging of our Maglite ML150's flashlights

We have a couple of Maglite ML150LR flashlights around the farm. They come with a nice wall-mounted charging cradle that - according to the manual - should be suitable for long-term storage of the flashlight. This is not true!

You will ruin the battery and we have had to replace 4 of these expensive batteries in all of our flashlights, they last 13 months and are our of warranty with 5 seconds of power.
A year ago we put the wall-wart in a simple analogue timer providing power only one hour per day and the batteries are still working fine. Moving in to winter-season we use them more often and the charging cycle needed some additional flexibility.

Queue Home Assistant and Shelly Smart Plugs!

A small automation now monitors the power consumption of the charging cradles and turns them off when the power usage gets below 1.5W (flashlight fully charged and sitting idle in the cradle) or after 45 minutes (to protect agains any error). The trigger allows us to tap the button on the Shelly plug to start the automation. Also planning to initiate the charging cycle once per week.

/Mattias

alias: Laddning Maglite
description: ''
trigger:
  - platform: state
    entity_id: switch.maglite
    from: 'off'
    to: 'on'
condition: []
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.maglite_power
        below: '1.5'
        for:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
    timeout: '2700'
  - service: homeassistant.turn_off
    target:
      entity_id: switch.maglite
mode: single
1 Like

What if you restart HA or reload automations during that “timeout” period? the automation actions would never run until the next transition of the switch from off to on.

If you are OK with that then disregard the rest of this…

…otherwise it’s better to use the transition of the power to set an input datetime to 45 minutes later then use that time to turn off the switch if it isn’t already off.

also, if the power is already below 1.5 when HA is restarted or automations reloaded then the wait for trigger will never fire and again the timeout will not be checked.

Thank you for your valuable feedback.
Didn’t mention it, but the Shelly Plug has another 2700 seconds “turn off” fail-safe.

1 Like

well that solves that problem then. :laughing:

Still good to keep in mind for others who don’t have that functionality.