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

How do I use an AND/OR condition combined with a specific period?

JonJon Member
edited May 2018 in Questions & Help
Hey guys. I need your help! :)
Suppose I'd like to let my sun screen move up if a certain condition (e.g. "wind gusts are too high") are lasting for a certain period, for example 20 minutes or longer.

My current Weather Underground sample rate is every 10 minutes, so the sun screen then needs to go up when at least 2 samples are above the treshold value of (in my case) 40.
The way it's implement now (see screenshot below, under the first 'OR' condition) is moving my sun screen up too frequently... :(

What is the smartest way to implement this?

Basically it comes down to this: run flow A only when condition B is met at least X times.


Tagged:

Comments

  • MoekMoek Member
    edited May 2018
    Maybe you can use better logic?
    flow 1: IF very 15 minutes > AND windstoten is higher then 40 + Sunscreen is open > THEN increment number variable "windstoten".
    flow 2: IF number variable "windstoten" changed > AND number variable " windstoten" is 2 > THEN close sunscreen and set number variable "windstoten" to 0
  • MoekMoek Member
    Also maybe make a flow IF you close the sunscreen manually THEN set number variable "windstoten" to 0.
    Otherwise it could happen that the number variable is already at 1 when the screens are opened.
  • JonJon Member
    edited May 2018
    Hi @Moek thanks! Thought of some counter myself too. But like you mentioned in the second post, it will have to deal with the manual actions too, and that's where I expect to get messy.
    Hoped to have an even smarter solution therefore!  o:)
  • WillemWillem Member
    I just wonder if your WU can tell you exactly if at your're location the wind gusts are to high?
    I would use a local windmeter like a Netatmo windmeter or something simular to record that.  That's probadly way more accurate to record your local situation. Destroying your windscreens within 15 minutes as a thunderstorms comes up, is way more expensive.  :)
    I would not start the flow every 15 minutes, but only if the windspeed is picking up.

    Maybe you could also using the 'countdown' app to start a counter if the windgusts are to high. And using a logical variable to count the number of gusts within a period of time, and let the result of the variable trigger your flow. 
    Why not using a countdown timer if the windspeed is above a limit and ad +1 to a variable, and then reset your timer, if the windspeed drops again. If the variable reaches a certain number start your flow to raise the screens. If the counter reaches zero ( the windspeed is still to high and will not drop) raise your screens.
  • JonJon Member
    Willem said:
    I just wonder if your WU can tell you exactly if at your're location the wind gusts are to high?
    I would use a local windmeter like a Netatmo windmeter or something simular to record that.  That's probadly way more accurate to record your local situation. Destroying your windscreens within 15 minutes as a thunderstorms comes up, is way more expensive.  :)
    I would not start the flow every 15 minutes, but only if the windspeed is picking up.

    Maybe you could also using the 'countdown' app to start a counter if the windgusts are to high. And using a logical variable to count the number of gusts within a period of time, and let the result of the variable trigger your flow. 
    Why not using a countdown timer if the windspeed is above a limit and ad +1 to a variable, and then reset your timer, if the windspeed drops again. If the variable reaches a certain number start your flow to raise the screens. If the counter reaches zero ( the windspeed is still to high and will not drop) raise your screens.
    Hi @Willem how would you implement this in a flow? Screenshot much appreciated!
Sign In or Register to comment.