Skip to content

Instantly share code, notes, and snippets.

@mcowger
Created January 18, 2020 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcowger/dc4d216eb3baf8a6329b1c0cac7b63c6 to your computer and use it in GitHub Desktop.
Save mcowger/dc4d216eb3baf8a6329b1c0cac7b63c6 to your computer and use it in GitHub Desktop.
- id: '1579390245541'
alias: Emergency Charge
description: Charge the tesla when it comes home in the middle of the day to 40%
trigger:
- entity_id: binary_sensor.toothless_charger_sensor
for: 00:30:00
from: 'off'
platform: state
to: 'on'
condition:
- after: 00:06:00
before: 00:18:00
condition: time
- below: '30'
condition: numeric_state
entity_id: sensor.toothless_battery_sensor
- condition: state
entity_id: binary_sensor.toothless_charger_sensor
state: 'on'
action:
- alias: ''
data: {}
entity_id: switch.toothless_charger_switch
service: switch.turn_on
- wait_template: '{{states.sensor.toothless_battery_sensor.state | int > 40}}'
- entity_id: switch.toothless_charger_switch
service: switch.turn_off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment