Fighting with rules

The Group Status in the Sitemap is still “-” will this be a problem?

Group:Contact:OR(CLOSED, OPEN) gmpresence “Presence [%s]”

Try no space before the OPEN

Group:Contact:OR(CLOSED,OPEN) gmpresence "Presence [%s]"

Sorry Vincent

Still no luck :frowning:
Status is still “-”

Just checked the eventlog again. My Parents came home. THis works expected:

2018-04-02 23:57:27.965 [vent.ItemStateChangedEvent] - PapiMobile changed from OPEN to CLOSED
2018-04-02 23:53:06.369 [vent.ItemStateChangedEvent] - MamiMobile changed from OPEN to CLOSED

Try that
In the items file, define the group BEFORE the items

hmmm it’s kinda fucked up.

I did comment all mobiles out only one. And put the Group infront. Now it shows a status.

So i put back the devices one by one
It should have changed the status from “Closed” to Open with the last device, beacuse this one is offline and considered as “Open”.

Sadly still “Closed”

Are we right with the statement “OR” infront of the Group? Or should it be AND?

Yes we are right, you have three phones at home so your state for presence is CLOSED
If ALL the phones are OPEN then your presence is OPEN
It is working!!!

rule "ALARM"

when Item HueTrigger changed from OFF to ON            

then
    if (gmpresence == 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

Sorry it took so long, the rules should work now,
You only need one rule for turning off your lights
And a simple if check for setting your alarm

Good luck

Yeah!

Edit!

Still Thanks!

but the Alarm Rule doenst work. I dont see any error. The State is actually “OPEN” but it doenst trigger when i hit the motion sensor :\

No Alarm Lights are happening

edit2

i fixed it. It was “gmpresence.state==open”

Vicent
Since you are this skilled.

I got another question :smiley:

the command " Reto_Office_Alarm.sendCommand(“LSELECT”)"

Let the Bulbs Blink 10x. Is it possible to repeat the “LSELECT” Command as long till i turn it manually off?

I am sorry I don’t quite understand want you want to do.
What do you means turn manually off? What item?

Well when i send the Command “Reto_Office_Alarm”
The bulbs blink 10x but then all lights turn off, till someone hits the Motion Sensor again.

Is there a possibility to loop this command, so the Bulbs wont stop blinking till i manually turn off the lights? or hit any “Alarm Off” button?

What makes the light blink? A rule?

Install the expire binding

Create an item:

Switch Reto_Office_Alarm_Timer { expire="10s, command=OFF" }
rule "ALARM"

when Item HueTrigger changed from OFF to ON            

then
    if (gmpresence == OPEN) {
        sendNotification("xyz@xyz.com","ALARM")
        //sendMail("xyz@xyz.com", "Bewegung Erkannt", "ALARM")
        Reto_Office_Alarm.sendCommand("LSELECT")
        Reto_Office_Alarm_Timer.sendCommand(ON)
        Treppe_Alarm.sendCommand("LSELECT")
        Reto_Flur_Alarm.sendCommand("LSELECT")
        Wohnzimmer_Alarm.sendCommand("LSELECT")
        Esszimmer_Alarm.sendCommand("LSELECT")
        Papi_Office_Alarm.sendCommand("LSELECT")
    }
end
rule "Reto office lights timer"
when
    Item Reto_Office_Alarm_Timer received command OFF
then
    if (ItemToSwitchAlarmOff.state == ON) {
        Reto_Office_Alarm.sendCommand("LSELECT")
        Reto_Office_Alarm_Timer.sendCommand(ON)
        ItemToSwitchAlarmOff.postUpdate(OFF)
    }
end

Now when you set the alarm with the hue trigger, the timer with the expire binding will start
When it expires after 10s it will turn to OFF and check if you have turned some item ON.
It is it turned on, it will resend the command to blink the lights, start the timer again and reset the alarm off item.

Good luck

Hi there

Thanks for your answer. I had exams so i couldnt test it.
I will try it this week. Thank you again!

I forgot to ask you one thing again :slight_smile:

I now have a total of 4 Sensors. How do i set up this Rule with 4 Sensors active?

What are the 4 sensors? and do you wnat to do the same thing with them?

Hi Vincent.

Well i have Placed 4 Motion Sensors in our House. And if we are out it should detect “Thiefs”. So what we did for 1 motion sensor, id like to expand the rule so all 4 Sensors can detect the thiefs not only one.