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.

Compare variables to an array instead of running 3 consecutive flow?

I have a flow that polls an API for the status of a device and it has 40 states. The variables are in 2 letter format and I have narrowed down the activation of the flows to 3 flows but is there a cleaner way to compare the better logic variable to just 1 flow card, i.e. if variable is either of these (AA, AS, VD, DF, GS, IM, ND) then execute? at the moment I'm using the "or" section of the flow editor but there is a limitation of 3 per flow so I've to execute another flow under the else and re-compare that.  
 

Comments

  • There are no Arrays, 
    but I guess you could do with 7 OR's.... That is not Possible with Homey! 
    But you could use 7 AND's

    and It was already posted here (but understand You could not find ;-) )
    https://forum.athom.com/discussion/comment/69162/#Comment_69162

    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.)

  • viixviix Member
    Omg that worked! Why didn’t I think of that! Thanks!
Sign In or Register to comment.