Hi All,
I have been playing with openhab now for a couple of weeks and after a couple of issues caused by not reading instructions properly I have got a decent setup running connected to a variety of devices around the house but on my recent mini project I am not convinced I am going in the correct direction and cannot find any help topics or forum posts that cover what I am trying to achieve.
I have created the template below (Still rough just for testing) and it functions exactly as I want, one theme selected goes active and others go inactive. (Ignore the Office OFF statuses, they are just a placeholder)
The way that I am achieving this though is what concerns me, I am taking the approach of storing the themes as items
Switch Theme_WatchTV
Switch Theme_LivingRoom_Bright
Switch Theme_LivingRoom_Relax
Switch Theme_LivingRoom_Nightlife
then setting the states of these switches (and accompanying bulbs) via rules
val logName = "lighttheme"
rule "Set Watch TV"
when
Item Theme_WatchTV changed to ON
then
logInfo(logName,"Theme: Watch TV selected")
Theme_LivingRoom_Bright.sendCommand("OFF")
Theme_LivingRoom_Relax.sendCommand("OFF")
Theme_LivingRoom_Nightlife.sendCommand("OFF")
LivingRoom_1_1_Dimmer.sendCommand("69")
LivingRoom_1_1_Colour.sendCommand("82,55,69")
LivingRoom_1_1_ColourTemp.sendCommand("61")
LivingRoom_1_2_Dimmer.sendCommand("69")
LivingRoom_1_2_Colour.sendCommand("82,55,69")
LivingRoom_1_2_ColourTemp.sendCommand("61")
LivingRoom_2_1_Dimmer.sendCommand("29")
LivingRoom_2_1_Colour.sendCommand("82,55,29")
LivingRoom_2_1_ColourTemp.sendCommand("61")
LivingRoom_2_2_Dimmer.sendCommand("29")
LivingRoom_2_2_Colour.sendCommand("82,55,29")
LivingRoom_2_2_ColourTemp.sendCommand("61")
LivingRoom_3_1_Dimmer.sendCommand("1")
LivingRoom_3_1_Colour.sendCommand("82,55,1")
LivingRoom_3_1_ColourTemp.sendCommand("61")
LivingRoom_3_2_Dimmer.sendCommand("1")
LivingRoom_3_2_Colour.sendCommand("82,55,1")
LivingRoom_3_2_ColourTemp.sendCommand("61")
end
rule "Set Living Room Bright"
when
Item Theme_LivingRoom_Bright changed to ON
then
logInfo(logName,"Theme: Living Room Bright")
Theme_WatchTV.sendCommand("OFF")
Theme_LivingRoom_Relax.sendCommand("OFF")
Theme_LivingRoom_Nightlife.sendCommand("OFF")
LivingRoom_1_1_Dimmer.sendCommand("100")
LivingRoom_1_1_Colour.sendCommand("82,55,100")
LivingRoom_1_1_ColourTemp.sendCommand("61")
LivingRoom_1_2_Dimmer.sendCommand("100")
LivingRoom_1_2_Colour.sendCommand("82,55,100")
LivingRoom_1_2_ColourTemp.sendCommand("61")
LivingRoom_2_1_Dimmer.sendCommand("100")
LivingRoom_2_1_Colour.sendCommand("82,55,100")
LivingRoom_2_1_ColourTemp.sendCommand("61")
LivingRoom_2_2_Dimmer.sendCommand("100")
LivingRoom_2_2_Colour.sendCommand("82,55,100")
LivingRoom_2_2_ColourTemp.sendCommand("61")
LivingRoom_3_1_Dimmer.sendCommand("100")
LivingRoom_3_1_Colour.sendCommand("82,55,100")
LivingRoom_3_1_ColourTemp.sendCommand("61")
LivingRoom_3_2_Dimmer.sendCommand("100")
LivingRoom_3_2_Colour.sendCommand("82,55,100")
LivingRoom_3_2_ColourTemp.sendCommand("61")
end
rule "Set Living Room Relax"
when
Item Theme_LivingRoom_Relax changed to ON
then
logInfo(logName,"Theme: Living Room Relax")
Theme_WatchTV.sendCommand("OFF")
Theme_LivingRoom_Bright.sendCommand("OFF")
Theme_LivingRoom_Nightlife.sendCommand("OFF")
LivingRoom_1_1_Dimmer.sendCommand("56")
LivingRoom_1_1_Colour.sendCommand("74,78,56")
LivingRoom_1_1_ColourTemp.sendCommand("84")
LivingRoom_1_2_Dimmer.sendCommand("56")
LivingRoom_1_2_Colour.sendCommand("74,78,56")
LivingRoom_1_2_ColourTemp.sendCommand("84")
LivingRoom_2_1_Dimmer.sendCommand("56")
LivingRoom_2_1_Colour.sendCommand("74,78,56")
LivingRoom_2_1_ColourTemp.sendCommand("84")
LivingRoom_2_2_Dimmer.sendCommand("56")
LivingRoom_2_2_Colour.sendCommand("74,78,56")
LivingRoom_2_2_ColourTemp.sendCommand("84")
LivingRoom_3_1_Dimmer.sendCommand("56")
LivingRoom_3_1_Colour.sendCommand("74,78,56")
LivingRoom_3_1_ColourTemp.sendCommand("84")
LivingRoom_3_2_Dimmer.sendCommand("56")
LivingRoom_3_2_Colour.sendCommand("74,78,56")
LivingRoom_3_2_ColourTemp.sendCommand("84")
end
rule "Set Living Room Nightlife"
when
Item Theme_LivingRoom_Nightlife changed to ON
then
logInfo(logName,"Theme: Living Room Nightlife")
Theme_WatchTV.sendCommand("OFF")
Theme_LivingRoom_Bright.sendCommand("OFF")
Theme_LivingRoom_Relax.sendCommand("OFF")
LivingRoom_1_1_Dimmer.sendCommand("1")
LivingRoom_1_1_Colour.sendCommand("59,98,1")
LivingRoom_1_1_ColourTemp.sendCommand("100")
LivingRoom_1_2_Dimmer.sendCommand("1")
LivingRoom_1_2_Colour.sendCommand("59,98,1")
LivingRoom_1_2_ColourTemp.sendCommand("100")
LivingRoom_2_1_Dimmer.sendCommand("1")
LivingRoom_2_1_Colour.sendCommand("59,98,1")
LivingRoom_2_1_ColourTemp.sendCommand("100")
LivingRoom_2_2_Dimmer.sendCommand("1")
LivingRoom_2_2_Colour.sendCommand("59,98,1")
LivingRoom_2_2_ColourTemp.sendCommand("100")
LivingRoom_3_1_Dimmer.sendCommand("1")
LivingRoom_3_1_Colour.sendCommand("59,98,1")
LivingRoom_3_1_ColourTemp.sendCommand("100")
LivingRoom_3_2_Dimmer.sendCommand("1")
LivingRoom_3_2_Colour.sendCommand("59,98,1")
LivingRoom_3_2_ColourTemp.sendCommand(100)
end
This is feeling awfully verbose way of achieving what I want and despite working I would value your input into my methods.