How to create a flow trigered by event (when) OR event (when)?

Hi,

I would like to create a flow that opens my shutters when sun rises but not before 7h. This only from monday to friday and not in summer.

My flow should be like : IF (time = 7h) OR (sunrise AND time > 7h) THEN open shutters

I have tried IF (sunrise) AND [ (time > 7h) AND (day in week) AND (it’s not summer) ] THEN open shutters. It’s working fine when sun rises after 7h but I think it will not next spring when for exmple sun rises at 6h…

I don’t know how to create such flow…

Thanks.

You need 2 flows that respect each other’s time and sunrise:

If…
Time = 7 h
And…
It’s after sunrise
It’s a weekday
It’s not summer
Then…
Open shutter

If…
It’s sunrise
And…
Time > 7 h
It’s a weekday
It’s not summer
Then…
Open shutter

Another approach is to have three flows. It might seem like it’s more flows but you keep all the conditions in one place.

Open Shutters At 7 flow
When
Time = 7 h
Then
Start Flow Check Open Shutters

Open Shutters At Sunrise flow
When
Sunrise
Then
Start Flow Check Open Shutters

Check Open Shutters Flow
When
Flow Starts
And
It’s after sunrise
Time > 7 h
It’s a weekday
it’s not summer
Then
Open shutters.

I’m not saying this is better than @DirkG way, but just giving you options.

3 Likes

@Adrian_Rockall, I love how you built the flows! :+1:t3:

1 Like

Thanks guys.

My idea was to have only 1 flow, I have already 2 flows for that, just wondering if it was possible to have a flow with 2 “WHEN”.

And also, my shutters are Somfy RTS, so no state possible to know if it’s down or up.

PS : the Adrian’s solution is very “clean”, I like it !
PS2 : the only one problem is that Homey wil send open order twice to open shutters…

I have RTS curtains and blinds and they don’t mind having the commands sent twice. The actual device knows if it’s open or closed so they just ignore the second command.

Not possible.

Homey and trigger it’s like Highlander
„ There Can Be Only One“
:joy:

2 Likes

After running the flow you can disable it and enable again after 2 h, or whatever.
Therefore you don’t need additional flows.

Thanks for answers.

Adrian is right, I can send several UP signals, if it’s already opened, no matter (in my case it’s opened twice a day), and disabling flow would not change a lot.

Finally, I keep the solution with 2 flows : one to open at 7 if sunrised already, and one to open when sunrise if time is later than 7.

Extra question : can someone give me an example of the ELSE function ? I understand this:
WHEN something
AND (conditions OR other conditions) -> is it right ?
THEN action
ELSE alternative action which happens when conditions are not verified ?

The conditions in the “And…” section must be fulfilled for the action part in the “Then…” section to be executed.
If there is an “Or” in the “And…” section, then one of the two conditions or groups of conditions must be fulfilled for the action part in the “Then…” section to be executed.
If no condition or group of conditions is fulfilled in the “And…” section, then the action part in the “Else…” section will be executed.

A simple example is to set a variable. In my case I switch a Yes/No variable to know if the TV is on or not.
If the energie of the smart plug is more than 25 W then the variable is set to Yes.
If the energie of the smart plug is less than 25 W then the variable is set to No.

Very clear, thank you !