kuestess / homebridge-platform-insteonlocal

Homebridge platform plugin for local Insteon control
Other
76 stars 26 forks source link
homebridge insteon insteon-hub

Support via PayPal

homebridge-platform-insteonlocal

Homebridge platform plugin for local Insteon control

See CHANGELOG.

Note: When upgrading from any prior version of the plugin to version 0.5.0 or greater, you will need to re-add your devices and rebuild existing automations. This is a one-time thing and is not a bug.

Overview

Implements local control of Insteon devices including switches, dimmers, outlets, fans, blinds, scenes, iolincs (configured as a garage door), motion sensors, door/window sensors, and leak sensors via Homebridge. Leverages home-controller to enable control and status of multiple Insteon devices. Supports both Insteon Hub 2242 and 2245 and now has beta support for running directly on a Hub Pro (thanks to @rasod).

Devices can be auto-discovered via the Insteon UI (see below) and automatically added to the homebridge config.json with the most approproate device type. On the 'Devices' tab, select the 'Devices Action' menu. If you have not already, click on 'Get Devices' to pull devices from the Hub/PLM. Once that completes, you can click 'Add All to Config' which will add all devices to your config. Alternately, you can add a single device to the config by clicking the 'Add to Config' button on the device page after selecting an individual device.

Supported devices include: dimmers (including i3), lightbulbs, on/off switch, keypads (6 or 8 button config and i3), on/off and dimmer outlets, remotes, iolinc, motion sensor, leak sensor, door sensor, smoke detector, fan controller, micro module, and thermostat.

Supported controllers include: Hub1 (2242), Hub2 (2245), Hub Pro, PLM

Install

To install from npm:

npm -g install homebridge-platform-insteonlocal

Alternately, clone the repository, cd into the cloned directory and install using npm:

npm -g install

Configuration

Edit the config.json (see example) to fit your installation - configuration parameters are:

Devices are also defined in the config.json as follows:

Battery operated devices: Battery status is monitored for battery operated devices (leak, motion, door/window sensors) and will alert when the device sends a low battery signal. The heartbeat for those devices is also monitored (sent from device every 24 hours). You will also receive a low battery alert if no heartbeat is received within 24 hours.

Scenes: Scenes remain on/off only and support status when controlled via a Keypadlinc. Scenes are configured using additional the parameters below:

Target Keypad LED: By Insteon's design, keypad (scene button) LED follows the state of a linked scene only; it does not act according to the device state itself. eg. Turn on scene 1 then the corresponding keypad LED lights up, but turning on Light 1 directly will not light up the keypad LED. This enhancement allows you to specify which keypad LED(s) to set according to the device state; effetively turning keypad buttons into true device status indicators that many had wished for. For the following example, when Light 1 "XXYYZZ" is turned on (or at any dim level), button "A" of the 6-button keypad "AABBCC" is lit up, as do button "D" of the 8-button keypad "BBCCDD".

  "name" : "Light 1",
  "deviceID" : "XXYYZZ",
  "targetKeypadID" : [ "AABBCC", "BBCCDD" ],
  "targetKeypadBtn" : [ "A", "D" ],
  "targetKeypadSixBtn" : [ true, false ]

Fanlinc support: To configure fanlinc support, use the 'fan' device type. This will create a fan device only - you can add a separate entry in your config (using the same deviceID) to add the light as a device.

In addition to scenes as described above, keypads are supported as on/off switches intended to be used in Homekit automation and/or scenes.

For iolinc devices, there is an additional parameter that can be defined:

Remote support: Remotes are supported as on/off switches or stateless switches intended to be used in Homekit automation and/or scenes. Both 8-button and 4-button remotes are supported. Additional parameters that should be used when defining a Remote device are:

Outlet support: On/off outlets are supported with independent control over each outlet (each is defined as an individual device). Additional parameters that should be used when defining an outlet are:

Battery operated devices: Low battery levels are reported periodically by the device and by default are shown in the Home app UI. To disable low battery reporting, use the optional configuration parameter below. This should be set at the individual device level. Even with low battery status disabled, you will still get a low battery alert in the Home app if two heartbeat messages from the device are missed (takes ~2 days), likely indicating a dead device.

Contact sensors:

InsteonUI

Introducing InsteonUI, a new way to manage your Insteon devices and InsteonLocal configuration. Think of it as 'Houselinc' in a browser.

InsteonUI Quick Start

Direct your browser to the host that you have Insteonlocal running on and the port configured in your config.json (ie, 127.0.0.1:3000 if running on the local machine). Before using any of the pages described below, you will need to complete the following steps:

  1. Click on the 'Hub' link. In the top section of the page, click 'Get Hub Info'. This pulls information from the Hub, most notably the Insteon ID.
  2. Still on the 'Hub' page, click 'Get Devices/Links' under the action menu.

You should now have devices populated on the 'Devices' page, and be able to link/unlink devices from the Hub, as well as create scenes.

To create a scene, select the desired device from the dropdown list and fill out the level, ramp rate, and controller/responder fields. The group number defaults to 1 for most devices. For a keypad, the group number corresponds to the button number (ie, A=1, B=2, C=3, etc). If the Hub is a controller, select an unoccupied group number (one that does not currently have a scene defined) or you will overwrite an existing scene.

All information for your Hub and devices is stored in insteon.json saved in your homebridge config directory. It is fully readable json, and can be viewed in any editor.

Express Server

This plugin will set up a local Express server at the port specified in your config.json (see below) that can also be accessed via a browser to get or manipulate Insteon device status and view hub or device information. Endpoints for the Express sever include:

The Express server is now optional and can be disabled if desired.

Connection Watcher

The Insteon Hub seems to give up on connections after a certain period of time, resulting in no response or incorrect status in Homekit. Starting with v0.3.4, a connectionWatcher will periodically reset the connection to the Hub. This is a temporary workaround, but seems to address the issue and create a better experience without having to restart homebridge. The default connection reset duration is 1 hour and can be customized or disabled in you config as follows:

For model 2242 hubs, the Connection Watcher wil determine if a request is in progress and, if not, close the connection. This model of hub seems particularly sensitive to connection duration/number of connections, so this will effectively spare connections as much as possible an only create them on-demand. The downside is that the eventListener will not function (as it requires a persistent connection), however polling will still update device status.

Using The HubPro Model 2243 (Beta)

It is possible to use the official Insteon HubPro as a complete homebridge server and Insteon Hub. This requires flashing the HubPro and installing homebridge as normal. Inside the HubPro is a BeagleBoard Black Computer and a Power Line Modem connected via a serial connection.

  1. Follow the intructions here http://beagleboard.org/getting-started to create an microSD card with latest board software
  2. Open the HubPro removing the 6 screws on the bottom.
  3. Insert the SD Card.
  4. While holding down the Boot Button "S2" connect the power. Don't electrocute yourself. Wait until the LED starts flashing.
  5. You should be able to connect via SSH now (username is 'debian' and the password is 'temppwd').
  6. Change the password!
  7. Enable the serial port by editing /boot/uEnv.txt

Add:

cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
cape_enable=bone_capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5

Enable:

###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr2=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr3=/lib/firmware/BB-UART5-00A0.dtbo
  1. Reboot and log back in (same as step 4 & 5)
  2. Install homebridge and this plug as usual seting the model in config.json to 2243

Donate

If you find this plugin useful you may make a donation using the button below. Donations are not expected, but appreciated!

paypal