Sunrise/Sunset

So, I know why this doesn’t work (because it only runs once, and if that’s not at the right time it won’t do anything).
But how can I make this work?

First: what do you want to do?

1 Like

To discover what it does(n’t) do, I suggest to add notification or log cards to all possible points in your flows.
Like the red cards in this example flow:


(and add the flow name in these kind of cards :wink: )

Today the sun rises at 5:51 in Rome.
That is before 6:00. So the flow stops here.

3 Likes

Hi @Luigi_Colancecco ,
the flow will work perfectly on most homes.
As soon as the sun rises
if it is a workday and after 6:00h then set variable to 1
(else, if sun rises before 6 am do nothing)
if it is workend and after 8:00h then set variable to 2
(else, if sun rises before 8 am do nothing)
So obviously the variable is only set in autumn and winter.
If you want to get the variables set also in spring and summer, you need to adapt this multi condition test flow to your needs


add to your triggers the one
When it is 6:00h
When it is 8:00h
and add the relevant AND conditions
Have fun
Dirk

So I got it to work like I want it to (I’m pretty sure lol)
But how can I simplify this?
FYI you can disregard the MODES: variable, as that’s just what I use to turn on/off pretty much everything in my house
@DirkH I will try this

I’m basically creating an AOI, or “Add On Instruction”
I want to create a set “routine” that changes a variable that I could place anywhere, in any flow, which executes a number of cards so I don’t have to keep recreating the same group of cards over and over again, just like you would do with the industrial Allen Bradley logix5000 logic, or as close to it as I could get.
In this particular “AOI” I want to use the Sunrise/Sunset Variable.
*WHEN the sunrises AND it’s a weekday AND it’s later than 6:00am THEN set variable to 1, if
not, set it to 2
*WHEN the sun rises AND it’s a weekend day AND it’s later then 8:00am THEN set variable to
1, if not then set it to 2
*WHEN the sunsets, change variable to 2 regardless of anything else
This way, instead of repeating all those cards over and over, I could just use the Sunrise/Sunset variable, does that make sens?

Ah, a puzzle!

It can be simplified indeed;
“Twin” triggers and conditions can be “undoubled” like this

Next to the “true” output (blue), the weekday cards have a “not true” output (orange), which eliminates the use for the weekend conditions:

The second (from top to bottom) “after sunrise” condition is identical to the first one, so it may go. Just like the weekday condition, both true or false starts the exact same “after sunrise” condition flow cards:

But, sometimes it’s easier to “read” a flow when it’s not stripped down to the absolute minumum of needed cards.
Or you could add notes, to clarify stuff for yourself.
I’ve managed to make some flows I had a hard time to “decrypt” again later on :rofl:

By the 2nd optie.

Parallel to the “Time is 06:00” cart to bring back the “Time is 08:00”. (also to the top #MODES cart)
Because otherwise the “Weekend” get no time start.

1st block is time the trigger and is sunrise 2nd factor.
2nd block is sunrise the trigger and is time 2nd factor.

1 Like

That is really OK.
It is straight forward and it is easy to avoid mistakes.
Only in case you have to change something later you have to do it 4 times. But using the Sunrise/Sunset variable and trigger other flows by this variable is a good solution.

So, thank you for everyone’s input! This is what I came up with after reading all of your posts, and I think it should work just fine!
I just realized this still won’t work :face_with_diagonal_mouth:
All I want, is:
A. The Sunrise/Sunset bit to flip to 1 when the sun rises, and 2 conditions need to be true.
1. It’s after 6:00am on a weekday
2. It’s after 8:00am on a weekend
B. The Sunrise/Sunset bit to flip to 2 when the sun sets.
I feel like this shouldn’t be that difficult lol!
Is there a way I could have it “wait” for the sun to rise?

I think I may have gotten it this time!

I think you want to remove the yellow lines. Now the flow continues no matter what the value of ‘sunset/sunrise’ is.


If “sunrise/sunset’ is exactly 3 is true the blue line sets ‘sunrise/sunset’ to 1
If ‘sunrise/sunset’ is exactly 3 is NOT true the yellow line sets ‘sunrise/sunset’ to 1
So is doesn’t matter what the value of ‘sunrise/sunset’ is it will be set to 1

1 Like

OK, I think (Hope) this is “THE ONE!”