Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- - alias: S21U toggle charger
- trigger:
- - platform: state
- entity_id: sensor.s21u_battery_level
- - platform: homeassistant
- event: start
- condition: "{{states('sensor.s21u_battery_level')|int(0)<=20 or states('sensor.s21u_battery_level')|int(0) >= 80}}"
- action:
- service: "switch.turn_{{'off' if states('sensor.s21u_battery_level')|int(0)>=80 else 'on'}}"
- entity_id: switch.s21u_charger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement