I am using HA OS
- Core 2024.10.3
- Supervisor 2024.10.2
- Operating System 13.2
- Frontend 20241002.3
Hi, I want to make an automation to switch a power supply on or off based on the power level of my ipad
I tried first to use the entity directly in a numerical trigger, but it did now work. I then saw in a post that the value returned by the entity is a string, and I therefor needed to use a template trigger. I then used the example but it does not seem to work.
I made the automation with the UI, but want to join the generated yaml
alias: IpadKioskPowerControl
description: ""
triggers:
- trigger: template
id: fullycharged
value_template: "{{states.sensor.marc_s_ipad_mini_battery_levelstate | int>90}}"
- trigger: template
id: lowpower
value_template: "{{states.sensor.marc_s_ipad_mini_battery_levelstate | int<10}}"
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- fullycharged
sequence:
- action: switch.turn_off
metadata: {}
data: {}
target:
device_id: 1c8ce02144c5291d40efb9b4a9d68120
- conditions:
- condition: trigger
id:
- lowpower
sequence:
- action: switch.turn_on
metadata: {}
data: {}
target:
device_id: 1c8ce02144c5291d40efb9b4a9d68120
mode: single
every help would be much appreciated