Hi there,
I use openhab with OLA to have a simple setup for a few lights. Everything is good so far.
But now I try to make some simple Store/Recall Buttons to temporarely store some states.
But there is no success. I guess that the vars are only recocnized for the runtime of the rule. Ist that correct? If so: How can I create vars who stay for the uptime of openhab?
Cheers for your help, Michael
Here is my code:
rule "save1"
when
Item Store_1 received update
then
var colorValue_1_1 = Spot_1_RGB_Color.state as HSBType
var colorValue_1_2 = Spot_2_RGB_Color.state as HSBType
var colorValue_1_3 = Spot_3_RGB_Color.state as HSBType
var colorValue_1_4 = Spot_4_RGB_Color.state as HSBType
var colorValue_1_5 = Spot_5_RGB_Color.state as HSBType
var colorValue_1_6 = Spot_6_RGB_Color.state as HSBType
end
rule "recall1"
when
Item Recall_1 received update
then
sendCommand (Spot_1_RGB_Color,colorValue_1_1)
sendCommand (Spot_2_RGB_Color,colorValue_1_2)
sendCommand (Spot_3_RGB_Color,colorValue_1_3)
sendCommand (Spot_4_RGB_Color,colorValue_1_4)
sendCommand (Spot_5_RGB_Color,colorValue_1_5)
sendCommand (Spot_6_RGB_Color,colorValue_1_6)
end