How do I manage an UPS with NUT (addon and integration)

I’m really confused how my APC can work together with HASS on a NUC install. The UPS is supposed to send a shutdown signal once the UPS is going in shutdown. It should power off the UPS and powerup again. assuming the NUC is properly shutdown it should powerup again (with the correct bios settings).

I don’t see how I can control settings from HA (only sensors are visible). The shutdown option in the NUT addon does shutdown the server but if power comes up before the battery is depleted the APC won’t powercycle and the NUC stays off.

The integration also mentions " An additional virtual sensor type ups.status.display is available". I don’t see what that is or does…

The shutdown works independent of HA and doesn’t appear to be an exposed entity. I don’t even have it configured.

My setup:
Shutdown automation - runs whenever the battery percentage drops below 20%.

  • My shutdown is ran by calling a PS script on the server that cleanly shuts down my VMs before powering off the machine.

Power on - if the status changes from battery to mains, then send WOL to the server.

  • Two scenarios here. The server is shutdown but power comes back before the battery is depleted, then WOL kicks it back on. Or, the battery does deplete, and will power cycle when power comes back, which will kick it back on.

If everything is shutdown including home assistant how to send WOL if the UPS switches to mains without a power cycle.
The UPS should powercycle every time to enable all machine to power up after a power loss. I can see NUT events about shutdown started. Maybe its my APC model…

You mentioned running HA on a NUC and the used the term server so I presumed we were talking about different machines (should have picked up they were the same device based on the title).

If HA is on the device being powered off, then you’ll need something external to send the WoL. I know the APC lineup does not have that feature. You will need an UPS that is network connected and has WoL.

Another option would be to put the device on a smart plug where you can cycle power manually after an outage. I imagine some of the ESPhome devices could probably have some scripting to do this automatically, but that’s beyond me.

I’m personally using Wireguard through a Unifi UDM Pro. I shut down the Unifi OS with the script I mentioned before, but that doesn’t impact routing and the Wireguard connections. So, I can power cycle a smart plug remotely if need be.

That’s does remind me though, I do need to get something setup outside of HA to detect power restoral…

I can’t see or use the upsc and upscmd commands from a terminal session.

sending WOL from an ESPhome is easy (done that). My NUC refuses to respond to WOL after I send a shutdown system command in home assistant. Even if that would work the only option would be to repeat WOL messages for 24/7

ssh into the container is possible and
upscmd [-u ] [-p ] shutdown.reboot
power cycles the UPS. So it’s not a limitation of the UPS itself

What exactly are you trying to do? Have the UPS power cycle when power is restored before the battery has depleted? I think this is dependent on the UPS itself.

The UPS doesn’t send a signal per se. NUT triggers the shutdown based on the sensor readings.

So, goes back to needing something external of HA. That could be setting NUT up somewhere else or getting WoL working.

I’m sure ESPhome can bet setup to only send the WoL after power loss/restore so you wouldn’t need to send it 24/7.

Yes power cycle when power is restored before the battery has depleted.
Something is missing in NUT integration. The docs:
Network UPS Tools (NUT) - Home Assistant (home-assistant.io)
suggest upsc upscmd commands are available for home assistant. I can only use them from a console of the addon docker (through portainer).
My UPS appears to be able to power cycle with the command shutdown.reboot
“These commands will be available as device actions in Home Assistant, allowing you to interact with your UPS.”