Automate a duty cycle during daytime?

I’d like to have an outlet turn on for 1 minute every 10, from 30 min after sunrise to exactly sunset, only if my local temp is >78F. I can use zip code weather or I can use a sensor of my own. I can vary my minute and general bounds, but my example here makes a nice clean start for me.

I can’t seem to figure out how to get the core duty cycle part. All my temp triggers and bounding times are easy in native ST, of course.

Any way to get this done without webcore and, preferably, in the new app? Super bonus points if the execution is local.

If you want native and local you’re going to be doing it in a very convoluted chain of virtual switches. (one for your weather condition being true, one for yhe cycle running then chaining the actiontiles together in Smartlighting) You can only use Smartlighting if you want local control. It would be very fragile, resource intensive and probably not worth it.

I’d definitely do this one in WebCoRE

If I’m reading your need correctly, then maybe using a virtual switch as an 11 minute delay timer and trigger for the Automation might work.

Time Period with Time Day equal Sunrise plus 30 minutes to Sunset.
Temperature (whatever source) is equal or above 78
Outlet is Off
Virtual switch is Off
Turn On Outlet and Auto Turn Off in one minute.
Turn On Virtual switch and Auto Turn Off in eleven minutes

As for the Temperature, the new Weather feature isn’t working for me. So if it’s not working for you either, then install the SmartWeather Station Tile from template in the IDE as it works flawlessly in my Automations set to my zip code. As for running local, the weather requirement needs access to the internet to get the weather conditions so it can’t run local unless you use a multisensor or motion sensor for the temperature condition.


So the second (virtual) switch is the key to this, along with the nice “auto delayed off” features in the new app.

Is this actually fully local execution though? I thought virtual devices only exist in the cloud?

Thats why you can’t get local execution. The ONLY way to get local execution is using REAL, locally controlled devices, with SmartLighting as the Automation… This is WAY too complex for smartlighting or the onboard automation creator, therefore it can’t be local. Once you busted that requirement you might as well put it in WebCoRE - which could do the entire sequence in one piston.

1 Like

Gotcha. I’m ok flexing any of those details (figured I’d ask for the moon and give ground where I need to).

I’m playing with the native Automations way to do things now. So far I’ve got the basic activation but I’m leaving off the temp threshold. I’m also finding the virtual switch isn’t automatically going off as intended, but I’m not completely sure I’ve got this right (that’s why we test!)

the Vswitch does not turn off by itself, so you need to do that manually (in your automation)

Your automation is VERY complex. i usually dont even bother with anything but Webcore if there’s anything but the simplest conditional It’s just too hard to assemble in the new automation creator, and if I can’t make it local I don’t bother with SmartLighting.

Yeah, the virtual switch isn’t automatically turning off after the 2min.

Just to make sure I follow you:

  1. Your saying “this 2-bit AND logic is considered very complex” (I mean, it fits on a single page via iPhone soooooo, it literally looks quite simple, but I’m genuinely asking if maybe this is what ST considers complex)?
  2. Your saying the automatic-delay-off for a virtual switch (as shown in my automation) is not expected to work?

Im saying anything more than one condition is generally difficult for automations.

Im saying that you will have to makensure that you turn it off yourself in automations and with the status of the automation creator it SHOULD work the way you set it uo but i have exactly 0 faith that it will execute reliably. That capability youre using (both compound conditions and the timed shutoff) are very recent adds to the automation creator and in my experience it takes them 2-3 revs to get new functions stable

Yup. Gotcha.

To your point, it did not work as shown. I’ve switch to a very simple webcore piston and, of course, it’s working flawlessly on the first try and without any virtual device shenanigans!

1 Like

All of my virtual switches show their execution location as ‘local’ in the IDE, and the virtual switches I’ve created and use in my Automations will turn off depending on the delay I set. Not sure why you’re not experiencing the same.

Looking at your screenshot, the Roof Sprinkler devices shown look like they are two different devices. One for ‘Roof Sprinkler’, and another one for ‘Roof Sprinkler (Outside)’. What happens when you use the same device?

1 Like

I’m not sure why the devices show up slightly differently in the two sections of the automation. For the record the real device is named Roof Sprinkler and it is placed in the Room Outside. That device was activating and automatically shutting off as expected, also, the NOR logic was working properly (so I can deduce that the device was being correctly recognized by both sections of the automation configuration).

The Virtual Switch also exists in the room Outside but I can’t tell due to line-wrapping if it has the same odd double-label of the Room.

I may be mistaken, but my understanding was that the specific DTH “virtual switch“ is a virtual device which does run locally now. That was a change in the last year. (Updated to the correct DTH per the correction from @Automated_House below.)

Other virtual devices are not local.

@Automated_House might know.

In any case, check the I DE and you should be able to tell if they are marked for local execution.


Happy for that to be changed, but Smartlighting is still very cumbersome to create this particular automation and adding in the weather requirements id still do it in WebCoRE

1 Like

As to whether it’s too cumbersome just in smartlighting, that’s a matter of taste. It’s one primary automation plus a second power allowance automation for each virtual switch. To me that looks pretty straightforward, and I think it’s a clever use of the delay feature. But choice is good. :sunglasses:


DTH “simulated switch” doesn’t run local, but “virtual switch” does. Virtual switch is also stateless, so it will process a command even if its already in that state.


I’m not exactly what you fine nerds are discussing, but I noticed it involves a “sunset” trigger. I’m having trouble making new automations and lighting smart apps with new ST motion sensors and SmartThings wifi outlets on the new app (which I’ve always used). My existing automations with time and/or sunset triggers are working fine.