vectronic / homebridge-nut

Homebridge plugin for NUT (Network UPS Tools) Client
19 stars 3 forks source link
homebridge homebridge-plugin nut

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

  1. Install Homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g @vectronic/homebridge-nut
  3. Update your configuration file. See a sample config.json snippet below.
  4. 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:

The BatteryService will have the following characteristics:

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:

Help etc.

If you have a query or problem, raise an issue in GitHub, or better yet submit a PR!