Phillips hue setup with hue scenes

Tags: #<Tag:0x00007f617320e118> #<Tag:0x00007f617320dfd8> #<Tag:0x00007f617320de98>

As an openhab beginner, I was trying to find examples of how to use Phillips hue scenes, but was not able to find any. So after figuring it out, I thought I post an example for others who are looking for it. Especially I wanted to use the hue scenes with the Mycroft openhab skill

I have on single light bulb in the bedroom and five bulbs in the living room grouped in a hue group. The scene ids can be found using the openhab console as described on the hue binding page.
The extra bedroom switches is for mycroft to find the scenes as light switches.

Group    Home               "Our Home"       <house>                                ["Building"]
Group    LivingRoom         "Living Room"    <sofa>          (Home)                 ["LivingRoom"]
Group    Bedroom            "Bedroom"        <bedroom>       (Home)                 ["Bedroom"]
Group Lights "Lights" <light>

Switch BedroomLight_Toggle "Bedroom" <light> (Bedroom,Lights) ["Switchable"] {channel="hue:0220:0017884a9d5a:1:brightness"}
Dimmer BedroomLight_Dimmer "Bedroom" <light> (Bedroom,Lights) ["Lighting"] {channel="hue:0220:0017884a9d5a:1:brightness"}
Dimmer BedroomLight_ColorTemp "Bedroom color" <light> (Bedroom,Lights) ["Lighting"] {channel="hue:group:0017884a9d5a:1:color_temperature"}
String BedroomLight_Scene (Lights) {channel="hue:group:0017884a9d5a:1:scene"}
Switch BedroomLight_Relax "Relax" <light> (Bedroom,Lights) ["Lighting"] {expire="5s,command=OFF"}
Switch BedroomLight_Night "Night" <light> (Bedroom,Lights) ["Lighting"] {expire="5s,command=OFF"}
Switch BedroomLight_Read "Reading" <light> (Bedroom,Lights) ["Lighting"] {expire="5s,command=OFF"}

Switch LivingRoomLight_Toggle "Living groom" <light> (LivingRoom,Lights) ["Switchable"] {channel="hue:group:0017884a9d5a:5:brightness"}
Dimmer LivingRoomLight_Dimmer "Living room" <light> (LivingRoom,Lights) ["Lighting"] {channel="hue:group:0017884a9d5a:5:brightness"}
Dimmer LivingRoomLight_ColorTemp "Living room color" <light> (LivingRoom,Lights) ["Lighting"] {channel="hue:group:0017884a9d5a:5:color_temperature"}
String LivingRoomLight_Scene "Living room Scene" <light> (LivingRoom,Lights) {channel="hue:group:0017884a9d5a:5:scene"}
sitemap default label="Home" {
  Frame label="Lights livingroom" icon="light" {
    Default item=LivingRoomLight_Toggle
    Default item=LivingRoomLight_Dimmer
    Selection item=LivingRoomLight_Scene mappings=["-LzZv5UIvsaaPSY"="NightLight", "eVQGf3jI6VCLbQu"="Savanna sunset", "8cO0kwJ8zvk91wM"="Dimmed", "BLojmaaH-KsAy4C"="Bright"]
  }
  Frame label="Lights bedroom" icon="light" {
    Default item=BedroomLight_Toggle
    Default item=BedroomLight_Dimmer
    Selection item=BedroomLight_Scene mappings=["SjWJP0Y2TRWY4m7"="NightLight", "gBBM4MSk1aTiZL8"="Relaxed", "5xtAKFfmV1H3VbS"="Reading"]
  }
}
rule "Bedroom relax"
when
  Item BedroomLight_Relax changed to ON
then
  BedroomLight_Scene.sendCommand("gBBM4MSk1aTiZL8")
end

rule "Bedroom night"
when
  Item BedroomLight_Night changed to ON
then
  BedroomLight_Scene.sendCommand("SjWJP0Y2TRWY4m7")
end

rule "Bedroom read"
when
  Item BedroomLight_Read changed to ON
then
  BedroomLight_Scene.sendCommand("5xtAKFfmV1H3VbS")
end

I can then toggle scenes using the sitemap ui or for the bedroom I can ask mycroft for instance to turn on the relax light to switch on the relax scene in the bedroom.