I don't understand Sunrise/Sunset constraint

FrameXX

Well-known member
Isn't Before sunrise and After sunset the same? same applyes for After sunrise and Before sunset. What's the logic behind it?

Screenshot_20210918-160639.png
 
Last edited:

dsnz

Well-known member
obviously before and after mean a few minutes or up to 1 hour so
before sunrise is not the same after sunset

but an experiment is worth 1000 posts 😂

so if you experiment and log the time of the event and tell us it would be great
 

dsnz

Well-known member
btw.

the sunrise/sunset trigger is under Location (!) but
the sunrise/sunset constraint is under Date/Time

please @MacroDroidDev put in same category, Date/Time seems more logical
 

tanutanu

Well-known member
Isn't Before sunrise and after sunset the same? same applyes for After sunrise and Before sunset. What's the logic behind it?

View attachment 980
I guess the constraint logic is like that.
Before talking about the constraint, we need to think about sunset/sunrise time on the same day.
If today's sunrise is 6am and sunset time is 6pm, The sunset time should be passed around an hour ago in Czech. So before sunset constraint is false and after is true. On the same time, before sunrise is false and after is true.
Therefore, before sunrise and after sunset is different at this moment.
Around 5 hours later, passed 12am(0:00), before sunset will become true and after sunset changes to false as well. Before sunrise is true and after sunrise is false.
If I misunderstood it, give me the breakdown, Jamie. I would like to know the logic accurately.
 
Last edited:

FrameXX

Well-known member
@tanutanu It seems your theory is right as it works in practice with MacroDroid. It's now 21:55 and I am able to pass both after sunset and after sunrise. Can anyone clarify if this messy logic have some real usecase? Why not to constraint just day and night?

I will let run this macro over day to see how the constraints changes.
 

Attachments

  • Constraint_test.png
    Constraint_test.png
    59.8 KB · Views: 9
Last edited:

tanutanu

Well-known member
@tanutanu It seems your theory is right as it works in practice with MacroDroid. It's now 21:55 and I am able to pass both after sunset and after sunrise. Can anyone clarify if this messy logic have some real usecase? Why not to constraint just day and night?

I will let run this macro over day to see how the constraints changes.
I can understand what you want to say. Your opinion is that it needs 2 segments only.

6am to 6pm after sunrise and before sunset
6pm to 6am after sunset and before sunrise
Above sunrise/sunset time is an example. It is moving depending on the length of daytime.

It is also natural and good idea. On the other hand, I think current implementation is not so strange. The decision point is moving with the moment of the macro execution. I'm afraid with unexpected change suddenly.
 

dsnz

Well-known member
help message says (by long press on constraint) => before/after within day

so this must mean

before sunrise: 00.00 until sunrise-time
after sunrise: sunrise-time until 24.00
before sunset: 00.00 until sunset-time
after sunset: sunset-time until 24.00

and I think agrees with the observations before
 
Top