rule "Leaving Home Routine"
when
Item Leaving_Home_Trigger changed from OFF to ON
then
KodiHTPC2_Stop.sendCommand("ON")
KodiHTPC2_SendSystemCommand.sendCommand("SHUTDOWN")
Trigger_PowerOffLR.sendCommand("ON")
logInfo("Rule", " Leaving Home Routine Ran (Routines.rules)")
end
rule "Power OFF LR Routine"
when
Item HTPC2_Online_Status changed from ON to OFF
then
if (Trigger_PowerOffLR.state == ON) {
Plug3_Switch.sendCommand("OFF")
Plug2_Switch.sendCommand("OFF")
Lamp1_Brightness.sendCommand("0")
BULB6LRMAIN1_Color.sendCommand("64,3,0")
Bed_Trigger.sendCommand("OFF")
Leaving_Home_Trigger.sendCommand("OFF")
Trigger_PowerOffLR.sendCommand("OFF")
logInfo("Rule", " Power OFF LR Routine Ran (Routines.rules)")
}
end
the reason i had trouble with this rule was it kept turning stuff off when htpc went to sleep this was not what i wanted to happen i only want it to run when called by the button press