App: Device Tracker, Multiple Device On/Off Times, On Counts, Notifier, Battery Levels, Switches, Contacts, Temperatures, Power, etc.. With variables access

Added ability to see the last time a device was turned On/Active vs Last reset time. For Temperature, Power, and voltage monitoring added the ability to put a separate Threshold for each device in table as well as decide if you want to track(consider On) Above or Below that number per device.

Ver 1.1.8

Im going to add this next.

2 Likes

You have a pull request in Github.

Latest additions, ver 1.2.2
-Max/Min display for Power, Temperature, and Voltage.
-Added Thermostat Heating/Cooling
-Moved variables to a different table
-Formatting changes
-Logging auto shuts off in an hour

Power example:

Variable Attach Table

1 Like

Small issue with the thermostat tracking for Nest. If tracking heating, the offHandler() will still get called when the thermostat goes from "cooling" to "idle", causing some issues with the tracking variables. Likewise, if tracking cooling, the offHandler() will get called when the thermostat goes from "heating" to "idle". The following changes to the thermostatHandler() solve this issue:

def thermostatHandler(evt) {  //// ver1.1.8
    state.DeVices[evt.device.id].state = evt.device.currentThermostatOperatingState
    if (state.DeVices[evt.device.id].checkBox4 && evt.device.currentThermostatOperatingState == "heating") {
        state.curTrack = "heat"
        onHandler(evt)
    }
    else if (state.DeVices[evt.device.id].checkBox4 && evt.device.currentThermostatOperatingState != "heating" && state.curTrack == "heat") {offHandler(evt)}
    else if (state.DeVices[evt.device.id].checkBox4 == false && evt.device.currentThermostatOperatingState == "cooling") {
        state.curTrack = "cool"
        onHandler(evt)
    }
    else if (state.DeVices[evt.device.id].checkBox4 == false && evt.device.currentThermostatOperatingState != "cooling" && state.curTrack =="cool") {offHandler(evt)}
    endif
} 

I have a Nest but its not attached to Hubitat so I wasn't able to test the Thermostat capability. I made the update.

1 Like

It took me a bit of fiddling but thanks for this. I have a hot water recirculation pump and I'm experimenting with various settings to figure out which will require the hot water heater to run the least often with acceptable hot water availability. I have a virtual switch that tracks the on/off cycle of the heater blower fan so now I can get a cumulative total of heater on time over a week. Change settings, compare and repeat. I've tried 24/7 on, schedules and motion sensor triggers. Even though it is intuitively wrong my guess is that 24/7 is the most efficient since the water cooling down in the supply and recirc pipes doesn't force the heater to run as long to bring it back up to temp when it runs.

Hi @kampto ,
Just tried a new install for my brother and got this error message when trying to add the first (or any other child apps):


Tried to delete and reimport the code and install but with no luck,
Any idea?

@amithalp , Try again, I just made a change.

Hi @kampto ,
That fixed the error I got but now I get a new error when chosing a device in the child app I am trying to create:

OK. I see a new version on github. Installed and this problem in not showing

1 Like

@amithalp Code line 58 is the troublesome part. It was intended to do a refresh when opening the app. I commented it out and re-uploaded on github. You can just do the same in your apps code and try again. Sorry for the trouble.

Thanks for testing! This change doesn't cause problem for existing app. but only for creating a new child app which I didnt test, my bad!

Life gotten busy and fell off the daily community visits. Missed this gem. This is a great addition to the modified light and usage table. Exactly what I was looking for. Thank you for the added features and maintenance/upgrades.

EDIT:
I do have a question about the data in the table being refreshed. Is there a way to trigger a refresh on the table after a rule ends or a switch turns off? I see I can set it to refresh the table more often then the default 10 minutes.

However I'd just like to refresh it once the power turns off on the checked off device or via RM rule. Is that possible?

@kampto, can you add this to HPM so that updates become trivial to install?

1 Like

The variables get refreshed/updated in the background when a device turns off or that refresh/update timer is met. But the app screen table is static and only refreshes when you load it or hit the refresh button. You want the app screen to refresh itself during a device state change? Not sure that is possible. But would be a nice feature.

I looked at the HPM developer instructions, im a bit confused by it and need to dig into it some more.

2 Likes

I don't care for the table to update. Just the device to refresh the duration when it turns off, but it that already happens then that's great.

Should I set a small delay after the device turns off before inserting the variable into a notification?

That might be best, maybe try 1 or 2sec delay.

1 Like

@csteele has good documentation for developers at HPM Documentation as well as tool to help you create the manifest file.

1 Like

@kampto Once you've created your initial repository and have it registered with HPM, you could use the HPM Manifest Generator (in HPM or at https://raw.githubusercontent.com/thebearmay/hubitat/main/apps/hpmManifestGen.groovy) to simplify the creation of the manifest contents and create an update for the repository.

2 Likes

Sweet. I just set this up to track runtime of my furnace fan for filter changes.

Looking forward to it in HPM for ease of updates!