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.

More than 3 OR statements?

I have just purchased some NFC tags to use for disabling alarm system.

I have When NFC tag detected and TagID= Tag1 or TagID = Tag2 etc disable.
I'd like to have 5 tags, but seems the max homey will allow in OR statements is 3

Any workarounds?
Thanks!

Comments

  • Easiest way to do duplicate the flow, but the else should not be used.
    Create a homeyscript for a condition  with an array of 365 different tags and use indexOf to check if it is one of the known good tags. The HomeyScript is more complex but scalable to any number. 
  • Even Better is to do it with inverted logic, 

    Your Question is ( A=1  OR  A=2  OR  A=3) 
    You could write that as
    Not ( A!=1 AND A!=2 AND A!=3 )

    This last one has for Homey no limits as we can have more then 3 ANDs in the condition.
    So, Make a Flow with 5 x AND NFCTagID is Exactly not ..... (Can be default Homey Logic)
    Add Your Then to the ELSE part  to have it a Global NOT 
    If you had a Else Part add that to the THEN Part (or Leave empty.)
  • Even Better is to do it with inverted logic, 

    Your Question is ( A=1  OR  A=2  OR  A=3) 
    You could write that as
    Not ( A!=1 AND A!=2 AND A!=3 )

    This last one has for Homey no limits as we can have more then 3 ANDs in the condition.
    So, Make a Flow with 5 x AND NFCTagID is Exactly not ..... (Can be default Homey Logic)
    Add Your Then to the ELSE part  to have it a Global NOT 
    If you had a Else Part add that to the THEN Part (or Leave empty.)
    Perfect - thanks - that's exactly the kind of outside the box thinking i was looking for ;)

    Works a treat :)
Sign In or Register to comment.