Suggestion: New option for switches "Cycle"


(Steve Ledridge) #1

“Off” and “On” are great for a switch but i can see two cases that we would benefit from an option to “cycle”. It would also be important that this was handled by the hub so that any connectivity issues between the off and the on wold not prevent the device from being turned on. It would also be great if the function had an optional parameter of delay so that some things that needed a longer off time could get that.

1st: If the device is your router, cable modem, switch, or any other part of getting to the internet, you cant tell it to turn back on after you turn it off.

2nd: Many apps have the ability to interact with switches to turn them on or off but not both, this would give a single trigger point to cycle external things.

I have a Web Power Switch made by DLI which has the ability to cycle outlets. I created my own SmartThings device for this that gives me the ability when I am drilled into a specific switch, but since it is not a standard function, no other apps can use it.

(Steve Ledridge) #2

Here are links to my existing device code. It can use some tweaks, any suggestions are welcome.

Main Device:

Child Devices:

SmartApp to set it all up:

Remote reboot of router
DEPRECIATED. Samsung WiFi Soundbar Device Handler - new development

Forgive me, I’m dependent on text to speech software and can’t read your code, but how is this any different from a momentary switch?

We already have several device types that are momentary, that is switches that turn on and then immediately turn themselves off again.

We have the Z wave momentary device type which is intended for relays with a slight delay. And we have the momentary button tile device type which is a virtual button like a doorbell button where it’s always off except for the moment when you push it on.

Are you suggesting a new piece of hardware? Or a device type to interface with momentary switch hardware? I’m just a little confused.

(John Lord) #4

I am not positive, but it looks like he wants a toggle function similar to what sharptools gives


If it’s just a matter of rebooting a router, I have mine plugged into a regular smartthings wall wart (smart plug). Works fine for that. But again, maybe I’ve just missed something.

(Steve Ledridge) #6

after you turn it off… how do you turn it back on when it disconnects the network?


I have multiple networks. That router is not on the home automation network that the plug is on.

If everything is on one network then you have to get the router up first with a reset.

Many routers have this function built in, it’s just that it’s often in the undocumented features, or the admin only features. For example, Linksys routers have this capability, although a lot of people don’t know it:

But if the router doesn’t have this capability, then, yes, you may have to have some kind of device with a timer to restart the router so you can then talk to everything else.

Although with the V two local capability, you could probably run the wall wart locally from the smartthings hub to reboot the Internet router. Interesting thought.

(Steve Ledridge) #8

well, as I stated in the beginning, I have a web power switch that lets me cycle outlets. and since I have written an ST device driver for it, I can do everything from ST. I just would like to see the option to cycle switches be a standard. that way it would be a triggered option from other apps.

(Bob Sanford) #9

@steve_ledridge What I did was to create a Arduino device that controls outlets on a power strip. The linux side of the Arduino Yun monitors the internet connection by simple pings via a script. If it fails, it resets the cable modem, but only three times. Each time it waits for internet comms to be established, if not it will reset again, but only three attempts. After the third reset, it waits indefinitely. Not good to power cycle something continuously.

I have my router, hub, cable modem and cabinet fan controllable right now. It doesn’t depend on the network during reset as the Yun handles the off/on once initiated.

I can also control the individual plugs via ST or a simple web interface. The Yun also reports cabinet temp and attic temp and I poll that with ST as well.

Be glad to share if anyone is interested!

(Steve Ledridge) #10

I had not thought of a momentary switch, I had only considered that for relays as with a garage door opener. It would be best if this action was internal to the switch but not necessary if it can be handled by the hub.

I could see something like a momentary switch working but I would not want it to be dedicated as a standard switch or a momentary switch. I would want something like a hybrid where you have 3 buttons. On, Off, and Cycle. my only goal is to encapsulate off and on within one action, like a momentary switch, without loosing the ability to use off and on.

(NotoiousBDG) #11

@steve_ledridge, thanks so much for sharing this. I just installed it and I found a few issues and have a few suggestions.


  • The smartapp created duplicate Outlet 4 and 2 Outlet 5 child devices. The second time I tried, i got duplicate Outlet 4 devices.
  • Outlet 6 was created with a label of “Outlet6” instead of “Outlet 6”.
  • The device type for the Web Power Switch says refresh on the cycle tiles instead of cycle.


  • Add a refresh tile to the vTile_DLI
  • Make the child vTile_DLI device names match the outlet names configured in the Web Power Switch device
  • Make the smartapp create the Web Power Switch device so it doesn’t have to be created manually in the IDE