@vectronic/homebridge-nut v2.4.6
homebridge-nut
A NUT (Network UPS Tools) Plugin for Homebridge leveraging node-nut.
This plugin allows you to monitor multiple UPS devices with HomeKit via a NUT Client.
NOTE: This is re-write of https://github.com/ToddGreenfield/homebridge-nut to avoid usage of system-sleep and
deasync module dependencies which end up relying on native code. I was having problems with these blocking the
Node event loop (possibly due to running on FreeBSD). I also wanted to avoid the need of having to do native code rebuilds...
Installation
- Install Homebridge using:
npm install -g homebridge - Install this plugin using:
npm install -g @vectronic/homebridge-nut - Update your configuration file. See a sample
config.jsonsnippet below. - Ensure you have a NUT Client running somewhere.
This plugin will create an accessory for each UPS returned from the NUT Client.
The accessory will have a ContactSensor service and a BatteryService.
The ContactSensor will have the following characteristics:
ContactSensorStatewill be open if UPS Status starts withOB(On Battery).StatusActivewill be true if UPS Load is greater than 0.StatusFaultwill be true if NUT is not reachable.
The BatteryService will have the following characteristics:
BatteryLevelwill show the battery charge percentage.ChargingStatewill show Charging, Not Charging (online and 100% battery charge), or Not Chargeable (on battery).StatusLowBatterywill be true ifBatteryLevelis belowlow_batt_threshold.
Configuration
Example config.json entry:
"platforms": [
{
"platform": "Nut",
"name": "Nut",
"host": "localhost",
"port": 3493,
"username": "foo",
"password": "bar",
"low_batt_threshold": 40,
"poll_interval": 60,
"connect_interval": 5,
"command_interval": 1,
"ups_key_excludes": [
"foo",
"bar"
],
"disable_battery_service": false
}
]Where the following properties are all optional:
nameis the name used for Homebridge logging. Default isNut.hostis the IP or hostname for the Nut Client. Default islocalhost.portis the port for the Nut Client. Default is3493.usernameis the username to use for Nut Client authentication.passwordis the password to use for Nut Client authentication.low_batt_thresholdis the battery level percentage at which to set the Low Battery Status to true. Default is40.poll_intervalis the UPS polling interval in seconds. Default is60.connect_intervalis the NUT client connection attempt interval in seconds. Default is5.command_intervalis the NUT client delay interval between success requests in seconds. Default is1.ups_key_excludesis a list of Nut configured UPS keys which should be ignored.disable_battery_serviceis optional and should almost always befalsewhich is the default. In rare circumstances where your UPS is not fully supported by NUT you may wish to disable this.
Help etc.
If you have a query or problem, raise an issue in GitHub, or better yet submit a PR!
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago