Using a UPs with a NUC

I have Home Assistant installed on a NUC. I don’t understand the naming, but I used the HA image and flashed that, so whatever that’s called.

I have the NUC plugged into a UPS that has a USB connection. Does anyone know how to get the NUC to shut down when the battery is almost dead? This is the only device in the UPS so it should stay running for quite a while, but I’d like to know if there is a method, integration, or add-on that I am missing. I did see a network UPS add-on, but this is just USB.

Home Assistant OS.

What make of UPS do you have?

APC BN650M1

I just bought it so I can buy a different one if need be.

I don’t use it but I think that after you have the sensors in home assistant it will be up to you to trigger an automation on the battery state of charge or time left and shut down home assistant in the actions.

Through that integration page, I found the following, for USB UPS devices.

The automation part seems easy, its the configuration.yaml part that scares me. This all seems like a great way to brick my HA instance. Perhaps I just let the UPS keep the NUC on for 3-4hrs and hope the power comes back on.

The yaml for the apcupsd is really straightforward. There’s not much you can mess up. Add this to your configuration.yaml:

sensor:
  - platform: apcupsd
    resources:
      - status
      - linev
      - bcharge
apcupsd:

This will create 3 sensors for current UPS status (online, on-battery, etc), current line voltage and battery charge. There are many more options you can add.

I can’t really comment on that unofficial addon as I’m not using HASS OS myself (I have apcupsd running natively). But I suppose you have to use that to get the APCUPS daemon running on HASS OS.

So, how does it know where to look for the UPS? For the zwave and zigbee sticks, you have to tell HA what USB port they are on.

In any case, I’ll try as soon as I get my USB lid for the NUC. I need more ports on the back, my two are used by Conbee II and Aeotec Zstick.

The USB port is autodetected by default. It’s not HA managing this, but the apcupsd daemon. HA simply connects to the daemon to retrieve the data you ask it to.

I created the Network UPS Tools (NUT) add-on specifically for USB-connected UPS devices. The add-on simply runs a NUT server that the Network UPS Tools (NUT) integration can connect to.

The reason I chose NUT over any other integration is because of its vast support for UPS devices.

2 Likes

I found NUT addon (at least on x86 platform) to be working great and there are lots of obscure UPS brands in the wild.

ARM addon instead failed to identify several units, although it worked fine with both separate NUT server install on Raspbian and x86 HA addon.