Anyone using an APC UPS in Aus?

Has anyone bought an APC UPS in Austria and been able to integrate it in some way with HE? I don't want to spend over $400 for one of the ones marketed as a smart model.

In the end it doesn't have to be an APC, it's just I have read about some HE drivers and other methods for interfacing with them.

If you are willing to tinker a little bit you can use a Raspberry Pi and Node-Red to integrate it. I had a working example for some time. Still have it working for my unraid server.

Basically you hook up the UPS to the Raspberry Pi via USB. Then put the pi on the network and enable access to the APC Dameon on it. Now with Node-Red setup the pallet for APC and have it query the raspberry pi APCUPS dameon to get the stats. Lastly use a virtual device in HE to pass all the UPS Data.

The hard part is getting the flow to send the status info HE right as doing it wrong can overwhelm the HE hub.

If you want more details let me know.

1 Like

Does it matter too much which model?

I think as long as the APC UPS has a usb connection probably not. That would exclude some of the really small ones, but other then that any regular retail one should work. I think the ones I test on are like a 1300 kva and a 1500kva which aren't small but certainly nothing special either.

They are also close to 10 years old now.

The pallet in Node-Red I use is "node-red-contrib-apcaccess"

Below is the flow I setup in Node-Red

[{"id":"cd80d9d7c33771f4","type":"tab","label":"APC Status","disabled":false,"info":""},{"id":"3e889802411b9ba9","type":"apcrequest","z":"cd80d9d7c33771f4","name":"APC UPS on Unraid Server","server":"aded31d5.a078","x":160,"y":180,"wires":[["df7971a05250eaa1","bf7938e44cc3628f","8c34f301018c4cc4","0ae6e16126347dcc","0496ab40929b11e1","073eeed1dc8b7978","cc19b6d0d91695e5"]]},{"id":"35d783b4117ee6ec","type":"inject","z":"cd80d9d7c33771f4","name":"","props":[{"p":"payload"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"statusJson","payloadType":"str","x":130,"y":40,"wires":[["3e889802411b9ba9"]]},{"id":"acc99fc218e6fb2e","type":"debug","z":"cd80d9d7c33771f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":140,"wires":[]},{"id":"35880977ed8dd157","type":"hubitat command","z":"cd80d9d7c33771f4","deviceLabel":"Unraid Battery Backup","name":"","server":"37a6fe31.441bc2","deviceId":"1108","command":"","commandArgs":"","x":840,"y":140,"wires":[["acc99fc218e6fb2e"]]},{"id":"df7971a05250eaa1","type":"change","z":"cd80d9d7c33771f4","name":"Battery Charge Status","rules":[{"t":"set","p":"command","pt":"msg","to":"battery","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.BCHARGE, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":80,"wires":[["5be35f9c1b996a52"]]},{"id":"bf7938e44cc3628f","type":"change","z":"cd80d9d7c33771f4","name":"Last Event Change","rules":[{"t":"set","p":"command","pt":"msg","to":"lastEvent","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.LASTXFER","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[["e20d24728ce50385"]]},{"id":"8c34f301018c4cc4","type":"change","z":"cd80d9d7c33771f4","name":"UPS status Change","rules":[{"t":"set","p":"command","pt":"msg","to":"status","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.STATUS","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":160,"wires":[["b0c5c3539ff62255"]]},{"id":"24a464574030b971","type":"apcrequest","z":"cd80d9d7c33771f4","d":true,"name":"APC UPS on Argon ONE","server":"13fe8d9c.10e232","x":150,"y":500,"wires":[["b934cd78ab3c8535","0afb17be975c4432","ae4351e5b332d954","533b9748e52f825f","ccdf0e35fdf1c489","5fb8cfa6a8a78f75","9723a7bfd47c8ac2"]]},{"id":"2f2c26ae052cbaaa","type":"debug","z":"cd80d9d7c33771f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":480,"wires":[]},{"id":"e241399d1a6f86c4","type":"hubitat command","z":"cd80d9d7c33771f4","deviceLabel":"UPS Argon One","name":"","server":"90e35fad.e75c1","deviceId":"55","command":"","commandArgs":"payload","x":820,"y":480,"wires":[["2f2c26ae052cbaaa"]]},{"id":"b934cd78ab3c8535","type":"change","z":"cd80d9d7c33771f4","name":"Battery Charge Status","rules":[{"t":"set","p":"command","pt":"msg","to":"battery","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.BCHARGE, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":380,"wires":[["4b4f91506bd976fd"]]},{"id":"0afb17be975c4432","type":"change","z":"cd80d9d7c33771f4","name":"Last Event Change","rules":[{"t":"set","p":"command","pt":"msg","to":"lastEvent","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.LASTXFER","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":420,"wires":[["5bddc7f11a23a043"]]},{"id":"ae4351e5b332d954","type":"change","z":"cd80d9d7c33771f4","name":"UPS status Change","rules":[{"t":"set","p":"command","pt":"msg","to":"status","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.STATUS","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":460,"wires":[["b45d8aa70185368b"]]},{"id":"5be35f9c1b996a52","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":80,"wires":[["35880977ed8dd157"]]},{"id":"b0c5c3539ff62255","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":160,"wires":[["35880977ed8dd157"]]},{"id":"e20d24728ce50385","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":120,"wires":[["35880977ed8dd157"]]},{"id":"4b4f91506bd976fd","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":380,"wires":[["e241399d1a6f86c4"]]},{"id":"5bddc7f11a23a043","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":420,"wires":[["e241399d1a6f86c4"]]},{"id":"b45d8aa70185368b","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":460,"wires":[["e241399d1a6f86c4"]]},{"id":"0ae6e16126347dcc","type":"change","z":"cd80d9d7c33771f4","name":"Current Time on Battery","rules":[{"t":"set","p":"command","pt":"msg","to":"lifetimeOnBattery","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.TONBATT, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":200,"wires":[["263e5eec28422949"]]},{"id":"263e5eec28422949","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":200,"wires":[["35880977ed8dd157"]]},{"id":"0496ab40929b11e1","type":"change","z":"cd80d9d7c33771f4","name":"Transfer to battery","rules":[{"t":"set","p":"command","pt":"msg","to":"lastPowerFail","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.XONBATT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":240,"wires":[["109307b195c83db2"]]},{"id":"109307b195c83db2","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":240,"wires":[["35880977ed8dd157"]]},{"id":"61ddc36d46522287","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":280,"wires":[["35880977ed8dd157"]]},{"id":"073eeed1dc8b7978","type":"change","z":"cd80d9d7c33771f4","name":"Transfer to Mains Power","rules":[{"t":"set","p":"command","pt":"msg","to":"lastPowerRestore","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.XOFFBATT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[["61ddc36d46522287"]]},{"id":"533b9748e52f825f","type":"change","z":"cd80d9d7c33771f4","name":"Current Time on Battery","rules":[{"t":"set","p":"command","pt":"msg","to":"lifetimeOnBattery","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.TONBATT, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":500,"wires":[["3f87720b687ce199"]]},{"id":"3f87720b687ce199","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":500,"wires":[["e241399d1a6f86c4"]]},{"id":"ccdf0e35fdf1c489","type":"change","z":"cd80d9d7c33771f4","name":"Transfer to battery","rules":[{"t":"set","p":"command","pt":"msg","to":"lastPowerFail","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.XONBATT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":540,"wires":[["032756c326d314ea"]]},{"id":"032756c326d314ea","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":540,"wires":[["e241399d1a6f86c4"]]},{"id":"bc613a8e8379e7ec","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":580,"wires":[["e241399d1a6f86c4"]]},{"id":"5fb8cfa6a8a78f75","type":"change","z":"cd80d9d7c33771f4","name":"Transfer to Mains Power","rules":[{"t":"set","p":"command","pt":"msg","to":"lastPowerRestore","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload.XOFFBATT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":580,"wires":[["bc613a8e8379e7ec"]]},{"id":"b0b78c85eebdce70","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":320,"wires":[["35880977ed8dd157"]]},{"id":"cc19b6d0d91695e5","type":"change","z":"cd80d9d7c33771f4","name":"Current Battery Voltage","rules":[{"t":"set","p":"command","pt":"msg","to":"batteryVoltage","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.BATTV, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":320,"wires":[["b0b78c85eebdce70"]]},{"id":"6fe3d51cb43dbdc4","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"arguments","x":630,"y":620,"wires":[["e241399d1a6f86c4"]]},{"id":"9723a7bfd47c8ac2","type":"change","z":"cd80d9d7c33771f4","name":"Current Battery Voltage","rules":[{"t":"set","p":"command","pt":"msg","to":"batteryVoltage","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"$number($split(payload.BATTV, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":620,"wires":[["6fe3d51cb43dbdc4"]]},{"id":"cceb0680fef5a58a","type":"debug","z":"cd80d9d7c33771f4","name":"Unraid Server Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":880,"wires":[]},{"id":"d27cda191dab4cdd","type":"change","z":"cd80d9d7c33771f4","name":"UPS Load Level","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$number($split(payload.LOADPCT, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":840,"wires":[["ce07845e5aa14c47"]]},{"id":"621ebcdd628465c7","type":"change","z":"cd80d9d7c33771f4","name":"Power used","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$round((($number($split(payload.LOADPCT, \" \")[0]))/100)*($number($split(payload.NOMPOWER, \" \")[0])), 2)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":880,"wires":[["ce07845e5aa14c47"]]},{"id":"079e1edc3e62ab4f","type":"change","z":"cd80d9d7c33771f4","name":"Time Left on Battery","rules":[{"t":"set","p":"topic","pt":"msg","to":"3","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$number($split(payload.TIMELEFT, \" \")[0])","tot":"jsonata"},{"t":"set","p":"complete","pt":"msg","to":"end","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":920,"wires":[["ce07845e5aa14c47"]]},{"id":"ce07845e5aa14c47","type":"join","z":"cd80d9d7c33771f4","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":860,"wires":[["8a4c910def7c4d46"]]},{"id":"8a4c910def7c4d46","type":"change","z":"cd80d9d7c33771f4","name":"","rules":[{"t":"set","p":"arguments","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"command","pt":"msg","to":"update","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":860,"wires":[["4edfd380fbbb0675"]]},{"id":"cb4d42bab094884b","type":"hubitat command","z":"cd80d9d7c33771f4","deviceLabel":"Unraid Battery Backup","name":"","server":"37a6fe31.441bc2","deviceId":"1108","command":"","commandArgs":"","x":860,"y":900,"wires":[["cceb0680fef5a58a"]]},{"id":"4edfd380fbbb0675","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":670,"y":900,"wires":[["cb4d42bab094884b"]]},{"id":"59777eb234cbfdf9","type":"debug","z":"cd80d9d7c33771f4","name":"Argon One Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1050,"y":760,"wires":[]},{"id":"ab85855887f94375","type":"change","z":"cd80d9d7c33771f4","name":"UPS Load Level","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$number($split(payload.LOADPCT, \" \")[0])","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":720,"wires":[["db0dd73ecf334c4a"]]},{"id":"8566f5776aadd55a","type":"change","z":"cd80d9d7c33771f4","name":"Power used","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$round((($number($split(payload.LOADPCT, \" \")[0]))/100)*($number($split(payload.NOMPOWER, \" \")[0])), 2)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":760,"wires":[["db0dd73ecf334c4a"]]},{"id":"8506a8f6404c6d1b","type":"change","z":"cd80d9d7c33771f4","name":"Time Left on Battery","rules":[{"t":"set","p":"topic","pt":"msg","to":"3","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$number($split(payload.TIMELEFT, \" \")[0])","tot":"jsonata"},{"t":"set","p":"complete","pt":"msg","to":"end","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":800,"wires":[["db0dd73ecf334c4a"]]},{"id":"db0dd73ecf334c4a","type":"join","z":"cd80d9d7c33771f4","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":740,"wires":[["7ce09c62c1f21028"]]},{"id":"7ce09c62c1f21028","type":"change","z":"cd80d9d7c33771f4","name":"","rules":[{"t":"set","p":"arguments","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"command","pt":"msg","to":"update","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":740,"wires":[["df47ba08b0772dcb"]]},{"id":"19674e807c34bcfb","type":"hubitat command","z":"cd80d9d7c33771f4","deviceLabel":"Unraid Battery Backup","name":"","server":"37a6fe31.441bc2","deviceId":"1108","command":"","commandArgs":"","x":860,"y":780,"wires":[["59777eb234cbfdf9"]]},{"id":"df47ba08b0772dcb","type":"rbe","z":"cd80d9d7c33771f4","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":670,"y":780,"wires":[["19674e807c34bcfb"]]},{"id":"e607f589ea71e5d5","type":"inject","z":"cd80d9d7c33771f4","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"statusJson","payloadType":"str","x":110,"y":680,"wires":[["15fa64c669d3d5f7","c37736e7e24a6152"]]},{"id":"c37736e7e24a6152","type":"apcrequest","z":"cd80d9d7c33771f4","name":"APC UPS on Unraid Server","server":"aded31d5.a078","x":160,"y":880,"wires":[["d27cda191dab4cdd","621ebcdd628465c7","079e1edc3e62ab4f"]]},{"id":"15fa64c669d3d5f7","type":"apcrequest","z":"cd80d9d7c33771f4","d":true,"name":"APC UPS on Argon ONE","server":"13fe8d9c.10e232","x":170,"y":760,"wires":[["ab85855887f94375","8566f5776aadd55a","8506a8f6404c6d1b"]]},{"id":"aded31d5.a078","type":"apcconfig","name":"Unraid","host":"192.168.86.10","port":"3551"},{"id":"37a6fe31.441bc2","type":"hubitat config","name":"Main Hub","usetls":false,"host":"192.168.86.35","port":"80","appId":"563","nodeRedServer":"http://192.168.86.10:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#ace043"},{"id":"13fe8d9c.10e232","type":"apcconfig","d":true,"name":"APC UPS on Argon One","host":"192.168.86.18","port":"3551"},{"id":"90e35fad.e75c1","type":"hubitat config","name":"HubitatC4","usetls":false,"host":"192.168.86.47","port":"80","appId":"6","nodeRedServer":"http://node-red:1880","webhookPath":"/hubitat/c4webhook_","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#ace043"}]

Below here is the code for the Virtual UPS device driver

/**
 *  Virtual UPS to recieve commands from Node-red 
 *
 *  Copyright 2016 
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
import groovy.json.JsonSlurper
metadata
{
    definition (name: "Virtual UPS", namespace: "mavrrick", author: "Mavrrick")
    {
        capability "Battery"
		capability "Voltage Measurement"
		capability "Power Source"
		capability "Power Meter"
//		capability "Timed Session"
		capability "Refresh"
		
		attribute "loadPercent", "number"
        attribute "model", "string"
		attribute "serial", "string"
		attribute "upsStatus", "string"
		attribute "batteryVoltage", "number"
		attribute "loadPercent", "number"
		attribute "timeOnBattery", "number"
		attribute "lifetimeOnBattery", "string"
		attribute "lowTransVolts", "string"
		attribute "highTransVolts", "string"
		attribute "nomPower", "string"
		attribute "sensitivity", "string"
		attribute "lastUpdate", "string"
		attribute "batteryDate", "string"
		attribute "lastPowerFail", "string"
		attribute "lastPowerRestore", "string"
		attribute "lastPowerFailReason", "string"
		attribute "batteryRuntime", "string"
		attribute "lastEvent", "string"
        attribute "battery", 							'NUMBER'
        
        command "status", [[name: 'Status data of UPS', type: 'STRING']]
        command "battery", [[name: "Battery Level", type: "NUMBER", description: "Battery Percent full(0 to 100)"]]
        command "loadPercent", [[name: "Percent Load of UPS", type: "NUMBER", description: "Load Capacity of UPS"]]
        command "lastEvent", [[name: "Last Event ", type: "STRING", description: "What occured at last event"]]
        command "lastPowerFail", [[name: "Transfer to Battery ", type: "STRING", description: "What occured at last event"]]
        command "lastPowerRestore", [[name: "Transfer to Main Power ", type: "STRING", description: "What occured at last event"]]
        command "power", [[name: "Power Used", type: "NUMBER", description: "Watts currently consumed"]] 
        command "timeOnBattery", [[name: "Battery runtime left", type: "NUMBER", description: "Time left to run on Battery"]]
        command "lifetimeOnBattery", [[name: "Current time on battery", type: "NUMBER", description: "Current time on battery"]]
        command "batteryVoltage", [[name: "Current battery voltage", type: "NUMBER", description: "Current battery Voltage"]] 
 /*       command "update", [[name: "Battery runtime left", type: "NUMBER", description: "Time left to run on Battery"],
                          [name: "Battery Level", type: "NUMBER", description: "Battery Percent full(0 to 100)"],
                          [name: "Percent Load of UPS", type: "NUMBER", description: "Load Capacity of UPS"],
                          [name: "Transfer to Battery ", type: "STRING", description: "What occured at last event"],
                          [name: 'Status data of UPS', type: 'STRING'],
                          [name: "Power Used", type: "NUMBER", description: "Watts currently consumed"],
                          [name: "Current time on battery", type: "NUMBER", description: "Current time on battery"],
                          [name: "Transfer to Battery ", type: "STRING", description: "What occured at last event"],
                          [name: "Transfer to Main Power ", type: "STRING", description: "What occured at last event"],
                          [name: "Current battery voltage", type: "NUMBER", description: "Current battery Voltage"]] */
        command "update", [[name: "Percent Load of UPS", type: "NUMBER", description: "Load Capacity of UPS"],
                          [name: "Power Used", type: "NUMBER", description: "Watts currently consumed"],
                          [name: "Battery runtime left", type: "NUMBER", description: "Time left to run on Battery"]]
                          
	}

	preferences
	{	
/*		section("Device")
		{
			input("ip", "string", title:"IP Address of apcupsd host system (Windows computer)", defaultValue: "192.168.nnn.nnn" ,required: true)		
			input("port", "number", title:"Port Number used by optional Windows EventGhost web server", defaultValue: 80, range: 1..65535, required: true)		
		}
		section
		{
			input "prefEventGhost", "bool", required: true, defaultValue: false,
				title: "ON: EventGhost is installed on Windows, enables commands Refresh and rebootWindows, and optional Hub controlled statistics updates<br />OFF (Default): Use Windows Task Scheduler for statistics, Refresh command disabled"
			if (prefEventGhost)
				input("prefRefreshMinutes", "number", title:"EventGhost update time in minutes, zero disables EventGhost updates, however Refresh is active. When using Windows Scheduler for updates, set to 0", defaultValue: 5, range: 0..20, required: true)		
		} */
		section
		{
			input "enableDebug", "bool", title: "Enables debug logging for 30 minutes", defaultValue: false, required: false
		}
	}
}


def installed()
{
	log.info "UPS Virtual Driver is loaded. Waiting for updates from Node Red"
	settingsInitialize()
	refresh()
}


def updated()
{
	log.info "UPS Virtual Driver is loaded. Waiting for updates from Node Red"
	settingsInitialize()
	refresh()
}


def settingsInitialize()
{
    unschedule()

	if (enableDebug)
	{
		log.info "Verbose logging has been enabled for the next 30 minutes."
		runIn(1800, logsOff)
	}
}

//	runs when HUB boots, starting the device refresh cycle, if any
void initialize()
	{
	log.info "UPS Virtual Drivers is restarting"
	refresh()
	}

/*
    Set battery level
*/
def battery(parm){
    sendEvent(name: "battery", value: parm)
    }

/* 

/*
    Set UPS Load level
*/
def loadPercent(parm){
    sendEvent(name: "loadPercent", value: parm)
    }

/* 

/*
    Set Last Event
*/
def lastEvent(parm){
    sendEvent(name: "lastEvent", value: parm)
    }

/* 

/*
    Set Status of UPS Device
*/
def status(parm){
    sendEvent(name: "upsStatus", value: parm)
    }
 

/*
    Set Watts Used
*/
def power(parm){
    sendEvent(name: "power", value: parm)
    }
 

/*
    Set Time left on Battery
*/
def timeOnBattery(parm){
    sendEvent(name: "timeOnBattery", value: parm)
    }
 

/*
    Set Time left on Battery
*/
def lifetimeOnBattery(parm){
    sendEvent(name: "lifetimeOnBattery", value: parm)
    }


/*
    Set Time left on Battery
*/
def lastPowerFail(parm){
    sendEvent(name: "lastPowerFail", value: parm)
    }


/*
    Set Time left on Battery
*/
def lastPowerRestore(parm){
    sendEvent(name: "lastPowerRestore", value: parm)
    }


/*
    Set current battery voltage
*/
def batteryVoltage(parm){
    sendEvent(name: "batteryVoltage", value: parm)
    }

/*
    Set current battery voltage
*/
def update( loadPerc, watts, timeOnBat ){
//    sendEvent(name: "battery", value: batlevel)
    sendEvent(name: "loadPercent", value: loadPerc)
//    sendEvent(name: "lastEvent", value: lastEvt)
//    sendEvent(name: "upsStatus", value: upsStat)
    sendEvent(name: "power", value: watts)
    sendEvent(name: "timeOnBattery", value: timeOnBat)
//    sendEvent(name: "lifetimeOnBattery", value: lifetimeOnBat)
//    sendEvent(name: "lastPowerFail", value: lastPowerF)
//    sendEvent(name: "lastPowerRestore", value: lastPowerRest)
//    sendEvent(name: "batteryVoltage", value: batteryVolt)
    }



/*
	logsOff
    
	Disables debug logging.
*/
def logsOff()
{
    log.warn "debug logging disabled..."
	device.updateSetting("enableDebug", [value:"false",type:"bool"])
}
1 Like

If you have a Linux server or Synolgy NAS connected to your UPS, you can integrate NUT with Hubitat.

1 Like

I've decided on a different approach at the moment. I just grabbed a cheaper CyberPower UPS, and using IP Monitoring to monitor lan device for power outage, and then I can guestimate remaining time. Not super accurate, but enough for me to trigger hub shutdown, or record an outage.

Edit: Sorry Cyberpower not Eaton.

1 Like

I have a couple of cyberpowers (SOHO series) monitored by NUT on my pi 4. (the APC/Eatons that I tested - admittedly many years ago - gave off an annoying hum in use. The cyberpowers were dead silent except when actually running on battery or charging from less than 100%. )

If the APC has a USB B port it will be able to communicate its status (NUT does support APC). The status (battery level/online/mains voltage) is read by node-red which has a NUT node and then sent to HE.

2 Likes

Aye, the CyberPower is nice and quiet. I've got a small one of them, got the brand wrong above.

Thanks guys. Apart from having been interested in stepping into this space for a while, I had noticed that some of the APC UPS' were on special over here. I have ordered two of these at 25% off (2 x $173)

1 Like

Does that have a built in network card or will you be using the USB port?

From what I've read it has protection for an ethernet connection, but I assume that does not nessecarily mean you can communicate using it via that.

Yeah I meant for the communications interface. I have several APC 750va's that I have the com card in (the cards are pretty cheap on ebay) so I use the LGK driver for them. Works well. I'm looking forward though to @dJOS 's UPS that he's putting together. I don't know if you've read the this thread but this is what he is building with a couple of mods... DIY- Battery Backup Hubitat- under TEN bucks-NO soldering - #296 by rlithgow1

3 Likes

yep - surge protection only. All comms are done via the USB port.

1 Like

looks different than us models, but i have not had good luck with the back ups us models.. either noisy or battery works and only fails with no warning during load ie when wine fridge kicks in.. even if it is not drawing more than the rated watts.

that is why now i only get the smt1500 models, replacement batteries myself every couple of years or when it tells me during the self test.. Those do not seem to fail without warning under load.

also at least in usa you can get the network cards for them reasoneable on ebay for around 40-50 bucks with an offer.. My telnet based driver works for these network cards to get the relatvant info. apc 9630 or 9631 work well.

ie

hopefuly the au models of the backups works better than the us ones...

if you can find an smt1500i cheap/resoneable and add your own batteries and net card i hightly recommend it. i have about 10 between 3 houses.

The problem with this for me is i need a regular outlet in my ups as almost all of my devices i use them for has a kasa/tplink wifi or zwave/zibee switch on it.. The ones for my main network on a backup att access point network.

i like the kasa as they remember state if the ups ever really shuts down with a long power outage and come back in the last state.. many switches i tried do not.. One house is empty and i need to be able to reboot stuff like the hub and wifi etc remotely if they freeze up etc.

Recently i had my main private ip wifi router freeze up .. now i have a spare i can kick in.. but since that is my default gateway I also now had to put all my network switches on a kasa/wifi switch on the backup att network as when i kick in the backup main wifi router the default gateway ip stays the same but the nic address changs and nothing works if the switches are not rebooted.. Way too fricking complicated.

I hope they perform as well. I looked at the SMT models, but at least on Amazon there aren't any available below $1K, about 5x what I paid for the back model. I'm sure there are other options in that SMT range that may become available, or I could look elshewhere, but for now I am happy to give this a go.

1 Like

Hi @mavrrick58,

I noticed the reference to EventGhost in your UPS driver. What are you using that for, or what does this cater for? I've started using EventGhost on my laptop.

Trust a storm to be rolling through while my UPS is in transit.... No issues yet, so here's hoping it stays that way....

1 Like

Let us know if it's silent during use. I probably wouldn't mind getting another UPS :slightly_smiling_face:

Will do.

By use are you referring to when I am running on battery, e.g. during a blackout? From what I've seen I am expecting a "hum" when running on battery and when running the regular test. At least before receiving it, that doesn't bother me too much, if nothing else it's an indicator of the fact you are operating on battery, but I guess I'll find out soon enough.