Edge device for tracking time duration or count

This driver creates a device that can be used to (1) track the time (seconds, minutes, hours, days, weeks) that a switch is ON, and (2) implement a simple counter based on button presses (can increment or decrement).

This may be of help to those who are trying to move webcore pistons to standard SmartThings automations.

For further information on installation and use, see my README file.


My thanks to @mooch91 for the original request for this function, and to @Sakari and @blkwll for also testing and providing feedback.

Nice, thanks @TAustin . Do you know of an edge device that has a timer function that turns on every x minutes and then turns off and then repeats? I’m looking for something to duplicate having a device cycle on for 10 minutes, then stay off for 50, etc etc.

Nifty driver!

Couldn’t you do that with an edge driver with switch capability and a couple routines? I think all of those conditions run local on rules api now.

@johnconstantelo Yes @TAustin has virtual switch that does that. It has option to go to previous state after set time. In your case 600 seconds


Just add routine to turn it on after 10 minutes
You need only one routine.
This way is local

I always test with smaller time period, like 6 seconds, and then adjust to needed time

@Automated_House if you use delay in If condition it’s not local yet

Happy to help, as always. And more I test more I learn.:blush:

This is awesome, thanks!

Hi @TAustin, I would like to have the ability to set a countdown option, “When turned on, turn off after X seconds/min/etc” but I want to set this value in automation as a dynamic value.

For example, I want to set the countdown value based on an expression I’m calculating in Sharptools, and for the switch to be “on” for that set time value.

This could be potentially added to Virtual Calendar by @Mariano_Colmenarejo

@TAustin

Your timer driver is terrific! Works very well. My use case is to monitor the sump pump in my basement. I use leak sensors but the timer lets me see the past cycle time and determine if there could be a problem before I flood. I use a power monitor to know when my pump runs and then reset the timer. I capture the previous time using routines to compare to the current. If the cycle time changes too much I send an alert. If the ability to save the previous timer value before a reset was there my approach would be seamless and need only your driver to manage everything! I could simple compare the current value to the saved previous value in a routine. Ex) If previous<10 and current=30 ALERT. Not sure if a previous value is much use to others but would be great for me!!!