I have an automation that switches off the home cinema plug when no motion is detected for 30 minutes. This should only happen, when the TV is off:
- alias: Heimkino aus trigger: platform: state entity_id: group.presence_sensors to: 'off' for: '00:30:00' condition: condition: state entity_id: media_player.panasonic_viera_p55stw60 state: 'off' action: service: switch.turn_off entity_id: switch.fibaro_system_fgwpe_f_wall_plug_gen5_switch_4
But the automation is triggered even when the TV is on. Is something wrong with the syntax?