Hi.
I am using openhab2 on a raspberry pi, to interact with my IHC-controller (home automation system).
I am new with writing code.
I am using Chromecast Audio along with my amplifier.
I wrote this rule to turn on my amplifier when Chromecast changes to PLAY, and to turn the amplifier off, when status is PAUSE.
rule “Tænd for forstærker i køkken, når CCK afspiller”
when
Item CCK changed to PLAY
then
amp_k.sendCommand(ON)
end
rule “Sluk for forstærker i køkken, når CCK ikke afspiller”
when
Item CCK changed to PAUSE
then
amp_k.sendCommand(OFF)
end
Unfortunately, CC Audio changes to pause during one track stops, and i new one begins…
How can I delay the off-command (pause for more than 2 sec, then sendCommand(OFF)) ?