[Release] Battery Monitor 2.0

I like the idea.

Since the device name is already clickable, maybe an optional “Battery Management” page/view within the app itself would make sense for local app-managed items such as:

  • battery type
  • replacement dates
  • custom thresholds
  • notes/history

I may be misunderstanding part of the request, but I would probably avoid direct device setting/configuration changes from within the app itself, since those are typically driver/device-specific within Hubitat.

That would keep device configuration in Hubitat, while making battery management workflows much easier from within the app.

1 Like

Battery Monitor 2.0 — v2.4.23 BETA

Calling for beta testers for a new feature before it moves to production.

:warning: This must be installed as a separate app instance — do NOT update your existing Battery Monitor. Install it fresh using the raw code link below so your production install is untouched.

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

What's new — Device Battery Management

Battery Catalog, Manual Battery Replacement, and Reset Drain History have been consolidated into a single :battery: Device Battery Management page, accessible directly from the main Reports menu. Select a device from the dropdown and all sections load for that device:

  • Assign or change battery type and count
  • Log a manual replacement (resets drain history and logs the entry)
  • Reset drain history without logging a replacement
  • View that device's full replacement history

What was removed

  • Battery Catalog
  • Manual Battery Replacement
  • Reset Drain History page

All three are now handled from Device Battery Management.

What hasn't changed

Everything else is identical to v2.4.22 — scanning, health scoring, notifications, trends, and replacement history all work exactly as before.

What I'm looking for feedback on

  • Does consolidating these three pages into one feel better or worse than having them separate?
  • Is the dropdown device selector an acceptable way to pick a device, or is it too many taps?
  • Does anything feel missing from the workflow?
  • Any unexpected behavior — especially around battery type saving or replacement logging.
1 Like

I'm liking what I'm seeing so far.

Couple of things that I think need to be adjusted:

After going into Device Battery Management and setting a device's battery type, when you go back in, that same device is selected. That should be cleared out, in my opinion, each time you enter that section of the app.

Also, unless I am missing something, you need to hit the Done button and then go back to keep setting battery types. Seems a bit inconvenient when you have many devices. There should be a way to go through and set each device's battery type and hit save to move on to the next device, rather than hitting Done and having to go back. Hope that makes sense,

1 Like

Battery Monitor 2.0 — v2.4.23 BETA 2

Updates based on BETA 1 feedback. Same install instructions apply — install as a separate app instance, do NOT update your production install.

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

Changes from BETA 1

  • Device Actions moved to the top — log replacements, reset drain, and view history are the higher-frequency tasks so they land first when you open the page
  • Battery Types moved to the bottom as a collapsible section — tap to expand, set all devices at once, tap Done once to save. A summary line above the section explains what it's for before you expand it
  • Battery type and level shown in blue next to each device name in the Battery Types list for quick reference
  • Devices with no battery level reported now show — instead of blank
  • Fixed: selecting a device for an action no longer cleared immediately. The confirm toggle now stays stable long enough for the action to complete and the result to display. Select Clear device.
  • Device selector resets after a successful replacement or reset so the page is ready for the next action
  • Device selector no longer pre-selects the last used device when re-entering the page

How the page works now

Open :battery: Device Battery Management from the main Reports menu.

At the top, select a device from the dropdown to log a manual replacement, reset drain history, or view that device's replacement history.

At the bottom, tap :battery: Battery Types to expand the full device list. Assign battery type and quantity for as many devices as you want, then tap Done once to save everything.

What I'm still looking for feedback on

  • Does the two-section layout (actions top, battery types bottom) feel natural?
  • Any remaining issues with the confirm toggles or device selection?
  • Anything still missing from the workflow?

Battery Monitor 2.0 — v2.4.23 BETA 3
Same install instructions apply — install as a separate app instance, do NOT update your production install.

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

Changes from BETA 2

  • Fixed Battery Catalog Render issue when no device was selected.

How the page works

Open :battery: Device Battery Management from the main Reports menu.

At the top, select a device from the dropdown to log a manual replacement, reset drain history, or view that device's replacement history.

At the bottom, tap :battery: Battery Types to expand the full device list. Assign battery type and quantity for as many devices as you want, then tap Done once to save everything.

What I'm still looking for feedback on

  • Does the two-section layout (actions top, battery types bottom) feel natural?
  • Any remaining issues with the confirm toggles or device selection?
  • Anything still missing from the workflow?

Getting there.

The Device Battery Management section still opens to the last device selected.

Why not have it open to "No selection"?
image

This is a bit awkward and unnecessary, if the selection list were to default to "No selection".
image

Lastly, currently, when you toggle "Clear device selection" the last device still shows here after the selection has been cleared:
image

This all would be unnecessary if the device list simply defaulted to "No selection".

Issue is with how the page renders and HE limitations. I will circle back to the "no selection" because i did not think of that.

Refresh you app code to BETA 3. Report back

1 Like

Missing the entire Battery Type section in Beta 3.

Also, the Battery Replacement History section should no longer be needed here:
image

1 Like

got it- i will come back to this in a few hours.... :frowning:

Fix one thing, break 3 others.......

2 Likes

Battery Monitor 2.0 — v2.4.23 BETA 4

Updates based on BETA 3 feedback. Same install instructions — install as a separate app instance, do not update your production install.

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

What changed from BETA 3

  • Battery Replacement History restored to the main Reports menu — the per-device history in Device Actions and the full history page serve different purposes
  • Device Battery Management restructured into two distinct sections:
    • :gear: Device Actions — tap Open Device Actions, select a device from the dropdown to change battery type, log a replacement, reset drain history, or view that device's replacement history
    • :battery: Battery Types — collapsed by default, tap to expand and set battery type and count for all devices at once, tap Done once to save
  • Removed the :battery: icon from the Battery Summary table — Hubitat strips URL parameters from raw HTML links so it could not reliably pass the device to the management page
  • Info page updated to reflect the new Device Battery Management layout

Known limitation

The device dropdown in Device Actions remembers the last selected device — this is a Hubitat framework limitation that cannot be worked around in app code. A note is shown on the page reminding you to change the dropdown when switching devices.

What I'm looking for feedback on

  • Does the two-section layout (Device Actions + Battery Types) feel clear and usable?
  • Any issues with the dropdown, confirms, or replacement logging?

Default to "No Selection"
Hubitat persists input settings so whatever was last selected will always come back. There's no way to default to blank on page entry without clearing it in code, and every time we clear it in code it fires on re-renders too and breaks mid-session actions.

1 Like

It's all looking good to me.

One note that I believe I mentioned above, but I'm not sure if it can be done or not. After toggling "Clear device selection" this should likely be cleared as well:

image

Clear Device Selection in BETA 3:
This is a known Hubitat framework limitation I ran into during development. App settings persist across re-renders, so clearing the device selection and having the header disappear in the same render cycle isn't possible within the framework. The header will clear on the next page entry after the toggled fired.

BETA 4
I removed the clear toggle in BETA 4 and replaced it with a note explaining that the last selected device is remembered — change the dropdown to switch devices. It's not perfect but it's the most reliable behavior I can get within Hubitat's constraints.

I tried about 15 variations and this one was the cleanest solution.

If anyone has an idea to make this work, I'm all ears.

1 Like

I forgot to update the code in the link....... :frowning: swap for BETA 4

1 Like

Thoughts on removing the progress bars for a smoother and more compact summary view...... Once established, it disappears anyway.

1 Like

Beautiful!!!!

And, yes, remove the progress bars,

Great work on this!!

Battery Monitor 2.0 — v2.4.23 BETA 5

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

What changed from BETA 4

  • Pending health display in Battery Summary compacted from a three-line progress bar block to a single inline line — e.g. :hourglass_flowing_sand: 10/5 samples · 0/5 days. Same information, significantly less row height. All rows in the summary table are now consistent height regardless of health status.

No other changes.

1 Like

Looks good!

Battery Monitor 2.0 — v2.4.23 BETA 6

Two bug fixes from BETA 5.

Raw code: https://raw.githubusercontent.com/jdthomas24/Hubitat-Apps-Drivers/refs/heads/main/Tests%20-%20Groovy%20RAW/Battery%20Monitor%202.0%20BETA%20Tests

What changed from BETA 5

  • Fixed: device name now stored in app settings alongside its ID (e.g. deviceName_221 = Front Door Lock). Makes troubleshooting state data much easier. You can now match any device ID to its name directly from the settings dump.

  • Fixed: firstSeenDate migration now reliably persists on app update. Previously the migration ran correctly but Hubitat was not always writing individual state changes made inside a loop. The fix rebuilds the full history map outside the loop and writes it in one atomic operation which is the same pattern used reliably elsewhere in the app. This resolves the 0/5 days issue seen on write-over BETA installs where devices had historical data but were showing as brand new.

No other changes.
Still Looking for more feedback before I update production app

1 Like

I may be misunderstanding part of the request, but I would probably avoid direct device setting/configuration changes from within the app itself, since those are typically driver/device-specific within Hubitat.

Oh, that's not what I had in mind. The confusion is probably from where I was describing that the default action when clicking on a device name is to go to the device settings page. Since that's already accessible from the Devices menu, I was envisioning that clicking in the device name within Battery Monitor would got to battery management for the specific device.

BETA 6 addresses some of it but in a different way. Device set up, via app, was problematic.