Files, scripts, howtos and more for openHAB.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

rule "Presence Person1 online"
when
Item Smartphone1_Fritzbox changed to ON or
Item Smartphone1_DDWRT1 received command ON or
Item Smartphone1_DDWRT2 received command ON
then
postUpdate(Presence_Person1, ON)
end
rule "Presence Person1 offline"
when
Item Smartphone1_Fritzbox changed to OFF or
Item Smartphone1_DDWRT1 received command OFF or
Item Smartphone1_DDWRT2 received command OFF
then
Thread::sleep(180000) // Warte 3 Minuten
if (Smartphone1_Fritzbox.state==OFF && Smartphone1_DDWRT1.state==OFF && Smartphone1_DDWRT2.state==OFF) {
postUpdate(Presence_Person1, OFF)
}
end
rule "Presence Person2 online"
when
Item Smartphone2_Fritzbox changed to ON or
Item Smartphone2_DDWRT1 received command ON or
Item Smartphone2_DDWRT2 received command ON
then
postUpdate(Presence_Person2, ON)
end
rule "Presence Person2 offline"
when
Item Smartphone2_Fritzbox changed to OFF or
Item Smartphone2_DDWRT1 received command OFF or
Item Smartphone2_DDWRT2 received command OFF
then
Thread::sleep(180000) // wait for 3 minutes
if (Smartphone2_Fritzbox.state==OFF && Smartphone2_DDWRT1.state==OFF && Smartphone2_DDWRT2.state==OFF) {
postUpdate(Presence_Person2, OFF)
}
end
rule "Presence Overall online"
when
Item Presence_Person1 changed to ON or
Item Presence_Person2 changed to ON
then
postUpdate(Presence_Overall, ON)
end
rule "Presence Overall offline"
when
Item Presence_Person1 changed to OFF or
Item Presence_Person2 changed to OFF
then
if (Presence_Person1.state==OFF && Presence_Person2.state==OFF) {
postUpdate(Presence_Overall, OFF)
}
end