Hi everyone! I built a Home Assistant automation that turns off all my lights either at 21:00 or when my phone starts charging after 20:30 while the Medito app is open. Here is my current YAML — does this look correct, or is there anything I should improve?
alias: Sun set off – Medito + Laden
triggers:
- at: "21:00:00"
trigger: time
- entity_id: binary_sensor.ptp_n49_is_charging
to: "on"
trigger: state
conditions:
- condition: time
after: "20:30:00"
- condition: or
conditions:
- condition: time
after: "20:59:00"
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.ptp_n49_is_charging
state: "on"
- condition: state
entity_id: sensor.ptp_n49_last_used_app
state: io.medito.android
actions:
- target:
entity_id:
- light.rgbic_strip_lights
- light.fernbedienung
- light.govee_light_2
- light.govee_light
- light.0x0c4314fffe35d502
- light.0x0c4314fffe8828b6
- light.0x588e81fffee59a4f
- light.0x847127fffe0ca00e
- light.0x847127fffe8d9027
- light.dachboden
- light.0x84fd27fffe933d84
action: light.turn_off
data: {}
mode: single
Any feedback or suggestions welcome! 🙏