Thanks, but the last command was logged as: Item 'Huecolorspot4_Color' changed from 250,100,50 to 78,71,85
The initial saved state was 78,71,85
Added some logging:
rule "Color Cycle Lights"
when
Item Testing_Switch changed to ON
then
val lastState = Huecolorspot4_Color.state
logWarn("Hue", "lastState " + lastState )
//Huecolorspot4_Color.sendCommand(ON)
createTimer(now.plusSeconds(1), [ |
Huecolorspot4_Color.sendCommand("1,100,100")
logWarn("Hue", "State 1 " + Huecolorspot4_Color.state )
])
createTimer(now.plusSeconds(2), [ |
Huecolorspot4_Color.sendCommand("140,100,50")
logWarn("Hue", "State 2 " + Huecolorspot4_Color.state )
])
createTimer(now.plusSeconds(3), [ |
Huecolorspot4_Color.sendCommand("250,100,50")
logWarn("Hue", "State 3 " + Huecolorspot4_Color.state )
])
//createTimer(now.plusSeconds(4), [ | Huecolorspot4_Color.sendCommand(OFF) ])
createTimer(now.plusSeconds(5), [ |
Huecolorspot4_Color.sendCommand(lastState.toString)
logWarn("Hue", "Reset " + Huecolorspot4_Color.state )
logWarn("Hue", "Rules Done... " )
])
logWarn("Hue", "Rule Exit... " )
end
14:03:31.651 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Testing_Switch' received command ON
14:03:31.760 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Testing_Switch' changed from OFF to ON
14:03:31.869 [WARN ] [org.openhab.core.model.script.Hue ] - lastState 78,71,85
14:03:32.158 [WARN ] [org.openhab.core.model.script.Hue ] - Rule Exit...
14:03:32.891 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Huecolorspot4_Color' received command 1,100,100
14:03:32.891 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Huecolorspot4_Color' predicted to become 1,100,100
14:03:32.891 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 78,71,85 to 1,100,100
14:03:32.891 [WARN ] [org.openhab.core.model.script.Hue ] - State 1 78,71,85
14:03:33.990 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Huecolorspot4_Color' received command 140,100,50
14:03:33.991 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Huecolorspot4_Color' predicted to become 140,100,50
14:03:33.995 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 1,100,100 to 140,100,50
14:03:33.998 [WARN ] [org.openhab.core.model.script.Hue ] - State 2 140,100,50
14:03:34.741 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 140,100,50 to 139,100,50
14:03:34.803 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Color' changed from 78,71,85 to 0,0,81
14:03:34.803 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Brightness' changed from 85 to 81
14:03:34.803 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_ColorTemperature' changed from 75 to 0
14:03:35.087 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Huecolorspot4_Color' received command 250,100,50
14:03:35.087 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Huecolorspot4_Color' predicted to become 250,100,50
14:03:35.087 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 139,100,50 to 250,100,50
14:03:35.087 [WARN ] [org.openhab.core.model.script.Hue ] - State 3 250,100,50
14:03:36.759 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Testing_Switch' received command OFF
14:03:36.759 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Testing_Switch' changed from ON to OFF
14:03:37.182 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Huecolorspot4_Color' received command 78,71,85
14:03:37.182 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Huecolorspot4_Color' predicted to become 78,71,85
14:03:37.182 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 250,100,50 to 78,71,85
14:03:37.182 [WARN ] [org.openhab.core.model.script.Hue ] - Reset 78,71,85
14:03:37.182 [WARN ] [org.openhab.core.model.script.Hue ] - Rules Done...
14:03:44.792 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 78,71,85 to 77,70,85
14:03:44.861 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Color' changed from 0,0,81 to 0,0,85
14:03:44.861 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Brightness' changed from 81 to 85
14:03:54.839 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 77,70,85 to 65,73,85
So it appears these events happen after the end of processing rules and Timer:
14:03:44.792 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 78,71,85 to 77,70,85
14:03:44.861 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Color' changed from 0,0,81 to 0,0,85
14:03:44.861 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LoungeRoom_Brightness' changed from 81 to 85
14:03:54.839 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Huecolorspot4_Color' changed from 77,70,85 to 65,73,85