Time the amount of time a switch is On

Hi Hubitators

Does anyone know if it's possible to create a switch that when turned on it times how long its on for.

I have a tube hifi and so I can know how long my tubes have before replacing I could keep a record of each time its turned on.... the crazy things we dream up to do with hubitat lol

Of course this would only really work if it kept a running tally of total time. I could then tell it to notify me when its reached say 2000 hours.

There's probably an overly complicated way of doing that within a rule using variables. However I'd be surprised if someone hasn't wrote a custom app for such a use.

Ideally you need an app where you can specify an existing switch, that totals the time in seconds between each on and off, accumulating it. It should perhaps perform the math to convert that raw value in seconds to hours, output it to a specified hub variable as a string, which would allow you to add it to a dashboard. It also needs a button within the app to reset it to zero when you change the tubes.

Calling all developers...Is anyone aware of an existing app that does similar?

I thought Bruce did something like this just lately... Let me see if I can find it....

1 Like

Have a look at the device time active tracker app.
I think this is what you are looking for.

This is what I was thinking of:

There also this, which I think came out of the same discussion:


The Device Active Tracker by @kampto looks to be ideal. I knew someone would've already created something.....

1 Like

Just what I was looking for! thank you Guys

1 Like