Giter Site home page Giter Site logo

Comments (16)

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

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.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

What does your config.json look like? Is the host entry updated/accurate? Did the test script work?

from homebridge-nut.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

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.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

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.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

@drgonz0 what does your ups.conf file show for the ups section? Do you also have a “desc” entry?

from homebridge-nut.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

@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.

drgonz0 avatar drgonz0 commented on August 9, 2024

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.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

@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.

drgonz0 avatar drgonz0 commented on August 9, 2024

Just wanted to confirm that this did in fact work for me. Thank you for following up on this.

from homebridge-nut.

ToddGreenfield avatar ToddGreenfield commented on August 9, 2024

Glad to hear.

from homebridge-nut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.