Recycle timer / repeat on off command / cycle timer?

So i am in need of a way to turn a device on for xx seconds then off for xx seconds and repeat this over and over again till you tell it to stop. typically the minimum run and off time would be 30/30 also need to make it pretty for my users to change. I’m happy to pay someone to develop this. Also is it possible for this command to run local on gen 2 smart things so that if the internet goes down it will still function?

This is quite easy to do but you cannot make it run local currently because of restrictions in SmartThings. Only certain devices are eligible to run locally and only the official smart lighting automations. There are two different ways to do your timer, but one requires virtual devices ( which are not eligible to run locally) and the other requires custom code, and at the present time no custom code is allowed to run virtually. With that out-of-the-way, there are two options, other then writing a unique smart app, which you really don’t need and still won’t run locally.

  1. you can do this by daisy-chaining virtual switches so that when switch turns on when another turns off and some of them turn themselves on for a specific period of time and then turn themselves off again. With those two concepts you can set up a daisy chain of switches that will give you exactly what you want.

And another example

I suppose for this when you could pretty it up with a nicer input screen to collect the variables for any specific run. And you could pay someone to do that. If you want to go that direction, post in the developers section of the forum:

  1. The second way, which honestly is probably simpler although it’s going to look more complicated to begin with, is to use a community created rules engine called core. Very powerful, very sophisticated, can handle delays and iterations.

If you haven’t use custom code before first read the FAQ. But it’s pretty straightforward, you’re essentially just copying somebody else’s code and pasting it into your own account.

If after reading the FAQ that sounds like something you’d be comfortable with, you’ll find all the information you need about core in the following thread and people there will be happy to help you. :sunglasses:

For your particular situation I’d recommend using core. It’s going to seem a little more complicated conceptually to begin with, but you’ll have a lot more options.

Reliability requirements

Oh, and all of that said, assuming this is for a Z wave or zigbee device, it may not be possible to guarantee that it will run 30 seconds each time. Some people have been successful with those kinds of cycles, but usually one minute is considered the minimum reliable period. So it depends in part on what kind of device this is.

Smartthings itself, and zwave in general, should never be used for anything which could impact health or safety. In fact there’s usually a black box warning on the user guide for a zwave device. Smartthings isn’t reliable enough and Zwave does not guarantee sequential operation. So for a pool filter pump, OK. For life-support machinery, absolutely not. In between, you have to make a judgment call, but I mention that because when you’re talking about A 30/30 second schedule, you’re often talking about something which requires more reliability and precision than SmartThings can offer.

1 Like

thank you so much! so i could probably skate by for my house but there are going to be hundreds of people eventually needing the same thing so neither of these will be pretty or seamless for the user right? the only way to do that is to create and “publish” a smart app right? everything i do needs to be easy and intuitive for the others and i’ve got a couple of things needing to be created. are you for hire and what’s just a simple one like this run?

also reliability isn’t crucial at all but if smart things is going down a lot if there was a widget that could be added for say under 50$ that stores the code locally that’s probably feasible didn’t i read about something that acts like that and stores functions locally? If not is there any plans for that? seems that it makes more sense for smart things to store these functions locally, and call out periodically to the web servers with a copy command or probably even easier the reverse, if you’ve made any changes a simple save button in the cloud, could then push it locally so not even a need to call out constantly. Heck if your on the lan it would just grab a command from local, if your not then it would route through their servers. but man that would dramatically reduce their bandwidth on those poor servers as more and more users as added. anyone know if there are plans for that for the future?

SmartThings is a cloudbased system. You can’t store the code locally. Your account library is in the clouds. There are a few things that can run locally with the V2 version of the hub, basically the official “smart lighting” feature and a little bit of SHM.

What’s the specific use case being solved here?

Also, I myself can’t do any coding these days as I am quadriparetic and rely on text to speech (and trust me, you don’t want to work with groovy in a voice recognition system).

But you can find developers for hire by putting a post in the developer section of the forums.

@tgauchat might know of someone.


I have a GE(Jasco) 26931 motion Sensor switch. I need to maintain all of its functionality but also add the ability to switch on/off throughout the day. This topic has been quiet for a few years but I am hoping someone can reply with a solution.


If you’re asking the same question as the one this thread is about, It’s still the same answer as above. it’s easy to do by daisychaining virtual switches, but it may not run locally.

See the following discussion from last week.

Need help with automation every hour of the day

Also, you are replying To a thread which is more than three years old. :scream: A lot has changed in that time, although in this case unfortunately nothing that will help with your question. But please do not respond to threads which have not had any activity for more than a year without first searching the forums to see if there is a current active thread on the same topic. Otherwise other community members end up having to read through dozens of ancient and out of date posts and it just confuses everybody. Thank you.

Finally, I’m not even sure your question applies to the topic in this particular thread, I’m a little confused about what you’re asking for. It might be better if you just start a new thread with more details in the following section of the forum. This thread, and the one I just linked to, are about repeating cycles at a fixed time interval for a single device. I’m not sure that’s what you’re asking for.

1 Like