Lights Usage Table

Really nice job Bruce... this is such a cool feature. I updated my HousePanel to also keep track of times things are on, much like what you've done here. Choice is good. Here's a screen shot of my updated panel showing the duration - see Bedroom Ceiling

3 Likes

Thank you or this, Bruce! May I request an addition? It would be nice to see a colomn next to the reset column with a timestamp of the last reset. That way one could see the total time on since...

This little table diddy that Bruce has cooked up makes it clear he's the Walter White for we smart home junkies.

2 Likes

This has been added to the Github source.

2 Likes

Coolness continues...

Just wondering, do you plan on postting your version in Developers>Code Share at some point? I expect users/developers would be interested.

1 Like

A post was merged into an existing topic: Is there a simple way to track how long something is turned on in a day?"

Added a Boolean Hub Variable option to externally reset the timers. This way a simple RM rule can do that on a schedule. When the Boolean variable is set to true, that resets the timers. The app sets it back to false so it's ready for the next time.

3 Likes

I will, just got home from work, need to chill a bit then think about it. I want to add some other capabilities besides just switches.

1 Like

Using Light Usage Table - selecting to write values to my log - is the app stripping out CR/LF?
If so, how do I resolve that?

Log looks like this:

And also, the variables created for the app are strings. How can I add strings to keep a running total for a device?

PS - the Boolean reset is just what I needed - thanks for that.

Parse it.

Lights Usage Table not working now. Platform 2.3.3.128, C-7, Chrome, Win10

Launches for me normally on .128. C7, Chrome latest, Win11.

2 Likes

Neat.

If this could be adjusted to add a few more trackers, it might actually tempt me to make use of this instead of webcore for something.

I.e. Can total time on be upped to include "total time on today.... This week...... This calendar month.... This year..."

Interesting.

1 Like

Yes, if using the tracker posted above. Just don't reset or use Auto reset and it will continuously accumulate Active time for the selected capability.

2 Likes

That's just a total total.

I'm curious to the the breakdown for Jan, Feb, week 1...week 43....

1 Like

@bravenel I am trying to replicate the functionality you have within Rule Machine to "Create New Action" where clicking the green + takes you to another page within the app:
image

I know that the green + launches appButtonHandler but my question is how does appButtonHandler then redirect you to /doActPage? Within my version of appButtonHandler, I have tried calling the function that defines my dynamic page as well as defining a URL via string and returning it but its not working.

Or this for href:

String hrefLink(String pageName, String linkText, Map params = null) {
	Integer pageNum = 55  // arbitrary number
	"<input type='hidden' name='params_for_action_href_name|${pageName}|${pageNum}'><button type='button' name='_action_href_name|${pageName}|${pageNum}' style='cursor:pointer;color:#1A77C9;background-color: unset;border: none;'>${linkText}</button>"
}
1 Like

Thanks Bruce. With your example realized it was a simple addition of href around the returned text from the call to buttonLink.
image

2 Likes