It is very useful to have the hub (HomeSeer in this case) connected to an UPS.
Small outages will not disrupt the normal working and in case of long blackout will be possible to safely shut down the system.
Plus will be possible to create events to inform about an outtage, like sending an email.
This article uses the plugin APCUPSD that is not free and is based on the apc utilities.
Here some notes to connect my HomeSeer HS4 running on a Raspberry Pi to a CyberPower SL700U UPS.
Physical connection
First of all of course, install the UPS and connect the power of the HomeSeer to it, then connect the USB cable from the UPS to a free USB port of the Raspberry.
HomeSeer HS4 does not have a native UPS manager, the Pi acts as a bridge.
Then few things to do :
- login to the server console
- install 'apc server' : sudo apt install apcupsd
(Note ! This part is open source, thus no need to "pay" it. It is the HomeSeer plugin that require registration and payment)
After restart the system, issuing a lsusb should show the UPS.
In my case :
In my case :
homeseer@HTPiHubG3v2:~$ lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 109: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
homeseer@HTPiHubG3v2:~$
APCUPSD configuration
Edit the file apcupsd.conf (sudo nano /etc/apcupsd/apcupsd.conf) and be sure to have these lines :
UPSNAME CyberPowerSL700U
UPSCABLE usb
UPSTYPE usb
DEVICE
Usually the DEVICE contains the port, leave it blank to allow HomeSeer to recognize it automatically
Save the file and edit the apcupsd config file :
sudo nano /etc/default/apcupsd
Set the line from no to yes and save the file.
Restart the APCUPSD server : sudo systemctl restart apcupsd
Issuing the command : apcaccess status
will return the status of the UPS.
homeseer@HTPiHubG3v2:~$ apcaccess status
APC : 001,031,0737
DATE : 2026-06-25 16:28:37 -0500
HOSTNAME : HTPiHubG3v2
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : CyberPowerSL700U
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2026-06-25 16:28:32 -0500
MODEL : ST Series
STATUS : ONLINE
LINEV : 121.0 Volts
LOADPCT : 0.0 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 136.7 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
OUTPUTV : 121.0 Volts
DWAKE : -1 Seconds
LOTRANS : 96.0 Volts
HITRANS : 140.0 Volts
ALARMDEL : 30 Seconds
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : ??
STATFLAG : 0x05000008
NOMINV : 120 Volts
NOMPOWER : 375 Watts
END APC : 2026-06-25 16:28:38 -0500
homeseer@HTPiHubG3v2:~$
HomeSeer configuration
Having the base UPS access set up, is time to configure HomeSeer.
From the HS4 web interface, navigate to the Plugins menu and ensure you have the APCUPSD Plugin installed.
The plugin need to be configured with the 'localhost', or 127.0.0.1 IP address.
DON'T use the assigned IP (it might be set via DHCP).
DON'T use the assigned IP (it might be set via DHCP).
Be sure to use the port 3551 (the default port for apcupsd network communication).
The plugin will create HS4 devices that track your UPS state, load percentage, and voltage after restarting the system.
Having the system configured is possible now to add events based on the UPS status.
Mainly I want to create two events :
- be notified via email about outages (and restoring power)
- gracefully shutdown the Raspberry after 60 min of missing power
Outage email notification
TBD
Shutdown
TBD
Important note !
In case NUT was installed on the system, BE SURE to have it disabled (or removed) if APCUPSD is used !
To disable it : sudo systemctl disable nut-server
No comments:
Post a Comment