Sunrise-Sunset and Calendar functions for edge

I have an at or after Sunset as the trigger using this Edge device, and for about a week or so last month it wasn’t running at Sunset. But over the last few days or so it has started running at Sunset again.

I noticed it happening around the time when SmartThings was apparently making changes to add the ability for some ‘time’ and ‘<’ & ‘>’ features for devices in Routines to run local now. So hopefully the dust has settled. I also went in and re-saved those Routines to get the local symbol now so maybe that helped too.

@Mariano_Colmenarejo - First of all thank you very much for this driver. It’s a very valuable little tool that well most certainly be very needed in the absence of the very versatile date-related functionality we had in webCoRE. It will be invaluable for my heating schedule come next November.

Would it, by any chance, be possible to include Seasons as an added capability? I do realise that there are complications to this (as in meteorological vs “official” season dates), so I do appreciate the complexity in doing this. In my case I have a couple of uses for it - I determine the irrigation and pool pump schedules based on the season. Whether you do this or not - thanks, I will still use this driver for a variety of other reasons.

Hi @nayelyz - will the Smart Lighting and Severe Weather plugins be available in Europe this time round? Or will it be the same as it was with groovy (i.e. not available to anyone in Europe?

Hello Martin

It is very easy now to make an automation for a period of time.(season)
you can now set an interval in automation conditions for the Date YYYYMMDD capability.
Only the comparison in the android app has a bug and the lower limit doesn’t execute the routine when it equals the set value, but they will fix it.

Example for fall season:

You are right, hadn’t thought of doing it in the manner you explained, thank you! One slight drawback of this is that you have to reset it every year…

Or I can add conditions in the same routine to cover 10 years into the future which will more than suffice… Perhaps the best way would be to have a virtual Dimmer with values 1, 2, 3 & 4 representing the seasons, then run a routine to set that value every day at 12:00am. It would eat up one device slot and 4 routine slots, though, whereas WebCoRE used nothing of such resources, but at least there’s some workaround that I can use.

I just wish they’d revise upwards those silly 200 limits on both devices and routines.

Yes, saw this from earlier in the thread. Hopefully, it will be fixed soon enough, so I will assume it will be when creating any routines.

Then you can use capability Local Month and Day (MMDD)

Example for Sep/21 to Dec/21:

1 Like

Fantastic, yes. I will try this out, am sure that option will work - many thanks once again!

Will the values change on their own at midnight? As in if I do a routine to set a Season value (in a switch or whatever other manner), will it run on its own because the value of DD changes, or would I need to make it run every day - e.g. at 00:01 every day? (I am assuming that if the values change on their own, the routine will kick in on its own because a value will have changed.)

1 Like

Yes, all days change DD and routine will waiting for the others conditions.
If you add one condition of hour of day, tehn routine will be executed at this hour all days of season

2 Likes

Hello all.
@Mariano_Colmenarejo if I use your Sunset option in a routine, with the Pre-condition option active, the routine won’t work. Is this normal?
I tried with the built-in Sunset function of ST and it works.

@nayelyz I’m trying to use the built-in weather option, and what I need is one routine that runs if it’s raining and another routine that runs if it isn’t raining…
So I have this for the rain:

And this for the “non rain”:

And sometimes the “non rain” routine fails (the rain I don’t know, because there is no rain in Portugal for quite some time). My guess is because in the routine we can only select 2 option: Clear and cloudy (I guess… Because I have it in Portuguese). And if I check the Weather Channel, clicking on the app icon, sometimes it has another options, like Fog.
Could this be the problem?? Since we can only select 2 conditions, if the current condition has another text it won’t work??
Until now, I had no problems using the “SmartWeather Station Tile” in Webcore. What I did was to search for the text “rain”

How can I achieve this ???

Another question: Scenes are running in the cloud. In the future will they run locally?

Thanks!!!
Best Regards

Hi @andre_petinga

Preconditions don’t trigger routines, shouldn’t work with sunset stock function either.

the triggers are the month intervals and they will only be activated when the current date meets the month intervals and one of them changes from false to true and it will rarely be when the precondition is sunset

So, to make this work

I’ll have to split it in 2 routines. One for “Local Month: 10~12” and another to “Local Month: 1~2”
And, in addition, I’ll have to remove the Pre condition option of the Sunset, like this:

Am I right?

To save an automation you can do the same between dates, but you will have to modify it every year, I think it is an affordable price.

Example for 01/Aug/2022 to 28/Feb/2023

1 Like

Hi @Mariano_Colmenarejo, I tried to set up my irrigation schedule following a seasonal pattern, and I set up my Summer schedule as follows:

That should mean that in Summer the irrigation goes off after 4.5 minutes. then I have the winter schedule, as follows:

That should mean that the irrigation goes off after 1 minutes 30 seconds in Winter. It didn’t work for me, though. It’s still summer and yet the irrigation is going off after 90 seconds - which is the winter schedule.

I have a slight suspicion that when appending MMDD together, leading zeroes are getting dropped - it is certainly the case for the Month but I don’t know if it is happening also for Day. Now, whilst the month has no effect on the range because the days remain sequential, dropping the leading zero of the day would be catastrophic for the sequence as it would mean that 8th Sep is 98, however I am not sure about this as 98 is not within any range that I have specified. So it could be something else entirely. So… am I doing something wrong?

Hi @martin.borg

All day, month, and year values are converted to a numeric value that can be compared in the routines conditions, so the leading zeros disappear.
For example for today sep/08 the driver is emitting in the month and day capability the value 908, (month 9 day 8), therefore it should work fine

For the numerical value generated for routines conditions to have the ascending value with time, you must always enter the dates in this order: year YYYY, month, MM, day DD, hour, HH and minutes mm

2022-09-08T19:28:36.378177691+00:00 INFO Virtual Calendar Mc <Device: 4e1f0a56-3ab0-4741-a97e-94b18ec34993 (Virtual Calendar Device)> emitting event: {“attribute_id”:"localMonthDayOne",“capability_id”:“legendabsolute60149.localMonthDayOne”,“component_id”:“main”,“state”:{"value":908},“visibility”:{“displayed”:false}}

I have made a similar routine and so that when I turn on a light bulb it turns off after 1 minute and it works fine, light turn off after 1 minute

I have made another with the interval 101 to 320 and the light does not turn off after 1 minute

Eye! :eye_in_speech_bubble:I don’t know if it has anything to do with it, but I have seen that in the routines app last update, they have put a button to edit them. However, if you touch a condition and you touch it, you can modify it and it lets you save and on some occasion it has seemed to me that although the changes are saved, it does not work well.
I try to hit the edit button to modify them

Hi, @andre_petinga. As I understand, you’re using a feature that is native in the app, so, if it doesn’t work properly, please contact the SmartThings Customer Support team. They handle issues related to the app that are not related to customization/development.
Sorry, I cannot help you further but that team has more permission to see what’s going on with your Routine’s execution.

Open this section to see more info:

You can contact them by following any of these paths:


Through the SmartThings Web page

  1. Enter this page
  2. Click on “Support” in the upper-right corner
  3. Check if the URL includes your region. For example, en-us here: https://support.smartthings.com/hc/en-us
  4. At the bottom, select “email” and describe your issue as detailed as possible.
  5. Click on “submit”

From the ST app

  1. Open the SmartThings app
  2. Go to the menu tab at the bottom-right corner.
  3. On this page, select the option “contact us” and then go to “Report a problem”
  4. Accept the generation of logs, fill up the form describing your issue as detailed as possible, and screen captures of the issue always help.
  5. Click on “submit”. The Customer team will receive this info.

Via email

US: 1-866-813-2404
US: support@smartthings.com
UK support 0333 0000333
UK: support@smartthings.co.uk
CA: support@smartthings.ca

Yes, that obviously works but would be so much better to use only one routine so when the lights or switches change you don’t have to edit multiple routines/scenes. Having the ability in the time range to select one of the times as sunrise/sunset and the other to be specific time would be very useful. (tagging @nayelyz)

Please, for feature requests in the native tools of the app (like Routines), contact the SmartThings Customer Support Team. I don’t know if someone else has requested to select both time references and there’s already a report for it, but they can give you more info.

1 Like

Thank you @Mariano_Colmenarejo for your reply.

I tried to do some further testing following your reply. I had created these Routines from scratch, not using the new Edit button. As I said in my last post, I have four routines - one for each season, to control irrigation. Seems like despite setting the ranges (5 ranges: 101 - 320, 321 - 620, 621 - 920, 921 - 1220, 1221 - 1231) as you explained, it seems like all five of them were being activated. I verified this by setting up notifications in each Routine, like “This is the Summer irrigation routine”, “This is the Fall irrigation routine”, etc. And - I noticed, I was receiving all 5 notifications. The irrigation was turning off after 90 seconds - not because the winter Routine was getting activated instead of the summer one, but because it is the shortest one, and therefore it was turning off my irrigation before the other ones were.

Not sure why this is happening, but it most certainly is for me :confused:

How long do you leave the Routines running before you determine they aren’t working? Long enough for the Virtual Calendar device to have updated your precondition? I am just wondering if the precondition is defaulting to true in the absence of a known value.

I am not sure I understand what you mean. My routines are in post 133 above, and they basically say that if “Local Month and day One” is within a certain range (e.g.the summer range) and an irrigation switch goes on (that is controlled by a different routine we do not need to get into as it is independent of this Virtual Device), then it will wait x minutes before turning off irrigation switches. So…

I am not sure what you mean by this part. I created the 5 Routines a few days ago - 4/5 days now, and they haven’t worked well for me since (though to be fair I disabled them after they malfunctioned 3 days in a row).