Z-Wave Dimmer Presets (Scenes) [*SOLVED*]

Good day all! I took the plunge last week. I learned about OpenHAB 2 weeks ago - went a little crazy on Amazon and spent this weekend installing all my new goodies! Glad to be part of the wonderful world of HA (and the stress/frustration/joy of configuring)

I have a bunch of Zwave Dimmers installed as well as a Hue Hub 2 with 3 bulbs. I have a basic setup going really well including individual and group control. What I have been searching for, and I am sure its posted out there I’m just overwhelmed with open tabs and browser windows as references to everything I am doing :persevere: but I want to do is make an option to setup 3 presets (or scenes as I see it called).

Quite “simply” I want to to have these 3 options/scenes in my App"

Downstairs [ON] [OFF] [MOVIE]

  1. All On = All Zwave Dimmers = 100% and 1 Zwave Outlet = on
  2. All Off = All Zwave Dimmers = 0% and 1 Zwave Outlet = off
    (I have 1 and 2 working just fine, somehow!)
    the Third option is where I am lost:
  3. Movie = All Zwave Dimmers = 30% and 1 Zwave Outlet = off

Point me to an example and I can figure it out …

Thanks in advance!
Gary
:sunglasses:

My way of doing it would be to create a switch with multiple mappings to your desired states. Then create a rule that reacts to said switch states:

Switch item=SW_Lights label="Light Scenes" mappings=[0="off", 1="on", 2="Movie"]

rule "downstairs lights"
when
	Item SW_Lights changed
then
	switch SW_Lights.state { //select case statement
	case 0 : {
		//turn off your lights
		}
	case 1 : {
		//turn on your lights
		}
	case 2 : {
		//turn on lights to 30%
		}
	}
end

Just put your commands to set the lights at the various states. You could also create a group of the lights and send the command to the group to save code.

Thank you very much! I will give that a whirl… stay tuned!

Awesome! Thank you - worked like a charm. Here is a sample of how I did it in case anyone wants to see it (I used just a few items - I have a very open layout with other devices that I have not yet included but this get the job done perfectly!)

ITEM:

Number scene_familyroom “Family”

SITEMAP:

Frame label=“Scene Test”{
Selection item=scene_familyroom mappings=[0=Morning, 1=Movie, 2=TV, 3=Dinner, 4=GoodNight]
}

RULES:

rule “Activate Scene Downstairs”

when
Item scene_familyroom changed
then
switch scene_familyroom.state {

  case 0: {
  	logInfo("Scenes", "Family Room - GoodMorning Scene Active")
  	sendCommand(Kitchen_Dimmer_Main, 100)
  	sendCommand(Family_Room_Dimmer, 100)
  	sendCommand(Family_Room_Back_Wall_Plug,ON)
  }
  
  case 1: {
  	logInfo("Scenes", "Family Room - Movie Scene Active")
  	sendCommand(Kitchen_Dimmer_Main, 20)
  	sendCommand(Family_Room_Dimmer, 20)
  	sendCommand(Family_Room_Back_Wall_Plug,OFF)
  	
  }
  
  case 2: {
  	logInfo("Scenes", "Family Room - TV Scene Active")
  	sendCommand(Kitchen_Dimmer_Main, 30)
  	sendCommand(Family_Room_Dimmer, 60)
  	sendCommand(Family_Room_Back_Wall_Plug,OFF)
  }
  
  case 3: { 
  	logInfo("Scenes", "Family Room - Dinner Scene Active")
  	sendCommand(Kitchen_Dimmer_Main, 100)
  	sendCommand(Family_Room_Dimmer, 80)
  	sendCommand(Family_Room_Back_Wall_Plug,ON)
  }
  
  case 4: { 
  	logInfo("Scenes", "Family Room - GoodNight Scene Active")
  	sendCommand(Kitchen_Dimmer_Main, OFF)
  	sendCommand(Family_Room_Dimmer, OFF)
  	sendCommand(Family_Room_Back_Wall_Plug,OFF)
  }

}
end