Dear openHAB-Friends,
currently I’m challenged by the following task:
I have some smart lights in the group lights and a smart smoke detector.
I want the smoke detector to trigger the group lights to blink for some time when there is smoke detected. After this, the lights should go to the previous state before the blinking.
I know how to solve everything, except the “go to the state before blinking” thing.
I already tried to get this done with persistence and .previousState(),
but did not get the excepted result:
Three switches test1, test2, test3 (member of testgroup, state OFF)
One group testgroup
rule "Test Persistence"
when Item test1 changed to ON
then
testgroup.sendCommand(ON)
logError("Test Persistence", "#####Testgroup switched on ######")
end
rule "Reset to previous state"
when Item test2 changed to ON
then
//Item reset to previous state
test3.sendCommand(test3.previousState().state)
logError("Test Persistence", "#####Reset to previous state ######")
end
Can you please point me in the right direction?
Thank you for helping me