Any UPS / battery backup solutions supported by Home Assistant?

They don’t recommend it: https://ecoflowtechhelp.zendesk.com/hc/en-us/articles/4416107948183--UPS-EPS-

Yep, it’s true, but it does work for most desktop computers as they have enough capacitance in their supplies.

Technically you’re supposed to get a line-interactive or fully online UPS for those devices. Guess what, almost nobody that doesn’t run a datacenter does that, because the cost can be that much more than just the entry-level switching UPS which also wouldn’t work with a 2U server.

I thought I would like to complete the circle by noting that I bought an EATON 1500 VA UPS and, after a “quick” deploy of NUT, I am supervising its state in Home Assistant, and automating power shedding (turn off non-critical servers 30 seconds after going on battery, an turning off all other machines when power reaches critical levels).

My biggest surprise was to learn that I only really get 10 minutes backup with all monitors on, whereas powering all monitors off, or getting them into power save mode takes that up to 20 minutes… and powering off the nonessential servers gets me to 45. Whoa.

Does HA support UPSs with a USB HID protocol?
I got it running on a thin client with the generic 86-64 HA build. Together with my router they consume about 37W. Looking to keep them both running for several hours but it is not obvious how long they will last when sellers only give VA or W!
I want to be able to shut HA down gracefully when the capacity left drops to say 20% and then come back on when power is restored. But if the power comes back on after HA shuts down, but before the UPS gets to 0%, then HA (or rather the BIOS) won’t know it’s safe to reboot! How can I get round that?
I also want to be able to run an automation on reboot triggered by knowledge of a power outage. How can I do that?
Several questions there…

1 Like

What model UPS?

I’m just browsing them on Amazon. Haven’t come across any that mention NUT, but several mention USB HID. This is just one of them - Eaton 3S 700B UPS.Don’t want to spend more than £100 (UK).

I have used that exact UPS. It works with NUT.

It will run for at least an hour with a 37W load.

HA supports all UPSes supported by NUT. NUT supports HID UPSes.

Thanks Tom. I got one myself now on Amazon Prime day. I struggled a bit with the “Network UP Tools (NUT)” until I found it was both an Add-On AND an Integration and I needed both!
I’ve got 5 entities available (Battery charge, Load,Voltage, Status and Status Data) and 15 not available.
So whilst I can monitor the voltage, say, and shutdown HA gracefully if it starts looking low, if the mains power comes back on before the UPS actually cuts out HA will not reboot. I have the BIOS set to boot on power-up.
It seems to me that I’m better off doing nothing and letting HA die with the UPS; then at least it will come back on again. Not very graceful.
Thoughts?

SoC (state of charge) will be a better sensor to monitor than voltage.

For your very small load I’d disable the shutdown command and automate shutting down home assistant at SoC = 10%. That way you would be unlucky if the power came back before the UPS shutdown, but yeah it could still happen. Not sure how to get around that.

Home Assistant UPS Monitoring with NUT Addon #homeassistant #energymeter #smarthome #diy

1 Like

Is there a recommendation which UPS to purchase when the task is „only“ to keep alive the HA machine (NanoPi running at 5V 4W) and the Internet AP (FritzBox running at 12V 5W) for something like 1h and integrating into HA? My first idea was one of those 18650-UPS-boxes sold for cheap but presumably they will not broadcast their status in any way :frowning:

Yes. the boxes for cheap were my go-to solution and, yes. they have no monitoring of the status of the “UPS”. They are just big battery banks with low voltage output. Think of it as an electronics project waiting to happen.

To separate the low-voltage battery packs from the mains voltage “big” UPSes I have created a new thread for those solutions: Low-voltage UPS array with at least outage notification? - #4 by Cabletwister
Fully aware of the drawbacks of those solutions.

1 Like

You can activate a bunch more diagnostic entities in any NUT device. Go to the device page and see the hidden disabled entities then enable them.

I can see the realtime load and power factor! So nice.

After three power losses in ten minutes toasted my raid and being a true to form home assistant cheapskate, I came up with a way of monitoring power status i.e if there is mains power or not.

If anyone is interested in getting a cheap UPS (not monitored) solution to shutdown in the event of a power failure, then here’s my WIP :slight_smile:

It’s hardly enterprise grade but it will shutdown (once I write that bit) after a predetermined time. This is paired with the cheapest POS UPS I could find online, 800VA with a 80 watt load =~ 6-8 mins, so the shutdown script will run after five minutes if the plug status goes unavailable and will cancel if the state changes from unavailable to anything else i.e. on/off.

The way it works:

HA script uses button.press to ping a zigbee plug every minute, automations monitor this state and trigger the shutdown or cancel shutdown scripts. I prefer using automations to trigger scripts rather than automations alone since (unless this has changed recently), a step failing in an automation breaks the rest of the automation, scripts will run if a step fails.

automation.yaml

# Ping Zigbee plug every minute
- id: 'mains_power_plug_ping'
  alias: mains power ping power plug
  description: Ping Z-Wave power plug every minute
  trigger:
  - platform: time_pattern
    minutes: "/1"
  condition: []
  action:
  - service: button.press
    target:
      entity_id: button.heater_ping
    data: {}
  mode: single

# Trigger shutdown script if power lost
- id: 'mains_power_lost'
  alias: Mains Power Lost
  description: Shutdown after 5 mins if power is lost
  trigger:
  - platform: state
    entity_id:
    - switch.heater
    to: unavailable
    for:
      hours: 0
      minutes: 1
      seconds: 0
  condition: []
  action:
    - service: script.mains_power_lost_script
    - service: input_boolean.turn_off
      target:
      entity_id:
       - input_boolean.mains_power
     data: {}
  
  mode: single

# Cancel shutdown script if power restored
- id: 'mains_power_restored'
  alias: Mains Power Restored
  description: Reset Input Boolean cancel Shutdown
  trigger:
  - platform: state
    entity_id:
    - switch.heater
    from: unavailable
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
    - service: script.mains_power_restored_script
    - service: input_boolean.turn_on
      target:
      entity_id:
       - input_boolean.mains_power
     data: {}

The scripts called by the automations:

scripts.yaml

mains_power_lost_script:
  alias: "Mains Power Lost Script"
  sequence:
    - service: input_boolean.turn_off
      target:
        entity_id:
        - input_boolean.mains_power
  
    - variables:
        start: 5
        end: 0
        step: -1
    - repeat:
        until:
          - condition: template
            value_template: >-
              {{ 
              (step == 0) or ((step < 0) and 
              (start + step * ( repeat.index - 1)) <= end) or 
              ((step > 0) and 
              (start + step * ( repeat.index - 1)) >= end) 
              }}
        sequence:
          - variables:
              current: '{{ start + step * ( repeat.index - 1 ) }}'
          - service: logbook.log
            data:
              name: countdown.test
              message: "Power lost {{current}} minutes until system shutdown"

          - service: system_log.write
            data:
              logger: countdown.test
              level: warning
              message: >-
                {{ 'Loop %d, val=%d, step=%d, test=%d' % (repeat.index, current,
                step, (step==0) or ((step < 0) and current < end) or ((step > 0)
                and current > end) )  }}
          - service: notify.alexa_media_desk
            metadata: {}
            data:
              message: "Power lost {{current}} minutes until system shutdown"
              title: '!!! POWER ALERT !!!'
          - service: notify.mobile_app_cph2025
            metadata: {}
            data:
              message: "Power lost {{current}} minutes until system shutdown"
              title: "!!!! POWER LOST !!!!"

          # - service: notify.rods_join
          #   data:
          #     message: "Power has been lost - system will shutdown in {{current}} minutes"
          #     title: "!!!! POWER LOST !!!!" 

          - delay:
              hours: 0
              minutes: 1
              seconds: 0
              milliseconds: 500


    - service: system_log.write
      data:
        logger: countdown.test
        level: warning
        message: "SHUTDOWN STARTED"
    - service: notify.alexa_media_desk
      metadata: {}
      data:
        message: "SHUTDOWN STARTED Power has been lost"
        title: 'Shutdown NOW !!! POWER ALERT !!!'
    - service: notify.mobile_app_cph2025
      metadata: {}
      data:
        message: "SHUTDOWN STARTED Power has been lost"
        title: "Shutdown NOW !!!! POWER LOST !!!!"

  mode: restart
mains_power_restored_script:
  alias: "Mains Power Restored Script"
  sequence:

  - service: script.turn_off
    target:
      entity_id:
      - script.mains_power_lost_script
    data: {}

  - service: input_boolean.turn_on
    target:
      entity_id:
      - input_boolean.mains_power
    data: {}
  - service: notify.alexa_media_desk
    metadata: {}
    data:
      message: "Power RESTORED"
      title: '!!! POWER RESTORED !!!'

  - service: notify.mobile_app_cph2025
    metadata: {}
    data:
      message: "Power RESTORED"
      title: "!!!! POWER RESTORED !!!!"

  - service: notify.rods_join
    metadata: {}
    data:
      message: "Power RESTORED"
      title: "!!!! POWER RESTORED !!!!"

  - service: system_log.write
    data:
      message: "Power Restored\n Shutdown Cancelled"
      level: info
1 Like

I have the same UPS and want to monitor this via HA. at the moment its connected to my PC but i’m going to move it too the loft where all the switches etc are. I have ReadyNas 2024 up there with a USB port. How did you get HA to monitor it via the NAS?

I make use of the in-built functionality of my Synology NAS to act as a UPS server. It has the ability to monitor a UPS via a serial cable connected to a UPS port and also act as a server to make this information available to other devices on the network e.g. HA. The reason for doing it this way is so that the Synology is able to automatically shutdown when the battery low threshold is reached.

This is how the configuration screen looks in the Synology:

The IP address under “Permitted Diskstation Devices” is for my HA instance.

In HA I added the NUT device to poll the Synology for the UPS information, the IP address highlighted is for the Synology:

This then makes the following entities available in HA:

I think you will need to investigate how to get the NUT server software running on your ReadyNAS if possible (sorry but I have no idea about that).

While looking into this I did notice that there is a NUT Integration and also a NUT Add-on although I do not know what the difference is between the two.

So i moved the UPS to my loft lastnight and plugged it into the rear port on the readynas, suprisingly the NAS detected it and knew exactly what it was. This was then passed by it over snmp to HA! So all sorted thanks for the help

I am new to NUT but thanks to community notes here I have the plugin and integration working and my windows / Linux NUT clients communicate as expected; reporting correct UPS device and status.

Devices:
HAOS (RaspberryPi4 running NUT plugin all updated to latest)
Buffalo TeraStation NAS models: TS3410D / TS3420D
UPS: Tripp Lite (Eaton) SmartLCD using the usbhid-ups driver as recommended by NUT

I am trying to integrate with my Buffalo TeraStation NAS devices, connecting them as clients. I have confirmed some level of com’s by attempting “UPS sync” via the NAS web GUI resulting with:

Before opening port 3493 = no coms, NAS gui errors out as expected
After opening port 3493 = Gui reports: Sync confirmed → E10 UPS running on battery warning → Gui now says UPS Sync “can not confirm status”. There is very little in the NAS or HAOS/CORE/NUT logs indicating why NUT coms fail or report incorrect status.

NUT documentation indicates that Buffalo NAS TeraStation includes native NUT (re: Network UPS Tools - Related projects )

Is there a known device ID or UID/PWD I am missing (similar to the Synology UID/PWD posted elsewhere here?), or is this combination known to be incompatible?

Any help would be appreciated.

Thanks!