Hy!
I have a little automation for sleep:
- alias: Sleep
trigger:
entity_id: media_player.nappali_lg_tv
platform: state
to: 'off'
condition:
condition: time
after: '22:00:00'
before: '05:00:00'
action:
- service: switch.turn_off
entity_id: switch.ndaikin_powertoggle
- service: light.turn_off
entity_id: light.ledtv
The problem is simply: The light.ledtv is a toogle-type switch, so when it’s not turned on, and this automation run, it’s turn on the light, don’t really care about the current status.
It’s possible to make the light.turn_off service to status-awarness? Now I can turn on the light with light.turn_off and homeassistant.turn_off too, and I can turn it off with light.turn_on and homeassistant.turn_on too.