Rule Conditional

Hopefully you meant reboot (From the settings page) instead of power cycle. But, on the off chance that you did not, please use the software methods for shutting down and/or rebooting. It is much safer for your database.

Thank you, but yes, I have dealt with fixing pcs for a number of years after power failures when I did not have UPS protection.

BTW - Is there any way to connect a hub to a UPS and get a shutdown signal from the UPS?

Don't think the hub can sense the UPS unless it has some sort of network integration. Then you would have to come up with a driver.

I use the Ring Range Extenders to sense when the power is down and then issue a command to shut down the hub if it does not come on within an hour (Rule Machine can handle this)

Seems to require the ring base station

Amazon'sChoicefor [ring range extender]

$24.99

[FREE Returns ]

  • Expand the reach of your Ring Alarm Base Station to your Ring Alarm components
  • Easy installation with no tools required
  • Plugs into standard wall outlets
  • Requires the Ring Alarm Base Station and only boosts the Ring Alarm system network

Nope, I have it directly connected to the hub.

2 Likes

I have the gen 2 ring range extender included in the network. How do I communicate with it to determine whether I have a power failure? I assume it needs to be plugged directly into a UPS, otherwise if power is lost it will simply shut down. Am I wrong?

You are wrong. The Ring Range Extender v2 has an internal battery.

If you are willing to purchase another UPS, APC's have an integration when connected to either a Linux machine, e.g. raspberry pi, or a Windows PC. And by plugged in I mean in addition to the power outlets, there is also a USB port on some models for data, so you can plug the UPS into the USB port on your rpi or PC to get telemetry and send that to HE.

The Range Extender will show its power source - either “Mains” or “Battery”. You can use Rule Machine to extract this information as a “Custom Attribute” trigger to do with it as you wish.

1 Like

I can generate the code to test both the battery level and the 'mains', which I assume is whether the device has AC power or not.

I don't see a command to turn the Hub OFF. Also, if this occurs, how can I get the Hub to restart?

Here is one way to turn the hub off. Using Rule Machine, enter the following post command:

Send POST to: http://YourHubIP:8080/hub/shutdown

“YourHubIP” can be replaced either by your hub’s IP address or Hubitat.local. (I didn’t add that above as it would have shut down the hub of anyone clicking on it…)

There is no method to turn the hub back on within itself. However, if you have it connected to a wifi plug, it might be possible to turn off/on the plug via another system (Tuya, another Hubitat hub, etc.).

The shutdown works correctly, thank you.

The Ring Extender shows two states: 'battery: 100' and 'powerSource: mains'. The 'mains' appears to be a boolean that is true if the A/C power is on and false if it is off. That, at least, seems to be the conditions that my rule can use to shut the Hub down. I can select 'powerSource' for a tile in the dashboard but the display is always 'mains'. What is the trick to display either 'A/C On' or 'A/C Off' for the display. I have played with the CSS for the dashboard but have been unsuccessful trying the control the display for the 'mains' tile.

1 Like

There are likely better options, but one of them would be to use Rule Machine to populate a string Hub Variable with the information you want displayed.

You must be using the built in driver. There is another driver that shows more states and has more capabilities (discussed here: [RELEASE] Ring Alarm Range Extender Gen2 driver). It can be installed with Hubitat Package Manager

As to the "Power Source," I do not believe that is a a true boolean(i.e. True/False or 0/1). It has two text string options, "mains" or "battery." plugged in and on AC power, it reads "mains." With no external power, it reads "battery." Mine updates instantly.

States - Ring alarm range extender V2 HPM Driver

image

I use a rule in RM to detect house power. The trigger is if any of the range extender power sources change.
If any are on battery, then I just get an alert with the devices that are disconnect.

If they all return to mains, then I get the notification that power has been restored. (NOTE: In order for this to happen after a hub shut down, you actually have to boot the hub up once you have power to do so)

If ALL switch to battery, I get a notification that the entire house has lost power. I note the time on the alert and if it doesn't restore within an hour, then I shut the hub down myself.

I did not automate the shutdown, but that could be added to the section where ALL are on battery.

Rule - Monitor House Power

1 Like

I installed the alternate driver I believe? I removed the ringer then added it back. The 'Current States' now shows four states: battery, powerLevel, powerSource, and rangeTest.

The 'powerSource' changes from 'mains' to 'battery' when the power is removed and back to 'mains' when power is restored. I use this in a rule that sets a Hub Variable, A/C Power, to true or false. It seems to work. I have a tile on a dashboard that changes between true and false as the power to the Extender is added and removed.

Is this what I should expect?

BTW. I noticed that when I shut the Hub down, remove power then restore the power, the Hub starts up by itself. Is this not what I should expect? With this, when power is restored to the house, the Hub will recover with no physical intervention.

Yep, that is the expected behavior. However, if your hub is on a UPS, as it should be (to avoid corrupting the database, which can cause great disorder), the UPS will retain power after the hub shuts down cleanly, and the hub won’t restart. That’s why you need an auxiliary switch between your hub and the UPS.

1 Like

I plan to get an auxiliary switch. The Hub is in a 'wiring' closet and on an upper shelf. Generally when we get power failures the UPS also shuts down and comes back on when power is restored. The switch is a good idea under any circumstances. I just have to figure how to get one in the closet.

Thanks,

Milt

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.