Charge My Android Tablet automatically When Battery goes less than 10% & Stop Charging when 100%

I have just set this up last night. The way I did it was using Fully Kiosk Browser, and the custom display component from @daemondazz here, Display platform and Fully Kiosk Browser component

I created a template sensor that read’s the battery value in HA,

- platform: template
  sensors:
    display_kitchen_tablet_battery:
      value_template: '{{ states.display.kitchen_tablet.attributes.battery_level }}'
      friendly_name: 'Kitchen Tablet Battery'
      unit_of_measurement: "%" 
      device_class: battery 

and then I setup an automation to charge it when it gets low, and switch off when it gets full,

- id: '1532547735836'
  alias: Tablet Battery Charge on
  trigger:
  - below: '21'
    entity_id: sensor.display_kitchen_tablet_battery
    platform: numeric_state
  condition: []
  action:
  - data:
      entity_id: switch.plug_3
    service: switch.turn_on
- id: '1532548478810'
  alias: Tablet Battery Charger off
  trigger:
  - above: '99'
    entity_id: sensor.display_kitchen_tablet_battery
    platform: numeric_state
  condition: []
  action:
  - data:
      entity_id: switch.plug_3
    service: switch.turn_off

Hopefully this will help you out, or at least point you in the right direction. Any problems, just shout.

1 Like