I bought myself a old APC Back-UPS CS650 uninterruptible power supply, and replaced the accumulator in it with a large lead-acid one, it coincides in voltage with the stock accumulator. I connected the uninterruptible power supply via USB to the PC, and when I pull the power cable out of the socket, the PC will almost instantly turn off, and then the uninterruptible power supply turns off. If I stop the apcupsd daemon, this does not happen, and the uninterruptible power supply works until the accumulator sits down. To see the reason for the shutdown in logs, I commented out the commands for poweroff in the apccontrol file. Here is what is output in journalct-u apcupsd
Power failure on UPS invilso-systemproductname. Running on batteries.
Remaining battery runtime below limit on UPS invilso-systemproductname. Doing shutdown.
UPS invilso-systemproductname initiated Shutdown Sequence
Continuing with shutdown.
Here is the apcupsd config:
UPSCABLE usb
UPSTYPE usb
DEVICE /dev/usb/hid/hiddev[0-9]
LOCKFILE /run/apcupsd
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 0
BATTERYLEVEL 0
MINUTES 9999
TIMEOUT 60
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
#FACILITY DAEMON
#UPSNAME UPS_IDEN
# BATTDATE 09/29/23
#SENSITIVITY H
#WAKEUP 60
#SLEEP 180
#LOTRANSFER 208
#HITRANSFER 253
#RETURNCHARGE 15
#BEEPSTATE T
#LOWBATT 2
#OUTPUTVOLTS 230
#SELFTEST 336
It would be nice if you could completely disable the apcupsd automation, and leave only apcsuccess status
to be able to control your script based on voltage, here is the actual output of apcsuccess status:
APC : 001,045,1081
DATE : 2023-10-04 14:52:53 +0300
HOSTNAME : invilso-systemproductname
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : invilso-systemproductname
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2023-10-04 14:52:44 +0300
MODEL : Back-UPS CS 650
STATUS : ONLINE
LINEV : 230.0 Volts
LOADPCT : 34.0 Percent
BCHARGE : 15.0 Percent
TIMELEFT : 2.9 Minutes
MBATTCHG : 0 Percent
MINTIMEL : 9999 Minutes
MAXTIME : 99999 Seconds
OUTPUTV : 230.0 Volts
SENSE : Medium
DWAKE : 0 Seconds
DSHUTD : 0 Seconds
LOTRANS : 160.0 Volts
HITRANS : 278.0 Volts
RETPCT : 0.0 Percent
ITEMP : 29.2 C
ALARMDEL : 30 Seconds
BATTV : 13.4 Volts
LINEFREQ : 50.0 Hz
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : None
STATFLAG : 0x05000008
MANDATE : 2004-06-09
SERIALNO : QB0424134379
BATTDATE : 2023-09-29
NOMOUTV : 230 Volts
NOMINV : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 400 Watts
FIRMWARE : 817.v2.I USB FW:v2
END APC : 2023-10-04 14:52:55 +0300
I will be very grateful if you can help me.
P.S. I extended the cables to the accumulator, but I extended them with a cable of 16mm2 and a length of 50 cm, there should not be a strong voltage drop even at full load.