I want to achieve the following
if pir goes from on to off for 1,30 minutes turn off the light (EXEPT if media_player is on, in this case do not turn off the light\
Is this code correct
- alias: "Motion TV Room off if no motion"
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.neo_coolcam_battery_powered_pir_sensor_sensor_5_0
to: 'off'
for:
minutes: 1
seconds: 30
condition:
- condition: state
entity_id: media_player.yamaha_receiver
state: 'off'
action:
- service: light.turn_off
entity_id: light.tv_standing_lamp