Lights Usage Table

I'm not sure what you mean is the issue. The "total on time" should update every time the refresh button is pressed.

OOOOHHHHH....weird...it didn't come up in limited testing, but, yeah, I see now that the time seems to exponentially update.

1 Like

Alright...think I got it squared away. I edited the code above, so just pull it from there.

2 Likes

Excellent work, now it is working as expected.
Thank you for the very fast response and fix!

1 Like

@FriedCheese2006,
Thanks for renaming the text to last on time & last off time!

Lights usage table

1 Like

Nicely done

1 Like

Hi all,
I am slightly confused as to why the total on time for my bathroom light1 and light 2, and hallway light 1 and light 2 show different count and on time although they are programmed to activate together in room lighting?

lights usage table

Room Lighting


My first thought is that it's not possible to say. Maybe the lights aren't updating their status. Maybe, somehow, they were turned on outside of the Room Lighting instance. Maybe something else. You'd have to have other way to view their individually reported statuses over the time drift periods to figure out what happened.

Or the code is busted...who knows :grin:

1 Like

Thanks for your reply.
I normally view the lights usage table to get an overview of the lights usage, and it is a good indicator.
However, I've not reported it before but this discrepancy is now bugging me and I will need to dig further.
I would accept few seconds here and there and even a few minutes difference, but see below there is a 15 mins discrepancy for hallway lights being activated by room light only this morning from 6.30am-8am.

Summary

So, I would go to the events list for those two lights, get the reported on and off times, and manually calculate. If it matches the table, the it's an issue with the lights reporting. If they're different, then it'll be worth a look at the app code.

1 Like

Is there a way I could disable the reporting of events to my log? Perhaps strip out some section of the code or comment out a block or two?

Which one are you using?

both

Just comment out or delete any "log.info" line.

Comment is just adding"//" to the beginning of the line.

1 Like

thanks - i'll give it a try

1 Like

There are no lines with "log.info" in them? Any other ideas?

Are you sure?

The code I pasted above has several "log.info" lines.
image

1 Like

My apologies. I use both "Light Usage Table" and "Usage and Count" and it is Usage & Count that is creating the log entries. Sorry for wasting your time. I now have my head on straight.

Not a worry.

@kewashi or @bravenel, any way we can reset an individual device's duration time instead of the entire table? I'd like to keep the rest of the devices in the table's information within the table.

You can do that here on the table manually or using a remote variable. Reset individual device times and on counts.

1 Like