Skip to content

Instantly share code, notes, and snippets.

UPS Shutdown Scripts

This documents everything I needed to get my Proxmox instance to listen to my UPS Server and initiate a shutdown script that would shutdown my UDM Pro. This is needed as the UDM Pro does not have the ability to listen to a NUT server on it's own (what the hell ubiquiti).

I'm using a Synology NAS as a NUT server, but you can point your NUT client to any supported UPS. It's set to alert any clients subscribed to it when the UPS connected to it is in low battery. This all applies regardless of what machine you have a NUT server on, it does not have to be Synology.

Additionally these install steps were on my Proxmox machine, but these steps will probably work on any Debian GNU/Linux OS with little to no modification. YMMV

High level summary of the steps:

  • Install the NUT client on Proxmox
DELAY_RANGE_START = 3
DELAY_RANGE_END = 6
def shuffler(array):
random.shuffle(array)
return array
def chunks(array, n):
"""Splits array into chunks"""
for i in range(0, len(array), n):
pathway_lights_on:
alias: Pathway Lights On
sequence:
- service: light.turn_on
entity_id: light.fairy_light_1
data:
brightness_pct: 50
- delay:
hours: 0
minutes: 0
esphome:
name: fairy_light_1
platform: ESP32
board: nodemcu-32s
# wifi settings
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pw
power_save_mode: none