Intel NUC Power Failure - Trouble Restarting HA

What is the exact model of NuC that you have? you can look up a video on how to swap the CMOS battery of it.

As for the UPS and Shutdown setup, the way I have it setup is I have my 1U APC SmartUPS 1500VA connected via the USB serial connection to my Synology NAS to act as the Server for HA to pull the UPS state data from using NUT.

I then have alerts set at below 11% and 11min thresholds on the notifications so I know when it hits 10% or 10min left on power left.

With my current homelab cabinet setup; my system when I am gaming triggers this time threshold with my testing, powered off I get 90min for my setup and 18-30min when my desktop is idle, enough time to stop and shutdown to migrate to my phone during a black out until the rest shuts off if there is no power back in the time remaining.

With the data being pulled and with the alerts you can also setup automatons as @nickrout stated to safe shutdown certain devices when a lower threshold is met and have them setup to turn back on when power is restored through the UPS.

Here is how I have my notifications setup:

alias: "Main UPS: Level and Runtime Alert"
description: Notify when at 10% Charge or 10min time Left
trigger:
  - type: battery_level
    platform: device
    device_id: 
    entity_id: 
    domain: sensor
    below: 11
    id: Main UPS Battery Level
  - type: duration
    platform: device
    device_id: 
    entity_id: 
    domain: sensor
    id: Main UPS Battery Runtime
    below: 660
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Main UPS Battery Level
        sequence:
          - device_id: 
            domain: mobile_app
            type: notify
            message: Main UPS at 10% Charge Left
            title: UPS Power
      - conditions:
          - condition: trigger
            id:
              - Main UPS Battery Runtime
        sequence:
          - device_id: 
            domain: mobile_app
            type: notify
            message: Main UPS at 10min Charge Left
            title: UPS Power
mode: single

Here is an example using a cyber power UPS. APC likely has a similar thing.

Ok I’ve been doing some research.

  1. It looks like I could connect UPS to either my Synology RS819 NAS and have that as the NUT server or connect to NUC and install the add on in HA, is one approach better than the other?

  2. Concerning when power comes back on, how would I get the NUC to turn on a few mins after the router? Maybe I could leave the router off the UPS so it powers up as soon as power is on, but have the UPS only power up the connected devices a few mins later?

I ultimately ran my nut servers in its own docker container. So much better for me since i run all my stuff in docker

Devices connected to the UPS will power on the moment power is restored through it, the UPS is there to delay shut off when there is a drop in power from the wall and the NUT add-on is there to pull the data from the host the UPS is connected to so you can monitor the status of the charge capacity and time it can run before you need to trigger a safe shut off to prevent data loss when its being written at the time of the power loss.

There is only a Stay off, Last State and Power On option in NUC bios from what I remember no specific option to set a delay.

i do actually have a problem is that i get this message alot “the website too long to respond”
and i need to restart my nuc everyday for it to work can someone help me

So I got a UPS and it’s connected to my synology NAS via usb hosting the UPS network server. Got NUT integration set up on ha and tried setting up a simple automation but I’m having trouble with the hassio.host_shutdown.

description: ""
mode: single
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.ups_battery_charge
    below: 15
condition: []
action:
  - service: hassio.host_shutdown

Or is this all i need to do? I have not tested yet but couldn’t find how to actually do the service call in dev tools either, also im running ha in docker now not OS, would this change being able to use that service?

Yes, it would. I suggest setting up a service to activate whatever command you usually use to halt your computer. Shell Command - Home Assistant

Only took me half a day going round in circles but we got there after finding this, took about 10 mins to set up after the fact. Hopefully this can help someone in future. Guide: Start up and shut down remote linux PC using Home Assistant – Creating Smart Home

So you didn’t previously reveal that the computer you wanted to stop was not the same computer rubbing HA.

My apologies if it wasn’t clear, but the intent was/is to shutdown my NUC (host machine now running docker and home assistant container) when UPS battery falls below a certain point, to avoid an uncontrolled shutdown from power loss. I managed to set this up thanks to your recommendation of using a shell command. There was a lot of good learning along the way.