/homebridge-http-battery-soc

Homebridge plugin for exposed Battery Service

Primary LanguageJavaScriptISC LicenseISC

homebridge-http-battery-soc

Description

This homebridge plugin was inspired by (https://github.com/dhop90/homebridge-http-esp8266-battery) and based on the homebridge examples. This plugins exposes a web-based battery status to Apple's HomeKit. Using simple HTTP requests, the plugin displays the current SOC (State Of Charge) of a connected AGM battery.

Installation

  1. Install homebridge
  2. Install this plugin: npm install -g homebridge-http-battery-soc
  3. Update your config.json file

Configuration

"accessories": [
     {
       "accessory": "esp8266Battery",
       "name": "esp8266Battery",
       "apiroute": "http://192.168.x.x,
       "pollInterval": 300,   //default (optional)
       "timeout": 10000       //default (optional)
     }
]

Config

Key Description Default
accessory Must be accessory N/A
name Name to appear in the Home app N/A
apiroute Root URL of your device N/A
pollInterval Time (in seconds) between device polls 300
timeout Time (in milliseconds) until the accessory will be marked as Not Responding if it is unreachable 10000

Response

Example of expected response for 50% State Of Charge (SOC)

{
    "charge": 50
}