This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

OR Triggers for Alarm System (or other uses)

This might be a very n00b question, but can someone advise me if there is a way to set up OR's in triggers?

I'm trying to set up an alarm system - I have a door sensor and 2 PIRs (for now), so I'd like to set a trigger such as

"If Door Contact Sensor is On" OR "PIR 1 Senses Motion" OR "PIR 2 Senses Motion"... And "System Is Armed [yet to work out this bit]"... then [countdown to alarm] / [Alarm] after 20 seconds unless disarmed 

It seems this should be relatively simple but I see no way to set up OR events... without that I'm left with a separate flow for every device which doesnt seem particularly sensible or unified

Any help appreciated!

Comments

  • lubbertkramerlubbertkramer Member
    edited September 2017
    This can be:

    Trigger (For example motion is detected with the device card for all devices that can trigger motion) 

    AND Motions is sensor x is detecting motion + Alarm is ON
    OR Motion Sensor Y is detecting motion + Alarm is ON
    OR ??????
    OR ??????

    THEN Countdown alarm

    ELSE Do another action

    Other scenario:

    Trigger (For example motion is detected with the device card for all devices that can trigger motion) 

    AND Motion is detected in zone X + Alarm is ON
    OR Motion is detected in zone  Y + Alarm is ON
    OR ?????
    OR ??????

    THEN Countdown alarm

    ELSE Do another action
  • Yes you are right.. the current design is leaving you with multiple flows

    HOWEVER..

    there are few things you can do

    1) Use BetterLogic app and do a flow for each sensor to set a boolean variable. Use that to trigger your flow... - Seems counter-intuitive but makes management easier..

    2) use the devices option in the WHEN and selct motion sensors
    in the AND/ORs add a devices card and select the  type and zone



  • Thanks for the replies...

    If i set the first card as "An alarm turned on Motion Alarm" - how do I know what is under the category of Motion Alarm?
    It ultimately doesnt solve the issue that not all alarms are motion alarms, but all want to have the same effect (e.g contact alarm on doors)

    Do we know if there are plans to change this with the new mobile flow editor coming in v2? I don't want to spend ages trying to get my head around a slightly counter intuitive setup only to find waiting a few weeks would see me with what i need... It seems OR commands should be fairly basic structure in the When column?
  • lubbertkramerlubbertkramer Member
    edited September 2017
    vaderag said:
    Thanks for the replies...

    If i set the first card as "An alarm turned on Motion Alarm" - how do I know what is under the category of Motion Alarm?
    It ultimately doesnt solve the issue that not all alarms are motion alarms, but all want to have the same effect (e.g contact alarm on doors)

    Do we know if there are plans to change this with the new mobile flow editor coming in v2? I don't want to spend ages trying to get my head around a slightly counter intuitive setup only to find waiting a few weeks would see me with what i need... It seems OR commands should be fairly basic structure in the When column?
    A contact alarm is something else as a motion alarm so two different devices sending a different alarm. If you want to merge that you have to make some logic yourself or use the same type of device with the same alarm. What V2 will bring does only Athom know for now until they have more news to share with us but first we will get 1.6 :soon

    How do you know wich device gives wich alarm and works with wich card, that you can see on the tags of the card (so for motion device when pulled into the IF gives different tags to use then the door/window sensor :) )
  • How do you know wich device gives wich alarm and works with wich card, that you can see on the tags of the card (so for motion device when pulled into the IF gives different tags to use then the door/window sensor :) )
    So help me out with this one - I see the tags at the bottom (Zone / Name) and I see Tags at the top, but that just seems to list every tag I have in total - how exactly do i see the relevant tag names?

    Also, and this may be getting a bit clever... is there any way to say (in a single flow), if motion alarm for Living room is detected the turn on living room light, if motion alarm for dining room detected turn on Dining room light using tags somehow?
  • vaderag said:
    How do you know wich device gives wich alarm and works with wich card, that you can see on the tags of the card (so for motion device when pulled into the IF gives different tags to use then the door/window sensor :) )
    So help me out with this one - I see the tags at the bottom (Zone / Name) and I see Tags at the top, but that just seems to list every tag I have in total - how exactly do i see the relevant tag names?

    Also, and this may be getting a bit clever... is there any way to say (in a single flow), if motion alarm for Living room is detected the turn on living room light, if motion alarm for dining room detected turn on Dining room light using tags somehow?
    Yes...exactly as I explained in my post..

    create
    WHEN
    devices card = motion alarm
    AND
    devices card = motion alarm / living
    THEN
    turn on switch
  • Thanks.

    Think i'm getting there...

    I have a bit of an issue where I'm trying to set some logic but the variable isn't appearing:

    So - trying to set the arming routine - Alarm_Arming is set true for 20s then set false (so that I can turn off easier if not fully armed in a different flow) - I then set Alarm_Active after 20s. The tag list shows Alarm_Arming as a logic value, but I don't get Alarm_Active?

    Anyone know what i'm doing wrong?
  • It seems there are substantial issues with logic in general (or at least I seem to be having such):
    https://forum.athom.com/discussion/comment/59174


    Either way, I have another question maybe someone here can help with - is it possible to interrupt a flow part way?
    E.g. I want to have a separate flow that when Homey hears "Cancel the Alarm" or receives our NFC tag then it and it is still arming, then it stops the status of this flow and ensures that the values are reset

    How can I make this interruption happen?
  • @Vaderag  an example:
    Start your alarm-flow with a preset of a variable with a value corresponding to the number of times you want to play the sound maximal.
    Let a second flow start on a change of the variable and if this variable > 0, start the sound and decrement the variable (-1) with a delay that is the equal to the play-time of the sound.
    To stop the alarm you can make a flow that clears the variable (0).
Sign In or Register to comment.