@Mariano_Colmenarejo, @martin.borg & @montyfert, sorry guys I am just answering this. I agree with you that this is a counter intuitive behaviour, and this was reported to the team. @Mariano_Colmenarejo great job finding the error.
@andresg I have had to remove the Routines in question as I needed to move them to SharpTools
after I hit the dreaded 200 limit, so you wonât find my respective Routines in there regrettably. Hopefully, the team has understood whatâs wrong with it and can fix it without Routines.
Hi, @martin.borg
Thank you for letting us know. We noticed that, nevertheless, @Mariano_Colmenarejo find the clue on what the root cause was, so now the focus of investigation is different, and maybe we donât need those examples anymore.
@Mariano_Colmenarejo can you understand why this routine was executed today?
It should have stopped yesterdayâŠ
It should have stopped yesterday if the routines worked well, but unfortunately they are making changes daily and stop working some things and solve others.
They have added the intervals and they do not work well, other days the comparison equal to has not worked.
The driver is sending a value 10, (October)
Try to do it with local month >=5 and local month two <=9, this works today, tomorrow I do not known
Just made a test like you said and I got the notification, so it didnât work
I guess I have to wait a few days (months) until all is stableâŠ
The other day you mentioned a problem with the lower value when we are using limits.
And I guess the upper value has a problem to.
This worked (no notification)
So âupper value - 1â works
So, in november, my routine will finally stop
I tested the same and It works fine for mi
Deleted - moved to different thread
There is some news about this erroneous behavior of routines that have a precondition and two or more OR conditions (any of the conditions is true).
We cannot use these routines with any capability, temperature, humidity⊠since they behave like a multiple OR condition including the precondition as well.
If it is done with a precondition and one or more conditions type AND (that all conditions are met) then it works fine.
Maybe it would be good to create a separate thread for this problem so donât forget it
Thanks
Hi.
I use rules rather than routines if there is any complexity involved and Iâve bumped into a little problem with sunset/sunrise. I want to be able to compare the current time with sunset/sunrise, but they are in different formats, so they never evaluate to true.
Capability Attribute Value
legendabsolute60149.sunRise sunRise â08:20:00â
legendabsolute60149.localHourTwo localHourTwo 749
Any ideas? I tried to evaluate against - time{reference: now} but it appears that it is only allowed to compare that to the internal time functions (sunset/sunrise/noon) and not to a device generated value.
Hi @mrfitz98
You have to use the sunset offset Time or sunrise Offset Time.
If you compare with sunset Offset time == 0 minutes then it means that the current time is exactly the sunset time of that day.
If Sunset Offset Time = 0 min then âŠ
If Sunrise Offset Time = 0 min then âŠ
You can also use x minutes before (-x) or x minutes after (x)
If Sunset Offset Time = -30 min then âŠ
If Sunrise Offset Time = +60 min then âŠ
With rules you must use capabilities
legendabsolute60149.sunRiseOffset1
legendabsolute60149.sunSetOffset1
Gah, so simple! Thank you.
I suggest this long ago but it didnât pick up any interest, instead of just sunset and sunrise and having to adjust offsets, it would be much better if we have the different twilights (at at least dusk/dawn) calculated.
Eg civil twilight, nautical twilight and astronomical twilight.
This is also useful for those located above the artic circle or below the antartic circle where the sun never sets during certain period of the year, eg Norway, Sweden, Findland and Iceland
Hi @Daijoubu
I donât know if I understood it correctly.
I believe that the sunset and sunrise offsets are necessary and used in routines for many more reasons than the ones you describe.
Iâm no expert, but I put Reykjavikâs coordinates in the virtual calendar and it calculates the same sunrise and sunset times that any weather page shows and I guess smartthings too.
I donât know if they will be usable or will serve something throughout the year.
The calculation is Based on algorithm by United Stated Naval Observatory, Washington, from a public GitHub, I just adapted it for use at the driver edge.
- This driver was done, because they announced that smart lighting app would disappear with groovy and in routines you could only advance or delay sunrise or sunset time by 60 minutes and here an offset of +/-10 hours was added.
- Now it has not disappeared and sunrise and sunset can be delayed and advanced up to 23:59 hours with the smart Lighting app, in areas where it is enabled
The idea is that for example during civil twilight, where thereâs still enough light to do outdoor activities after the sunset, varies in length depending if itâs summer or winter, at my location itâs close to 30mins in winter but in the summer, itâs about 45mins.
In Iceland, during the 3 months of summer, itâs twilight all night after sunset (never gets dark)
So instead of hardcoding an offset, it would be nice if we can set an outdoor light to turn on only when it gets darker/darkest after the sunset depending on season.
Isnât possible to create some state inside the calendar that act like a virtual switch when the time is between night and day?
My automation doesnât work with the default sunset-sunrise, because itâs automatically created as a precondition, but if i create a virtual switch it works.
But since I donât like to see a lot of virtual switch I would like if possible to be a state inside virtual calendar, like a 0 and 1.
I believe Virtual Calendar Mc from @Mariano_Colmenarejo will do what you want.
It may be useful to create a capability to activate day (sunrise to sunset) and night (sunset to sunrise) routines.
Letâs see if I have time to do it
@h0ckeysk8er the closest thing that the Virtual Calendar Mc has itâs sunset and sunrise with a condition that equals to 0 but in my case that doesnât fit the needs. But thank you for the suggestion!
@Mariano_Colmenarejo What you described itâs exactly what I was thinking, that would be perfect! Thank you