The goal is to have the living room lamps turn on when motion is detected from 12am to 9AM if nothing is playing on TV. But it never get triggered for whatever reason unknown to me.
When i check the history i see movement but nothing gets triggered. Please Help.
- id: '1612311872411'
alias: Motion - Turn on living room light in the morning
description: From midnight to 9am everyday
trigger:
- platform: state
entity_id: sensor.zooz_zse40_4_in_1_sensor_burglar
from: '0'
to: '8'
condition:
- condition: state
entity_id: media_player.living_room_2
state: idle
- condition: state
entity_id: media_player.living_room_2
state: paused
- condition: time
after: 00:00:00
before: 09:00:00
action:
- service: light.turn_on
data: {}
entity_id: group.living_room_lamps
mode: single
Thanks for the help … Is there a better way to approached this. like is there a way to turn multiple states into one. I ended up creating multiple automation one for “paused” and one for “idle” and that worked right away.
You can use OR and AND conditions, like explained in the documentation. This can even be done using the UI editor:
PS: Actually you can define multiple states in a state condition, so this should work, too. Also, omitting before: or after: in a time condition is from/to midnight
condition:
- condition: state
entity_id: media_player.living_room_2
state:
- idle
- paused
- condition: time
before: 09:00:00