Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Added support for fanlinc, and scene status via keypadlinc.  Alpha support for running on Insteon Hub Pro.  Sanitize input of device IDs to support '.' delimeter.  Fixed stupid errors :-) that cleared the Hub queue for all devices rather than just the target device.  Implement a 'connection watcher' to periodically reset connection to the Hub and prevent control/status from grinding to a halt.
  • Loading branch information
kuestess authored Jun 21, 2018
1 parent db66daf commit 73d3372
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 115 deletions.
65 changes: 57 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Homebridge platform plugin for local Insteon control

Overview
--------
Implements local control of Insteon devices including switches, dimmers, scenes, iolincs (configured as a garage door), motion sensors, and leak sensors via Homebridge. Leverages [home-controller](https://github.com/automategreen/home-controller) to enable control and status of multiple Insteon devices. Supports both Insteon Hub 2242 and 2245.
Implements local control of Insteon devices including switches, dimmers, scenes, iolincs (configured as a garage door), motion sensors, and leak sensors via Homebridge. Leverages [home-controller](https://github.com/automategreen/home-controller) to enable control and status of multiple Insteon devices. Supports both Insteon Hub 2242 and 2245 and now has alpha support for running directly on a Hub Pro (thanks to @rasod).

This plugin provides two mechanisms to get device status - an event listener and periodic polling. The event listener will listen for events on the Insteon network and automatically update device status in Homebridge. It will only capture manual events (ie, manually pushing a switch) as well as events triggered by other apps or devices (ie, Amazon Echo). The plugin also provides a mechanism for periodic polling of the status of configured devices. This is now disabled by default as the event listener should capture events, but can be enabled if desired (see configuration below).

Expand All @@ -27,7 +27,7 @@ This plugin will set up a local [Express](https://expressjs.com) server at the p
- `/links/[id]`: get links for device with Insteon [id]
- `/info/[id]`: get info for device with Insteon [id]

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

## Install

Expand All @@ -49,26 +49,75 @@ Edit the config.json (see example) to fit your installation - configuration para
- `pass`: Hub password from Insteon app (Not your Insteon login password. Go to Settings->House in the Insteon app and use the 'Hub Password' from there.)
- `host`: local IP of your Insteon hub
- `port`: port from Insteon app
- `model`: model number of your hub. Valid values are 2242 or 2245
- `model`: model number of your hub. Valid values are 2242, 2245 or 2243 (see below)
- `refresh`: device status refresh interval in seconds (disabled by default, set to 0 to disable polling)
- `use_express`: true or false to enable/disable Express server
- `server_port`: port for local Express server

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

- `name`: Device name as you want it to appear in Homebridge
- `deviceID`: Insteon ID with no spaces or dividers
- `deviceID`: Insteon ID
- `groupID`: Insteon group ID for a scene
- `keypadbtn`: Keypad button to check for status of a scene, in caps (8-key models only)
- `keypadbtn`: Keypad button to check for status of a scene, in caps. For a six-button configuration, use 'ON' if the ON/OFF buttons are your scene controller.
- `dimmable`: dimmable or non-dimming device - valid values are "yes" or "no"
- `deviceType`: valid values include 'lightbulb', 'dimmer', 'switch', 'scene', 'iolinc', 'motionsensor', 'leaksensor', and 'fan'. Please note that fan/fanlinc support is untested.
- `deviceType`: valid values include 'lightbulb', 'dimmer', 'switch', 'scene', 'iolinc', 'motionsensor', 'leaksensor', and 'fan'.

**Scene config changes in 0.3.2 and later**

Scenes remain on/off only, and now support status when controlled via a Keypadlinc. When defining a scene, the `deviceID` is the Insteon ID of a keypad that controls the scene and `keypadbtn` is then button that indicates the status of the scene. The `groupID` parameter is now the group number in the Insteon app (Scenes->Edit Scene->Group Number).
Scenes:
Scenes remain on/off only and support status when controlled via a Keypadlinc. Scenes are configured using additional the parameters below:

Fan support in version 0.3.3 is untested so I appreciate any feedback on its use. 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.
- `deviceID`: Insteon ID of a keypad that controls the scene
- `keypadbtn`: Keypadlinc button that indicates the status of the scene - valid values are 'A' - 'H'
- `six_btn`: set to `true` if using a Keypadlinc configured as a 6-button; default is `false`
- `groupID`: the group number in the Insteon app (Scenes->Edit Scene->Group Number)

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.

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

- `gdo_delay`: number of seconds before status of the sensor is checked when opening/closing the door (ie, how long does it take the door to open/close) [default = 15]

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:

- `keepAlive`: Hub connection reset duration in seconds (default is "3600" [1 hour]). Set to "0" to disable.

Using The HubPro Model 2243 (Alpha)
-----------------------------------
It is possible to use the official Insteon HubPro as a complete homebride 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 screwes 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
```

8. Reboot and log back in (same as step 4 & 5)
9. Install homebridge and this plug as usual seting the model in config.json to 2243


TODO

- How to always start up off the SD or flash the eMMC
18 changes: 14 additions & 4 deletions config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@
"model": "2245",
"refresh":"300",
"server_port": "3000",
"keepAlive": "3600",
"devices": [
{ "name": "Great Room Lamp",
"deviceID" : "<Insteon ID no spaces or dividers>",
"dimmable" : "yes",
"deviceType" : "lightbulb" }
{
"name": "Great Room Lamp",
"deviceID" : "<Insteon ID>",
"dimmable" : "yes",
"deviceType" : "lightbulb" },
{
"name": "FR Lamp",
"deviceID": "<Insteon ID>",
"dimmable": "no",
"groupID": "30",
"keypadbtn": "F",
"deviceType": "scene"
}
]
}
],
Expand Down
Loading

0 comments on commit 73d3372

Please sign in to comment.