Skip to content

Commit cf973cc

Browse files
authored
Merge pull request #3521 from Steve-Tech/voltronic-qi
nutdrv_qx: Voltronic-QS: Add QI command
2 parents 92c10ad + 81455d1 commit cf973cc

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

NEWS.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ https://github.com/networkupstools/nut/milestone/13
8181
allowing the Megatec payload to be successfully reconstructed. [PR #3485]
8282
* In `Voltronic-QS-Hex` subdriver, the format string sanity check added in
8383
recent NUT releases caught a mismatch in `ups.load` reading. [issue #3532]
84+
* Modified `voltronic-qs` subdriver to request the QI command, supplying
85+
NUT with battery charge, runtime, input frequency, output current, and
86+
input transfer low/high values on devices which support it (`H`, `I`, `J`
87+
protocols, e.g. Powershield PSDR800). [#3521]
8488

8589
- Introduced a new NUT driver named `ragtech` which provides support for the
8690
Ragtech "Easy Pro" family of line-interactive UPS units (also sold under

data/driver.list.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,7 @@
12331233
"Powermatic" "ups" "2" "Cleanline L-1000C" "USB" "nutdrv_qx" # https://alioth-lists.debian.net/pipermail/nut-upsdev/2024-September/008015.html
12341234

12351235
"PowerShield" "ups" "2" "Defender 1200VA" "USB" "blazer_usb"
1236+
"PowerShield" "ups" "2" "PSDR800" "USB" "nutdrv_qx protocol=voltronic-qs"
12361237

12371238
"PowerTech" "ups" "1" "Comp1000" "DTR cable power" "genericups upstype=3"
12381239
"PowerTech" "ups" "2" "SMK-800" "" "blazer_ser"

docs/nut.dict

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3789 utf-8
1+
personal_ws-1.1 en 3792 utf-8
22
AAC
33
AAS
44
ABI
@@ -984,6 +984,7 @@ PROTVER
984984
PRs
985985
PSA
986986
PSD
987+
PSDR
987988
PSF
988989
PSFn
989990
PSGPSER
@@ -1057,6 +1058,7 @@ PowerWalker
10571058
PowerWare
10581059
Powerchute
10591060
Powercool
1061+
Powershield
10601062
Powervar
10611063
Powervar's
10621064
Powerwell
@@ -1088,6 +1090,7 @@ QFRE
10881090
QGR
10891091
QGS
10901092
QHE
1093+
QI
10911094
QID
10921095
QLDL
10931096
QMD

drivers/nutdrv_qx_voltronic-qs.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "nutdrv_qx_voltronic-qs.h"
2727

28-
#define VOLTRONIC_QS_VERSION "Voltronic-QS 0.10"
28+
#define VOLTRONIC_QS_VERSION "Voltronic-QS 0.11"
2929

3030
/* Support functions */
3131
static int voltronic_qs_claim(void);
@@ -100,6 +100,20 @@ static item_t voltronic_qs_qx2nut[] = {
100100
{ "battery.voltage.nominal", 0, NULL, "F\r", "", 22, '#', "", 11, 15, "%.1f", QX_FLAG_STATIC, NULL, NULL, NULL },
101101
{ "output.frequency.nominal", 0, NULL, "F\r", "", 22, '#', "", 17, 20, "%.0f", QX_FLAG_STATIC, NULL, NULL, NULL },
102102

103+
/* Query UPS for charge and runtime
104+
* > [QI\r]
105+
* < [(100 00979 50.0 000.3 177 290 0 0000010000112000\r]
106+
* 0123456789012345678901234567890123456789012345678
107+
* 0 1 2 3 4
108+
*/
109+
110+
{ "battery.charge", 0, NULL, "QI\r", "", 49, '(', "", 1, 3, "%.0f", 0, NULL, NULL, NULL },
111+
{ "battery.runtime", 0, NULL, "QI\r", "", 49, '(', "", 5, 9, "%.0f", 0, NULL, NULL, NULL },
112+
{ "input.frequency", 0, NULL, "QI\r", "", 49, '(', "", 11, 14, "%.1f", 0, NULL, NULL, NULL },
113+
{ "output.current", 0, NULL, "QI\r", "", 49, '(', "", 16, 20, "%.1f", 0, NULL, NULL, NULL },
114+
{ "input.transfer.low", 0, NULL, "QI\r", "", 49, '(', "", 22, 24, "%.0f", QX_FLAG_STATIC, NULL, NULL, NULL },
115+
{ "input.transfer.high", 0, NULL, "QI\r", "", 49, '(', "", 26, 28, "%.0f", QX_FLAG_STATIC, NULL, NULL, NULL },
116+
103117
/* Instant commands */
104118
{ "beeper.toggle", 0, NULL, "Q\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL, NULL, NULL },
105119
{ "load.off", 0, NULL, "S00R0000\r", "", 0, 0, "", 1, 3, NULL, QX_FLAG_CMD, NULL, NULL, NULL },
@@ -123,6 +137,7 @@ static item_t voltronic_qs_qx2nut[] = {
123137
static testing_t voltronic_qs_testing[] = {
124138
{ "QS\r", "(215.0 195.0 230.0 014 49.0 22.7 30.0 00000000\r", -1 },
125139
{ "F\r", "#220.0 003 12.00 50.0\r", -1 },
140+
{ "QI\r", "(100 00979 50.0 000.3 177 290 0 0000010000112000\r", -1}
126141
{ "M\r", "V\r", -1 },
127142
{ "Q\r", "", -1 },
128143
{ "C\r", "", -1 },

0 commit comments

Comments
 (0)