APC Network Connected Power

Hi, has anyone written or come across a plug-in to connect THR to an APC network connected device power device? They have telnet/ssh/snmp capabilities so hoping someone has already done this.

Example unit:

Thanks in advance!

use TCPClient

for example

plugin.Name = "UPSPlugin";
plugin.OnChangeRequest = onChangeRequest;
plugin.OnConnect = onConnect;
plugin.OnDisconnect = onDisconnect;
plugin.OnPoll = onPoll;
plugin.OnSynchronizeDevices = onSynchronizeDevices;
plugin.PollingInterval = 0;
plugin.DefaultSettings = { "Host": "", "Port": "3551" };  

var tcp = new TCPClient();
var tcpDeviceId = "apcupsd";

then send status command

function onPoll() {
    while (true) {
    	  tcp.send([0x00, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73]);
          var data = tcp.receive();
          console.log("message received" + data);

and wow

just parse response as string

i hope that’s can help you!


Great, thanks. I’ve taken what you’ve got and started applying it to the device I have which is a power strip. Getting there and will send you what I end up with.