Denon Avr - change light state when input in avr changes

Hi everybody, first post in here!

I’m wondering how to change the state of the lights in my living room depending on what input the avr is set to. I already have the Denon binding and hue binding running ok, I just can’t work out how to write a rule for what I want.

Thanks
Dan

Something like this:

rule "Denon change lights"
when
    Item DenonAVR_Input changed // Item linked to the input channel of your denon thing
then
    if (triggeringItem.state == "HDMI1") { // For example, I don't know what the names of the inputs are
        myLamp1.sendCommand(ON)
        myLamp2.sendCommand(OFF)
        myLamp3.sendCommand(50)
    }
end
1 Like

That works perfectly thanks! Although when I ask it to put the dimmer back up to 100% it changes the colour too :tired_face: nevermind.
Another thing I’m failing to do is set a timer, I want the input to change on the avr then a timer start before the lights dim/turn off. The code is coming back with no errors but still does not work.

Post your code, please

My friend who has far more coding knowledge than me sorted it all last night. It works perfectly!

Can you post the working code for other users. Thanks