Comments (16)
Are you able to verify the ups client is actually running? Can you run “upsc” with your friendly-name like “upsc myups” and see the values?
Are you able to run the plugin test script? Try running “node test” from the plugins directory.
from homebridge-nut.
It's running on a separate host, but If I run upsc ups@hosname I get output.
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2011/11/07
battery.runtime: 822
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Back-UPS XS 1500G
device.serial: 4B1146P05399
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen2.2
driver.parameter.synchronous: no
driver.version: 2.7.3
driver.version.data: APC HID 0.95
driver.version.internal: 0.39
input.sensitivity: medium
input.transfer.high: 139
input.transfer.low: 88
input.transfer.reason: input voltage out of range
input.voltage: 120.0
input.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 866.L6 .D
ups.firmware.aux: L6
ups.load: 38
ups.mfr: American Power Conversion
ups.mfr.date: 2011/11/07
ups.model: Back-UPS XS 1500G
ups.productid: 0002
ups.realpower.nominal: 865
ups.serial: 4B1146P05399
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d
from homebridge-nut.
What does your config.json look like? Is the host entry updated/accurate? Did the test script work?
from homebridge-nut.
The test script doesn't work. Here's my config.json
"platform": "Nut",
"name": "Nut",
"host": "10.0.65.82",
"port": "3493",
"search_time_delay": "1",
"low_batt_threshold": "40",
"polling": "120"
from homebridge-nut.
What is the output of the test script? Be sure to change the 2nd line to replace "localhost" with your nut server IP. Also, what does the MONITOR entry of your upsmon.conf file show? The error you are getting is from the underlying library. I tried to replicate but could not. I did verify again that the plugin works from a remote server (a nut-client), so I am not sure what the problem could be.
from homebridge-nut.
The error is basically the same. As I'm getting on the homebridge-nut client. I get this same error on a raspberry pi, and a Mac that's also a functioning nut slave. The PI is my homebridge server, but I tested to see if I got the same response on the Mac.
node test.js
/usr/local/lib/node_modules/homebridge-nut/node_modules/node-nut/node-nut.js:71
vars[matches[1]] = matches[2];
^
TypeError: Cannot read property '1' of null
at parseKeyValueList (/usr/local/lib/node_modules/homebridge-nut/node_modules/node-nut/node-nut.js:71:16)
at Nut.parseFunc (/usr/local/lib/node_modules/homebridge-nut/node_modules/node-nut/node-nut.js:87:3)
at Socket. (/usr/local/lib/node_modules/homebridge-nut/node_modules/node-nut/node-nut.js:33:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:543:20)
here's my upsmon.conf MONITOR line.
MONITOR [email protected] 1 upsmon PASSWORD slave
from homebridge-nut.
Interesting note. If I put in bad host information I get a completely different error. So I think this is getting something returned from my UPS that it doesn't' like.
Nut eventError received - Error: getaddrinfo ENOTFOUND ups.localbad ups.localbad:3493.f
from homebridge-nut.
I was thinking the same thing. I suggest trying to run the example from https://github.com/skarcha/node-nut (page bottom) directly from a node prompt and see where it breaks. That will help us better figure out what it doesn't like. I can also open an issue with skarcha and ref this issue-
from homebridge-nut.
Same Property 1 error it seems, presents slightly differently. Doesn't break in exactly what its erring out on. I see you opened the issue on the node-nut page. Thank you.
TypeError: Cannot read property '1' of null
at parseKeyValueList (/usr/lib/node_modules/node-nut/node-nut.js:71:16)
at Nut.parseFunc (/usr/lib/node_modules/node-nut/node-nut.js:87:3)
at Socket. (/usr/lib/node_modules/node-nut/node-nut.js:33:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at TCP.onread (net.js:561:20)
Connection closed.
from homebridge-nut.
@drgonz0 what does your ups.conf file show for the ups section? Do you also have a “desc” entry?
from homebridge-nut.
What does "upsc -L" show as well? Would like to verify you have a valid ups name being returned by the nut server.
from homebridge-nut.
@drgonz0 one last request - Try this command in your NUT server console, or change "localhost" with your server IP and/or 3493 with your NUT server port:
echo "LIST UPS" | nc localhost 3493
And post the response here please.
from homebridge-nut.
Sorry for the late reply, I've been on the road. Your 3 questions answered here.
Thanks.
ups.conf shows empty "" for desc
upsc -L
ups:
echo "LIST UPS" | nc localhost 3493
BEGIN LIST UPS
UPS ups ""
END LIST UPS
from homebridge-nut.
@drgonz0 Update to the latest version. This should be resolved now. The problem was due to the ups.conf having no description. The underlying package was fixed, as well as validation checking in this plugin. If no description is available, the actual name is used - in your case it will show up as "Ups".
from homebridge-nut.
Just wanted to confirm that this did in fact work for me. Thank you for following up on this.
from homebridge-nut.
Glad to hear.
from homebridge-nut.
Related Issues (20)
- Homebridge isn't connecting to home app if I add this to my config HOT 5
- Remote Monitoring HOT 5
- build error with node v8.2.1 HOT 18
- FYI: the apcupsd plugin
- QUERY: why Contact Sensor rather than Motion Sensor HOT 2
- Report power usage
- Notification not correctly supported
- Occasional Error in the log.
- Warning to developer with Homebridge 1.0.0
- Freezings with Homebridge 1.0
- Plugin 'homebridge-nut' tried to register with an incorrect plugin identifier: 'homebridge-nut-accessory'. Please report this to the developer! HOT 4
- Error: connect ECONNREFUSED 127.0.0.1:3493
- Not working with homebridge 1.30 HOT 7
- UPS not showing as a Power Point in HomeKit
- Constant Reconnects HOT 8
- Missing parameters HOT 7
- Eaton Protection Station support HOT 4
- Voltage, Freq from UPS HOT 2
- Error: This callback function has already been called by someone else; it can only be called one time. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-nut.