Im fighting with multiple Rules. I hope i can use only 1 Rule.
Im activating the Motion Sensor as an alarm sensor when every mobile disconnected from the WLAN.
Same for the Lichts. They will automaticly turn all off, when noone is in the WLAN, the system turn off all lights.
Now there is the problem. I got 4 Mobiles and i have to create 4 rules, because the first “when” is checking if a mobile is present.
Now i have to put everytime a new mobile after the “when” because otherwise it wont trigger when another mobile leaves the house as last.
rule "Licht Aus1"
when
Item RetoMobile changed from CLOSED to OPEN
then
if ((PapiMobile.state==OPEN) && (MamiMobile.state==OPEN) && (ChantalMobile.state==OPEN))
{
//sendNotification("xyz@xyz.com","Licht Aus")
//sendMail("xyz@xyz.comt", "Bewegung Erkannt", "ALARM")
Reto_Office_Licht.sendCommand(OFF)
Reto_Flur_Licht.sendCommand(OFF)
Treppe_Licht.sendCommand(OFF)
Wohnzimmer_Licht.sendCommand(OFF)
Esszimmer_Licht.sendCommand(OFF)
Papi_Office_Licht.sendCommand(OFF)
}
end
Here you see. In the Second rule, after when “PapiMobile” will go first and switched with RetoMobile.
The same Problem im Facing with the “alarm” rule.
rule "ALARM"
when Item HueTrigger changed from OFF to ON
then
if ((RetoMobile.state==OPEN) && (HueTrigger.state == ON) && (PapiMobile.state==OPEN) && (MamiMobile.state==OPEN) && (ChantalMobile.state==OPEN))
{
sendNotification("xyz@xyz.com","ALARM")
//sendMail("xyz@xyz.com", "Bewegung Erkannt", "ALARM")
Reto_Office_Alarm.sendCommand("LSELECT")
Treppe_Alarm.sendCommand("LSELECT")
Reto_Flur_Alarm.sendCommand("LSELECT")
Wohnzimmer_Alarm.sendCommand("LSELECT")
Esszimmer_Alarm.sendCommand("LSELECT")
Papi_Office_Alarm.sendCommand("LSELECT")
}
end
I just tested it. And did the Switch as “default” on the sitemap.
Sadly the Switch does not turn “on” automaticly when the device comes online with the state “Closed”.
The Switch stays Off. So this solution will not work. Any Idea how i can tell the Switch, that On == CLOSED and not ON == ON?
On your log what happens to the mobile item when it goes online/offline?
Or create a sitemap switch for one mobile, what happens to the switch when the mobile goes online/offline?
rule "Licht Aus"
when
Item gmpresence changed from ON to OFF
then
//sendNotification("xyz@xyz.com","Licht Aus")
//sendMail("xyz@xyz.comt", "Bewegung Erkannt", "ALARM")
Reto_Office_Licht.sendCommand(OFF)
Reto_Flur_Licht.sendCommand(OFF)
Treppe_Licht.sendCommand(OFF)
Wohnzimmer_Licht.sendCommand(OFF)
Esszimmer_Licht.sendCommand(OFF)
Papi_Office_Licht.sendCommand(OFF)
end
rule "ALARM"
when Item HueTrigger changed from OFF to ON
then
if (gmpresence == OFF) {
sendNotification("xyz@xyz.com","ALARM")
//sendMail("xyz@xyz.com", "Bewegung Erkannt", "ALARM")
Reto_Office_Alarm.sendCommand("LSELECT")
Treppe_Alarm.sendCommand("LSELECT")
Reto_Flur_Alarm.sendCommand("LSELECT")
Wohnzimmer_Alarm.sendCommand("LSELECT")
Esszimmer_Alarm.sendCommand("LSELECT")
Papi_Office_Alarm.sendCommand("LSELECT")
}
end
rule "Licht Aus"
when
Item gmpresence changed from OPEN to CLOSED
then
//sendNotification("xyz@xyz.com","Licht Aus")
//sendMail("xyz@xyz.comt", "Bewegung Erkannt", "ALARM")
Reto_Office_Licht.sendCommand(OFF)
Reto_Flur_Licht.sendCommand(OFF)
Treppe_Licht.sendCommand(OFF)
Wohnzimmer_Licht.sendCommand(OFF)
Esszimmer_Licht.sendCommand(OFF)
Papi_Office_Licht.sendCommand(OFF)
end
And
rule "ALARM"
when Item HueTrigger changed from OFF to ON
then
if (gmpresence == CLOSED) {
sendNotification("xyz@xyz.com","ALARM")
//sendMail("xyz@xyz.com", "Bewegung Erkannt", "ALARM")
Reto_Office_Alarm.sendCommand("LSELECT")
Treppe_Alarm.sendCommand("LSELECT")
Reto_Flur_Alarm.sendCommand("LSELECT")
Wohnzimmer_Alarm.sendCommand("LSELECT")
Esszimmer_Alarm.sendCommand("LSELECT")
Papi_Office_Alarm.sendCommand("LSELECT")
}
end