I use the state of the TV to dim the lighting. Unfortunately this is not very reliable. The status of the TV is regularly set to ‘off’ while it is on. Because the status of the denon receiver is correct, I want to use that as trigger. Just somehow it doesn’t work. Anyone any idea.
The automation to turn on the light when it is dark works. If the TV is already on then the light will be switch on dimmed and if the TV is off it switch on normally.
Now only the trigger for when the light is already on and the TV is turned on or off. The following will pass the check, but when I reload the automation I get an error message.
- alias: "Media player playing TV Audio"
trigger:
- platform: state
entity_id: media_player.denon_avr_x1200w.source
attribute: source
to: 'TV Audio'
condition:
- condition: state
entity_id: timer.hold_when_off
state: 'idle'
- condition: state
entity_id: timer.timer_program_hold
state: 'idle'
- condition: state
entity_id: switch.schemerschakelaar
state: 'on'
- condition: time
after: '16:00'
before: '23:59'
action:
service: homeassistant.turn_on
entity_id: switch.dim