rule "Scene Control Activation" when Item scenecontrol changed then if (scenecontrol.state=="alloff"){ AllOff.postUpdate(ON) LandingLightMaster.sendCommand(OFF) LivingRoomLight.sendCommand(OFF) LivingRoomLamp.sendCommand(OFF) BedroomLampL.sendCommand(OFF) BedroomLampR.sendCommand(OFF) KitchenLight.sendCommand(OFF) GardenLight.sendCommand(OFF) sendCommand(HarmonyHub_CurrentActivity, "PowerOff")} if (scenecontrol.state=="night"){ NightButton.postUpdate(ON) LandingLightMaster.sendCommand(ON) LivingRoomLight.sendCommand(OFF) LivingRoomLamp.sendCommand(OFF) KitchenLight.sendCommand(OFF) BedroomLampL.sendCommand(ON) BedroomLampR.sendCommand(ON) GardenLight.sendCommand(OFF) BedroomKodi.sendCommand(ON) sendCommand(HarmonyHub_CurrentActivity, "PowerOff")} if (scenecontrol.state=="morning"){ MorningButton.postUpdate(ON) LandingLightMaster.sendCommand(ON) LivingRoomLight.sendCommand(OFF) KitchenLight.sendCommand(OFF) BedroomLampL.sendCommand(OFF) BedroomLampR.sendCommand(OFF) GardenLight.sendCommand(OFF) BedroomKodi.sendCommand(ON)} if (scenecontrol.state=="music"){ sendCommand(YamahaAVReceiver_, "PowerOn") LandingLightMaster.sendCommand(OFF) LivingRoomLight.sendCommand(ON) LivingRoomLamp.sendCommand(OFF) BedroomLampL.sendCommand(OFF) BedroomLampR.sendCommand(OFF) GardenLight.sendCommand(OFF) sendCommand(HarmonyHub_CurrentActivity, "Music") MusicButton.postUpdate(ON)} if (scenecontrol.state=="movie"){ LandingLightMaster.sendCommand(OFF) LivingRoomLight.sendCommand(OFF) LivingRoomLamp.sendCommand(ON) KitchenLight.sendCommand(OFF) BedroomLampL.sendCommand(OFF) BedroomLampR.sendCommand(OFF) GardenLight.sendCommand(OFF) if (HarmonyHub_CurrentActivity.state=="PowerOff"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} if (HarmonyHub_CurrentActivity.state=="Music"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} if (HarmonyHub_CurrentActivity.state=="PC"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} if (HarmonyHub_CurrentActivity.state=="TV"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} MovieButton.postUpdate(ON)} if (scenecontrol.state=="media"){ LandingLightMaster.sendCommand(OFF) LivingRoomLight.sendCommand(ON) BedroomLampL.sendCommand(OFF) BedroomLampR.sendCommand(OFF) GardenLight.sendCommand(OFF) if (HarmonyHub_CurrentActivity.state=="PowerOff"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} if (HarmonyHub_CurrentActivity.state=="Music"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} if (HarmonyHub_CurrentActivity.state=="Blu Ray"){ sendCommand(HarmonyHub_CurrentActivity, "Shield")} MediaButton.postUpdate(ON)} end rule "Movie Mode" when Item MovieMode received command "ON" then sendCommand (scenecontrol, "movie") MovieMode.sendCommand(OFF) end rule "Media Mode" when Item MediaMode received command "ON" then sendCommand(scenecontrol, "media") MediaMode.sendCommand(OFF) end rule "Music Mode" when Item MusicMode received command "ON" then sendCommand(scenecontrol, "music") MusicMode.sendCommand(OFF) end rule "Night Mode" when Item NightMode received command "ON" then sendCommand(scenecontrol, "night") NightMode.sendCommand(OFF) end rule "Media Activate" when Item MediaButton changed from OFF to ON then sendCommand(scenecontrol, "media") MovieButton.postUpdate(OFF) MusicButton.postUpdate(OFF) NightButton.postUpdate(OFF) MorningButton.postUpdate(OFF) AllOff.postUpdate(OFF) end rule "Movie Activate" when Item MovieButton changed from OFF to ON then sendCommand(scenecontrol, "movie") MediaButton.postUpdate(OFF) MusicButton.postUpdate(OFF) NightButton.postUpdate(OFF) MorningButton.postUpdate(OFF) AllOff.postUpdate(OFF) end rule "Music Activate" when Item MusicButton changed from OFF to ON then sendCommand(scenecontrol, "music") MovieButton.postUpdate(OFF) MediaButton.postUpdate(OFF) NightButton.postUpdate(OFF) MorningButton.postUpdate(OFF) AllOff.postUpdate(OFF) end rule "Night Activate" when Item NightButton changed from OFF to ON then sendCommand(scenecontrol, "night") MovieButton.postUpdate(OFF) MusicButton.postUpdate(OFF) MediaButton.postUpdate(OFF) MorningButton.postUpdate(OFF) AllOff.postUpdate(OFF) end rule "Morning Activate" when Item MorningButton changed from OFF to ON then sendCommand(scenecontrol, "morning") MovieButton.postUpdate(OFF) MusicButton.postUpdate(OFF) MediaButton.postUpdate(OFF) NightButton.postUpdate(OFF) AllOff.postUpdate(OFF) end rule "All Off" when Item AllOff changed from OFF to ON then sendCommand(scenecontrol, "alloff") MovieButton.postUpdate(OFF) MusicButton.postUpdate(OFF) NightButton.postUpdate(OFF) MorningButton.postUpdate(OFF) MediaButton.postUpdate(OFF) end rule "Scene UNDEF" when Item scenecontrol received command "undef" then MusicButton.postUpdate(OFF) MovieButton.postUpdate(OFF) MediaButton.postUpdate(OFF) NightButton.postUpdate(OFF) MorningButton.postUpdate(OFF) AllOff.postUpdate(OFF) end