Hubitat Hub Controller

I tried to load the Hubitat Hub Controller from GitHub - dcmeglio/hubitat-hubcontroller with a "New driver" command from Drivers code. It is not found so I did a copy/paste from hubitat-hubcontroller/drivers/Hub_Controller.groovy. The code was not rejected and it shows on The Drivers Code section.

I then attempted to create a virtual driver but the "actuator" type does not show up.

I want to use the code to shut the hub down on a power failure.
The hub -s a C-8 with version 2.3.7.140.

That developer left HE a while back so his projects are not all still being maintained.

This driver has a shutdown option and is functional:

5 Likes

It's not "actuator" that you look for when creating a virtual device. In the Type list, scroll to the very bottom and then scroll up to find "Hubitat Hub Controller"

I agree that the Hub Information Driver v3 is a better choice, since it's actively maintained. However, for SMALL, it's hard to beat Hubitat Hub Controller :smiley:

5 Likes

Good call, I was not understanding what the problem was exactly. I think you are right though, they are having a hard time finding it in the Driver/Type list.

3 Likes

Thank you - I loaded the new driver and created a virtual device called 'HubShutdown'. The device contains, among others, the command 'shutdown'. I have a test app that will execute the shutdown command. I create the action type 'Set Variable, Mode or File, Run Custom Action' then select 'Run Custom Action'. I then select the capability as 'Actuator'. I then must 'Select Actuators to act on'. I want the command to act on the Hub to shut it down, but the selection list is just my lighting devices.

How do I get the command to act on the Hub?

Thanks.

What app? Or do you mean a RM rule? I'm not 100% sure what you are referring to here.

Assuming it is an RM rule, the "actuator" to select is the virtual device you made.

Here is an example of a rule that reboots on low memory. My virtual hub info device is "HubInfo".

Sorry, I have a habit of calling RM rules apps. To long programming I suppose.

Your note is exactly what I needed. I am using the Hub information Driver v3. My hub has security set so I hacked the code to explicitly set the username and password. I suspect there are better ways to accomplish this but they aren't obvious in the driver.

1 Like

Driver has the ability to store and use the user name ad password down in preferences, no need to hack it.

2 Likes

How about something like this?


or

4 Likes

Thanks - I did finally find the fields for username and password. I had looked for them earlier when I found the switches for 'Hub Security Enabled' and 'Allow Hub to be shutdown or rebooted' but missed the others. The code now works correctly for my application.

I have the HUB on a UPS and a Ring Alarm Range Extender. The Ring goes into battery mode when the power goes off and starts a timer in a RM rule. The UPS runs for ca. 50 minutes with its current load and the HUB is shutdown after ca. 30 minutes to be safe.

Again, thanks for all of the coaching.

-Milt

I tried the POST directly to the web address but my hub has security set and it requires a name/password.

I was able to use the web site, as a test, by using the program curl and passing the username and password.

1 Like

I like the simple way this driver allows me to shutdown the hub, reboot the hub or restart the software. And understand that the developer is no longer active with Hubitat.
Is there a simple way to install a software update using a driver? I want to expand my rule to install an update whenever I set a flag. Then install the update instead of doing the restart.