denniedegroot / com.apc.ups

Connect apcupsd with Homey
https://www.athom.com/
MIT License
0 stars 3 forks source link

Smart-UPS 1500 (SMT1500I) #6

Open Goliath2000 opened 5 years ago

Goliath2000 commented 5 years ago

Hi I wonder if my APC UPS with following model Smart-UPS 1500 (SMT1500I) is supported by this app in Homey? Because I cant find my device when I try to install it.

denniedegroot commented 5 years ago

Well every unit should be supported if its supported by the apcupsd tool. Note that the ups does not directly interfaces with Homey but via apcupsd.

Goliath2000 commented 5 years ago

Well every unit should be supported if its supported by the apcupsd tool. Note that the ups does not directly interfaces with Homey but via apcupsd.

Thanks for your reply! Then its really strange that it wont find my APC UPS. apcupsd tool is up and running and I can access it through SSH. The webinterface is also up and running. I have also used exactly same port in the config file.

denniedegroot commented 5 years ago

Can you run this app via the console and give me the output?

Goliath2000 commented 5 years ago

I don’t know how to do it. When you say via the console you mean From where I run apcupsd? How do I run this app? What’s the command?

denniedegroot commented 5 years ago

https://apps.developer.athom.com/tutorial-Getting%20Started.html

Goliath2000 commented 5 years ago

https://apps.developer.athom.com/tutorial-Getting%20Started.html

thanks dennie, I will do this during the weekend and get back to you!

Goliath2000 commented 5 years ago

Hi Dennie,

This is was what I got when I tried to connect my APC UPS.

─────────────── Logging stdout & stderr ─────────────── com.apc.ups running... 2019-09-28 15:27:19 [log] [ManagerDrivers] [ups] onPair 2019-09-28 15:27:46 [log] [ManagerDrivers] [ups] _onPairSearchDevices { ip: '192.168.1.12', port: '3551' } _getDevice 192.168.1.12 3551 2019-09-28 15:27:46 [err] [ManagerDrivers] [ups] { Error: connect ECONNREFUSED 192.168.1.12:3551 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '192.168.1.12', port: 3551 } 2019-09-28 15:27:46 [log] [ManagerDrivers] [ups] _onPairListDevices

denniedegroot commented 5 years ago

ECONNREFUSED Means that it cannot connect to apcupsd on that ip and port. On which OS are you running apcupsd?

Goliath2000 commented 5 years ago

Could it be because i have HTTPS enabled? On the other hand I have HTTP also active. I run apcupsd on 12.0-RELEASE-p6 FreeBSD 12.0-RELEASE-p6 GENERIC amd64

Goliath2000 commented 5 years ago

and here is part of my config file:

#
# ==== Configuration statements for Network Information Server ====
#

# NETSERVER [ on | off ] on enables, off disables the network
#  information server. If netstatus is on, a network information
#  server process will be started for serving the STATUS and
#  EVENT data over the network (used by CGI programs).
NETSERVER on

# NISIP <dotted notation ip address>
#  IP address on which NIS server will listen for incoming connections.
#  This is useful if your server is multi-homed (has more than one
#  network interface and IP address). Default value is 0.0.0.0 which
#  means any incoming request will be serviced. Alternatively, you can
#  configure this setting to any specific IP address of your server and
#  NIS will listen for connections only on that interface. Use the
#  loopback address (127.0.0.1) to accept connections only from the
#  local machine.
NISIP 0.0.0.0

# NISPORT <port> default is 3551 as registered with the IANA
#  port to use for sending STATUS and EVENTS data over the network.
#  It is not used unless NETSERVER is on. If you change this port,
#  you will need to change the corresponding value in the cgi directory
#  and rebuild the cgi programs.
NISPORT 3551
denniedegroot commented 5 years ago

That is very weird. With a default config it should work instantly. Maybe the port is blocked by a firewall in your setup?

Goliath2000 commented 5 years ago

That is very weird. With a default config it should work instantly. Maybe the port is blocked by a firewall in your setup?

You are right! I tried to Check open port on my APC UPS and I found that 3551 didnt responde. Any Idea how to open that port?

the only response I got was 21 23 80 443

denniedegroot commented 5 years ago

You must connect to the computer running apcupsd. The ups must be connected with usb to that computer. You cannot access it directly on the ups.

Goliath2000 commented 5 years ago

Oh I See. I Will buy a USB cable and test. Thanks for your support.

Goliath2000 commented 5 years ago

Hi Dennie, It took me a while to get USB cable. Now I have connected the UPS with USB cable to my freebsd computer and its up and running but I still get same error :(

apcaccess status APC : 001,027,0665 DATE : 2019-10-13 20:09:28 +0200 HOSTNAME : Server VERSION : 3.14.14 (31 May 2016) freebsd UPSNAME : UPS-1500VA CABLE : USB Cable DRIVER : USB UPS Driver UPSMODE : Stand Alone STARTTIME: 2019-10-13 20:09:24 +0200 MODEL : Smart-UPS 1500 STATUS : ONLINE BCHARGE : 100.0 Percent TIMELEFT : 65.0 Minutes MBATTCHG : 10 Percent MINTIMEL : 5 Minutes MAXTIME : 0 Seconds ALARMDEL : 30 Seconds BATTV : 27.0 Volts NUMXFERS : 0 TONBATT : 0 Seconds CUMONBATT: 0 Seconds XOFFBATT : N/A STATFLAG : 0x05000008 MANDATE : 2012-05-21 SERIALNO : **** NOMBATTV : 24.0 Volts FIRMWARE : UPS 09.4 / ID=18 END APC : 2019-10-13 20:09:28 +0200

denniedegroot commented 5 years ago

That looks good to me. You really need to check if apcupsd is accessible on the port and ip number you fill in. Maybe a firewall is blocking the port.

Goliath2000 commented 5 years ago

That looks good to me. You really need to check if apcupsd is accessible on the port and ip number you fill in. Maybe a firewall is blocking the port.

is it some firewall setting within the APC UPS that I have to do? Because I'm pretty sure its not my router blocking.

denniedegroot commented 5 years ago

No you need to connect to your Linux computer. So you need to fill in the IP of your computer running apcupsd not the APC.

APC -> USB -> Computer< ----- > Homey APC App

Goliath2000 commented 5 years ago

No you need to connect to your Linux computer. So you need to fill in the IP of your computer running apcupsd not the APC.

APC -> USB -> Computer< ----- > Homey APC App

oh nooo! I have been trying to connect to the APC IP address all the time!

Goliath2000 commented 5 years ago

Dennie thanks a lot for your support. Dont know why I was trying to connect to the APC Ip instead of my FreeBSD Server. Btw, "Ethernet Link" works fine as well no need of having USB cable. Would it be easy to add all the other paramaters that shows up in APC app in homey? Like this list here below:

APC : 001,045,1080 DATE : 2019-10-16 23:45:18 +0200 HOSTNAME : Server VERSION : 3.14.14 (31 May 2016) freebsd UPSNAME : UPS-1500VA CABLE : Ethernet Link DRIVER : PCNET UPS Driver UPSMODE : Stand Alone STARTTIME: 2019-10-16 23:45:15 +0200 MODEL : Smart-UPS1500 STATUS : ONLINE LINEV : 227.5 Volts LOADPCT : 16.2 Percent BCHARGE : 100.0 Percent TIMELEFT : 68.0 Minutes MBATTCHG : 10 Percent MINTIMEL : 5 Minutes MAXTIME : 0 Seconds MAXLINEV : 227.5 Volts MINLINEV : 227.5 Volts OUTPUTV : 228.9 Volts DWAKE : 0 Seconds DSHUTD : 0 Seconds DLOWBATT : 2 Minutes ITEMP : 32.4 C ALARMDEL : Always BATTV : 27.0 Volts LINEFREQ : 50.0 Hz LASTXFER : Line voltage notch or spike NUMXFERS : 1 XONBATT : 2019-10-17 17:07:59 +0200 TONBATT : 0 Seconds CUMONBATT: 27 Seconds XOFFBATT : 2019-10-17 17:08:26 +0200 SELFTEST : OK STESTI : 336 STATFLAG : 0x05000008 REG1 : 0x00 REG2 : 0x00 REG3 : 0x00 MANDATE : 05/21/2012 SERIALNO : **** BATTDATE : 06/15/2019 NOMOUTV : 230 Volts FIRMWARE : UPS 09.4 (ID18) END APC : 2019-10-17 17:50:25 +0200

denniedegroot commented 5 years ago

What parameters are interesting to you? Most of them dont provide usefull information I think.

Goliath2000 commented 5 years ago

What parameters are interesting to you? Most of them dont provide usefull information I think.

Well you can do a lot of fun things if you can get more parameters. Like CUMONBATT to check how many seconds you have had a power failure or just take the time stamp when it happeneds with XONBATT or XOFFBATT.

SELFTEST is also another good parameter to check health of your UPS.

ITEMP to check internal temp of your UPS

LASTXFER to get an indication what last power failure was. if it was voltage drop or just a glitch or spike.

Goliath2000 commented 5 years ago

LOADPCT is also another paramter that can be useful.

Patrick1610 commented 4 years ago

Hi @Goliath2000 I am looking for some help on setting apcuspd over the network on a Ubuntu machine. Do you happen to have some interessting input on how to set this up? Or have you done this another way?