Question about UPS

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
SRG
Starting Member
Starting Member
Posts: 16
Joined: Fri Feb 12, 2010 9:36 pm
Location: MONTBELIARD
Contact:

Question about UPS

Post by SRG »

Hello,
I've just discovered DomotiGa and i'm quite pleased with it.
I've set up a few devices (Oregon / RFXCOM, a bit of x10 through Heyu, ...), and my APC UPS ES 550.
About this one, i've seen that 3 values are checked :
sCmd = "GET VAR " & sAddress & " ups.status"
sCmd = "GET VAR " & sAddress & " input.voltage"
sCmd = "GET VAR " & sAddress & " ups.temperature"

Sadly my model doen't understand ups.temperature.
How can I replace ups.temperature with something else more usefull ? (does i have to modify the code or is there another cleaner solution ?)
Or maybe should i add in the code a new deveice "APC 550" in addition to the existing one ? If i do that is there a possibility to have this commited to the DomotiGa SVN ?

For information through nut on the command line i get :
upsc apc@localhost
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2009/02/09
battery.runtime: 847
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.5
battery.voltage.nominal: 12.0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.4.1
driver.version.data: APC HID 0.93
driver.version.internal: 0.34
input.transfer.high: 266
input.transfer.low: 180
input.voltage: 232.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 828.D3 .I
ups.firmware.aux: D3
ups.load: 41
ups.mfr: APC
ups.mfr.date: 2009/02/09
ups.model: Back-UPS ES 550
ups.productid: 0002
ups.serial: 5B0907T01241
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d
Thanks in advance for any clue.
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Question about UPS

Post by RDNZL »

Hi,

you could measure it's load instead for example. (ups.load)

Maybe it's best to create a new device type and let the UPS code get the correct info accordingly.
I have created a ticket for it on the website.
Regards, Ron.
SRG
Starting Member
Starting Member
Posts: 16
Joined: Fri Feb 12, 2010 9:36 pm
Location: MONTBELIARD
Contact:

Re: Question about UPS

Post by SRG »

Hello,
Thanks for your answer.
Does it mean that you'll make the modification on your side ? Or does I have to do it on my side ?
Indeed i think it's best to have 2 differents devide types (the one existing and a new one).
If you need any help (testing, and so son), feel free to ask.

(and I'm curious to see how to "factorize" the code "between UPS1000 and UPS550" with Gambas (i don't know a lot about Gambas, is there some kind of "extends" of a class ?))

(the exact debug output log was by the way :
2010/02/13 11:17:49 [UPS] checking UPS named 'Onduleur' with address apc
2010/02/13 11:17:49 [UPS] GET VAR apc ups.status
2010/02/13 11:17:49 [UPS] GET VAR apc input.voltage
2010/02/13 11:17:49 [UPS] GET VAR apc ups.temperature
2010/02/13 11:17:49 VAR apc ups.status "OL"
2010/02/13 11:17:49 VAR apc input.voltage "234.0"
2010/02/13 11:17:49 ERR VAR-NOT-SUPPORTED
)
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Question about UPS

Post by RDNZL »

I have changed the code, and also removed the restriction of having only one UPS.
Added a new APC BackUPS 550 device type to the database.
I will put it online soon, since I want to include some other changes too.
You have to test it for me since I don't have a UPS any more.
Regards, Ron.
SRG
Starting Member
Starting Member
Posts: 16
Joined: Fri Feb 12, 2010 9:36 pm
Location: MONTBELIARD
Contact:

Re: Question about UPS

Post by SRG »

I was willing to try but it seems that the SVN is broken.
I can generate the "gambas" binary, but one executed i get the following error now :
CRFXComRX.RFXComRX_Ready.78: #11: Unknown symbol 'ProtocolSetup' in class 'Socket'
0: CRFXComRX.RFXComRX_Ready.78
And indeed at this line the method "ProtocolSetup" is called on the objet hRFXComRX defined as Socket (PUBLIC hRFXComRX AS NEW Socket).

(that's why i dislike "script language" like this one, some errors are only shown at run time and not at compilation time - of course maybe i made something wrong on my side ...)
SRG
Starting Member
Starting Member
Posts: 16
Joined: Fri Feb 12, 2010 9:36 pm
Location: MONTBELIARD
Contact:

Re: Question about UPS

Post by SRG »

Okay, once corrected (i've just removed the variable name before the function call) and once the device changed to the correct type (the new APC UPS ES550), everything seems to be ok for me about UPS read through the "nut" server :
2010/02/15 23:38:54 [UPS] checking UPS named 'Onduleur' with address 'apc'
2010/02/15 23:38:54 [UPS] GET VAR apc ups.status
2010/02/15 23:38:54 [UPS] GET VAR apc input.voltage
2010/02/15 23:38:54 [UPS] GET VAR apc ups.load
2010/02/15 23:38:54 VAR apc ups.status "OL"
2010/02/15 23:38:54 VAR apc input.voltage "234.0"
2010/02/15 23:38:54 VAR apc ups.load "41"
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Question about UPS

Post by RDNZL »

SRG wrote:I was willing to try but it seems that the SVN is broken.
I can generate the "gambas" binary, but one executed i get the following error now :
CRFXComRX.RFXComRX_Ready.78: #11: Unknown symbol 'ProtocolSetup' in class 'Socket'
0: CRFXComRX.RFXComRX_Ready.78
And indeed at this line the method "ProtocolSetup" is called on the objet hRFXComRX defined as Socket (PUBLIC hRFXComRX AS NEW Socket).

(that's why i dislike "script language" like this one, some errors are only shown at run time and not at compilation time - of course maybe i made something wrong on my side ...)
I fixed the ProtocolSetup call in the latest revision.
Regards, Ron.
Post Reply

Return to “DomotiGa Forum”