rule "Shield Activity" when Item ActivityShield received command "ON" then sendCommand(HarmonyHub_CurrentActivity, "Shield") ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) end rule "BR Activity" when Item ActivityBR received command "ON" then sendCommand(HarmonyHub_CurrentActivity, "Blu Ray") ActivityShield.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) end rule "PC Activity" when Item ActivityPC received command "ON" then sendCommand(HarmonyHub_CurrentActivity, "PC") ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityShield.postUpdate(OFF) ActivityOff.postUpdate(OFF) end rule "TV Activity" when Item ActivityTV received command "ON" then sendCommand(HarmonyHub_CurrentActivity, "TV") ActivityBR.postUpdate(OFF) ActivityShield.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) end rule "Shutdown Activity" when Item ActivityOff received command "ON" then sendCommand(HarmonyHub_CurrentActivity, "PowerOff") ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityShield.postUpdate(OFF) end rule "Activity Sync" when Item HarmonyHub_CurrentActivity changed then if (HarmonyHub_CurrentActivity.state=="Shield") { ActivityShield.postUpdate(ON) ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) sendCommand(scenecontrol, "undef") } if (HarmonyHub_CurrentActivity.state=="TV") { ActivityShield.postUpdate(OFF) ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(ON) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) sendCommand(scenecontrol, "undef") } if (HarmonyHub_CurrentActivity.state=="Blu Ray") { ActivityShield.postUpdate(OFF) ActivityBR.postUpdate(ON) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(OFF) sendCommand(scenecontrol, "undef") } if (HarmonyHub_CurrentActivity.state=="PC") { ActivityShield.postUpdate(OFF) ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(ON) ActivityOff.postUpdate(OFF) sendCommand(scenecontrol, "undef") } if (HarmonyHub_CurrentActivity.state=="PowerOff") { ActivityShield.postUpdate(OFF) ActivityBR.postUpdate(OFF) ActivityTV.postUpdate(OFF) ActivityPC.postUpdate(OFF) ActivityOff.postUpdate(ON) sendCommand(scenecontrol, "undef") } end