Thermostat tracker(release)

I created a simple tracker to track how long my Thermostat was in each operating state.


Code can be found here:

https://raw.githubusercontent.com/napalmcsr/Hubitat_Napalmcsr/master/Apps/ThermostatTracker/ThermostatTracker.src

dashboard tile is here:
https://raw.githubusercontent.com/napalmcsr/Hubitat_Napalmcsr/master/devices/ThermostatHistoryTileDisplay.src

Dashboard instructions:
Create a virtual device using the Thermostat History Tile display
link to that tile in the app under Display tile:

add a tile to your dashboard:


Selecting the tile, template:Attribute, and the attribute can be "Today,Yesterday, or X Days Ago"
1 device can display all the history tiles, just create more tiles and then link using the display Tile.

Updated to 1.0.1 to fix a rounding error. I couldn't deal with only having 23:59 minutes in a day...

Updated to 1.0.3 to fix a typo...

Updated to 2.0.0 adding Dashboard support

Updated to 2.0.1 adding Hubitat Package support and removing a bug.

5 Likes

Pretty cool. :+1:

Cool, I will try this out.

It doesn't look like you can add multiple thermostats, or am I doing something wrong?

nope, you need to do 1 App per thermostat. I didn't really consider multiple thermostats. I could parent-child it or you can install multiple instances. Since I only have 1 active thermostat, I wouldn't want it parent-child, but if I get enough complaints, it wouldn't be too hard to do.

It wouldn't let me import the code twice, but for the second t-stat I did a copy/paste, and renamed the app, and that worked fine. The lines I changed were 15 and 18, but that was just a wild guess on my part.

As long as this is a valid workaround, I don't see any reason to change it.

Last question: is there a way to put the results on the dashboard?

Thanks again!

oh, you should be able to install a user app, and after the first one, just install a second instantiation.

@napalmcsr I am getting an error since your last update.

I don't code, but I think it's just a typo in line 206. Should indiv be intdiv ?

Thank you for sharing this.

oops! Thanks for the catch. Updated to 1.0.3.

1 Like

2.0.0 release Added dashboard tile support

See instructions in initial post.

1 Like

Is this working for others?
For me the properties page for the tile device does have data, but the dashboard tile keeps saying to select an attribute (I have done so, eg, "Today").

Of course it works for me... But I created it... Can you show a screenshot of how it looks?

lol, ok, i guess it's my bad - it is now working, perhaps I just needed to refresh a couple times?

All good, sorry to have bugged you!

No problem, glad it is working

Today updates Everytime the thermostat changes state. The others get updated at midnight.

2 Likes

@napalmcsr I used to get a monthly email from Honeywell that showed the accumulated monthly heating and cooling times. I thought I could just edit out a bunch of your code to get something similar. I keep commenting bits out hoping to get what I want but every morning I have a fresh listing. I just have the barest understanding of groovy coding. Could you please give me a hint on what I need to remove. Thanks.

Line 106

schedule("0 0 0 * * ?", Timehandler)

if you change it to, (i think)

schedule("0 0 1 * * ?", Timehandler)

will reset once a month
So each day of data will become a month of data. I'm not a cron person, but once you make the change and go in and save the app you can check settings and it will have a scheduled event saying when the time handler will run

1 Like

As a long time Linux user, I should have recognized that. My forehead is getting really flat these days. Many thanks.

Updated to 2.0.1 to fix a typo and add HPM support