[RELEASE] Hub Information Driver v3

I suspect it's just a timer, but there might be an endpoint that reports the database running or shutting down.

After the UI stops responding it most certainly is a timer because the LED will go red about 30-45 seconds before the safe message appears. Could use something like http:\\<hubIP>/ui2/images/hub.png to test for the UI and then run a 45 second timer to give you a safety cushion.

3 Likes

How to I use this app/driver to display the Sunrise and Sunset in a dashboard?

It will depend on which dashboard you’re using. On HD+ I just add tile(s) for the Hub Info device, then edit the tile and pick the attribute(s) I want to display on each using 'Manage Display Items' where all Custom Attributes are displayed.

1 Like

Do you know how to on the old dashboard?

v3.1.10 Adds the capability to display the output inside the Easy Dashboard.

To make this work you'll need to set the Always use Output file for HTML Attribute to on, and give the driver a file name to store the HTML in. Then inside the Easy Dashboard change the Tile Type for the device to URL.

Edit: V3.1.11 Fixes the degree symbol issue when reading back out from the File Manager.

5 Likes

Here's a "lazy me" ask if possible.
I reboot way too much, especially with the beta testing and WebCore changes.
I have a System Startup piston that does a lot but I've segmented it into a sister piston called Reboot.
Hub Info is indispensible here as I get the command Reboot. :slight_smile:
Is there a way to add Local Backup as a command?
That way I get a fresh backup automatically everytime I'm testing.
Sadly I didn't look before typing this to see is someone has made an app or found the endpoint to do this.
Endpoints don't return at the completion though so my code could continue safely?

My Linux days were 30 years ago but I found this?

Download latest Hubitat backup using API

Raw

hubitat-backup.sh

#!/bin/bash

Your hubitat IP

HUBITAT=1.2.3.4

Backup output path parameter. Default: "." current path where you execute the script.

BACKUP_PATH="${1:-.}"

Get the name of the latest backup file

REMOTE_BACKUP=curl -s "http://$HUBITAT:8081/api/backups" jq -r '.backups[0].name'

Download backup

curl -s "http://:8081$HUBITAT/api/downloadBackup/$REMOTE_BACKUP" -o $BACKUP_PATH/backup.lzf

I tried to integrate a backup command, but couldn’t make it work correctly. I did recently add a url option for shutdowns that I could copy and make available for reboots if it would help you fire off a backup request from another source (I would also need to add a delay before rebooting to allow the backup to finish).

1 Like

No worries. Just a chance you might have said, "Oh, that's easy" :slight_smile:
Your supplied commands (+Ping) are already great tools!

1 Like

@thebearmay, I updated my hubs to 2.4.0.119 today and noticed this on the preferences display page:

I suppose this is just cosmetic, but I thought I would pass it along.

Looks like you’re on a Beta release of the firmware - waiting to see if they keep the code the way it is or if I need to make an adjustment.

Also pushed a new version of the driver this morning to fix a typo in the minimum version check.

2 Likes

Here's a first world problem request. :slight_smile:
Is there an endpoint you could add for Update?
When I reboot or shutdown I use the Hub Info Command and set my Mode to Reboot or Booting or Shutdown.
That way the screens all show what the last state was even if they aren't working.
I'd like to set the mode to Updating as well. Mostly a beta (tester) problem I know. :wink:

Its a device just do a refresh from the rule

Bit behind the times.
I sent that this morning while restoring the hub a few times to trace an issue.
Just went into Hub Info and see there is a command for Update Check, duh.
So I can check for the Update status but can I apply the update from a piston/rule somehow?
That's what I was looking for was a way to start the update without going to Admin Settings.

Designed to update multiple hubs, but can be used for just the one it’s on.

1 Like

Yet another Xmas present! :hugs:

1 Like

:santa:

3 Likes

I am trying to display the CPU load in actual percentage on the dashboard. Is it possible to display '0.15' as '15'? Maybe there could be an option in the device driver how the value is displayed?

CPU Load is a 0 -> 1 value (0 -> 4 given that the hub has 4 cores), if you're looking for a CPU % use cpuPct which is calculated as CPU Load/4.0*100.0

1 Like

Yes, I realize, but I am just trying to display the number as percentage (out of 100).
As far as I am aware, this is not possible with CSS.