Hi there,
i am quite new to openhab2. After connecting all my smart stuff to OH2, I now want to setup a simple rule:
In my kitchen there is a water boiler and a lightstripe. The Boiler can be controlled with a smart power socket. When I turn on the powersocket (with OH2 or the hardware button on the socket), the lightstripe in the kitchen should turn red. After 15 minutes the powersocket should turn off and the lightstripe goes back to its former state.
So here is my code:
rule "r_BoilerAutoOff"
when
Item OnOffPlug1_Switch changed from OFF to ON
then
var HSBtype formercolor = Lightstrip_Regal_Color
var HSBtype heatingcolor = new HSBtype(0,100,100)
Lightstrip_Regal_Color.sendCommand(heatingcolor)
createTimer(now.plusSeconds(30), [|
OnOffPlug1_Switch.sendCommand(OFF)
Lightstrip_Regal_Color.sendCommand(formercolor)
])
end
Unfortunately it doesn’t work. Any Ideas why?
Thanks for suggestions
Strange… it still does not work.
If I reduce the rule to
rule "r_BoilerAutoOff"
when
Item OnOffPlug1_Switch changed from OFF to ON
then
createTimer(now.plusSeconds(10), [|
OnOffPlug1_Switch.sendCommand(OFF)
])
end
the boiler turns off. But if I add another sendCommand line in that code block, the rule stops working. What am I doing wrong?