Most all storage media will not survive power cycle events across time. It is very important for a myServer 6 control system to be on a UPS for proper graceful shutdown when there is an AC line power outage. Read More. Plugging the system into a UPS is a great first step. But what if the power outage extends beyond the physical storage capacity of the backup battery? It is important to automate a myServer graceful shotdown on all systems. myServer can also be configured to shut down other devices (TVs, AV receivers, video matrix, etc.) This ability greatly reduces the potential for very expensive equipment failures.
This is implemented with a compatible UPS that is USB connected to myServer for monitoring. Note that USB has a limited cable length, so pre-planning the UPS and myServer location is important (should be within approx. 10 ft from each other).
This driver requires that the NUT utilities are installed on the server that is connected to the UPS controller. Please follow the Nut tutorial here. Perform all the steps up to the "reboot (because it’s easy)" line.
Compatible with all APC Uninteruptible Power Backups that supports UPSD technology.
UPS is connected to myServer PIs USB.
You can also run the APC UPSD software on Windows and relay the message to myServer 6 controller via ethernet.
Uses APC UPSD
Power outage.
UPS goes on battery.
UPS starting to run out of battery.
UPS script
UPS sends message to myServer via curl command (HTTP push message) to tell myServer to shutdown gracefully (save variables to database and shut process down)
Automation event example
Get the variable name from the list of variables for your UPS device ID (device ID is exposed in the UPS myServer Pi Driver)
Automation Rule Conditions:
When:
{{sensor_19_battery_charge}} <= 5
Automation Rule Actions:
Shutdown
Installation
Use case:
Control systems like our myServer, can monitor the UPS (highly recommended in any installation). When the UPS battery goes low (power has been out for awhile), then myServer gracefully shuts down. But before it goes offline, it can be configured to send notifications that the UPS advises that the power is out. The network switch / modem etc. is also on a UPS (same one or different ones). And because myServer runs locally in the home with not critical need to see Internet, it can log the power outage, send local (to the home) messages to any connected client (like your phone) without Internet. It can also send an email / text message IF there is Internet. myServer monitors if Internet is available or not so it can be configured on what it's capable of doing.
Network UPS Tools (NUT) Ultimate Guide
Meet NUT Server, or Network UPS Tools.It’s an open UPS networking monitoring tool that runs on many different operating systems and processors.This means you can run the server on Linux, MacOS, or BSD and run the client on Windows, MacOS, Linux, and more.It’ perfect for your Pi, server, or desktop.It works with hundreds of UPS devices, PDUs, and many other power management systems.
This is the ultimate guide to configuring Network UPS Tools (NUT).We cover everything from installing and configuring the server on as Raspberry Pi, configuring the client on Windows and Linux, configure a charting and graphing website to visualize NUT data, spin up an additional web site use Docker, and finally set up monitoring and alerting to automate shutdowns of your machine.
https://networkupstools.org
Also, note to self, don’t eat a salad before you record a video….
UT UPS Server
plug in ups
should see something like
|
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 019: ID 09ae:2012 Tripp Lite
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
1
2
|
sudo apt update
sudo apt install nut nut-client nut-server
|
should see something like
tripp lite
1
2
3
4
5
6
7
8
|
[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "09AE"
productid = "2012"
product = "Tripp Lite UPS"
vendor = "Tripp Lite"
bus = "001"
|
apc 1500
1
2
3
4
5
6
7
8
9
|
[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS XS 1500M FW:947.d10 .D USB FW:d10"
serial = "3xxxxxxxxxxx"
vendor = "Tripp Lite"
bus = "001"
|
apc 850
1
2
3
4
5
6
7
8
9
|
[nutdev3]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"
product = "Back-UPS ES 850G2 FW:931.a10.D USB FW:a"
serial = "3xxxxxxxxxxx"
vendor = "American Power Conversion"
bus = "001"
|
1
|
sudo nano /etc/nut/ups.conf
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
pollinterval = 1
maxretry = 3
[tripplite]
driver = usbhid-ups
port = auto
desc = "Tripp Lite 1500VA SmartUPS"
vendorid = 09ae
productid = 2012
[apc-network]
driver = usbhid-ups
port = auto
desc = "APC Back-UPS XS 1500"
vendorid = 051d
productid = 0002
serial = 3xxxxxxxxx
[apc-modem]
driver = usbhid-ups
port = auto
desc = "APC 850 VA"
vendorid = 051d
productid = 0002
serial = 3xxxxxxxxx
|
1
|
sudo nano /etc/nut/upsmon.conf
|
1
|
sudo nano /etc/nut/upsd.conf
|
Change 127.0.0.1
to all interface
1
|
sudo nano /etc/nut/nut.conf
|
1
|
sudo nano /etc/nut/upsd.users
|
1
2
3
|
[monuser]
password = secret
admin master
|
1
|
sudo nano /etc/udev/rules.d/99-nut-ups.rules
|
1
2
3
4
5
6
7
|
SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end"
# TrippLite
# e.g. TrippLite SMART1500LCD - usbhid-ups
ACTION=="add|change", SUBSYSTEM=="usb|usb_device", SUBSYSTEMS=="usb|usb_device", ATTR{idVendor}=="09ae", ATTR{idProduct}=="2012", MODE="664", GROUP="nut", RUN+="/sbin/upsdrvctl stop; /sbin/upsdrvctl start"
LABEL="nut-usbups_rules_end"
|
reboot (because it’s easy)