Giter Site home page Giter Site logo

homebridge-nut's Introduction

homebridge-nut

A NUT (Network UPS Tools) Plugin for Homebridge leveraging node-nut.

This plugin allows you to monitor a single UPS 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). Also I wanted to avoid the need of having to do native code rebuilds...

NOTE: This implementation only supports a single UPS as this is sufficient for my needs and simplified the code somewhat...

Installation

  1. Install Homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g git+https://github.com/vectronic/homebridge-nut.git
  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 the first UPS returned from the NUT Client.

The accessory will have a ContactSensor service and a BatteryService.

The ContactSensor will have the following characteristics:

  • ContactSensorState will be open if UPS Status starts with OB (On Battery).
  • StatusActive will be true if UPS Load is > 0.
  • StatusFault will be true if NUT is not reachable.

The BatteryService will have the following characteristics:

  • BatteryLevel will show the battery charge percentage.
  • ChargingState will show Charging, Not Charging (Online and 100% battery charge), or Not Chargeable (On Battery).
  • StatusLowBattery will be true if BatteryLevel is below low_batt_threshold.

Configuration

Example config.json entry:

"platforms": [
  {
    "platform": "Nut",
    "host": "localhost",
    "port": 3493,
    "low_batt_threshold": 40,
    "poll_interval": 60
  }
]

Where:

  • host is the IP or hostname for the Nut Client. Default is localhost.
  • port is the port for the Nut Client. Default is 3493.
  • low_batt_threshold is the battery level percentage at which to set the Low Battery Status to true. Default is 40.
  • poll_interval is the UPS polling interval in seconds. Default is 60.

homebridge-nut's People

Contributors

caribsky avatar jsmeyers avatar softlion avatar toddgreenfield avatar vectronic avatar

Watchers

 avatar  avatar  avatar

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.