bgottsch / homebridge-isy-hub

ISY-994i plugin for Homebridge
Apache License 2.0
2 stars 2 forks source link

homebridge-isy-hub

npm-total-downloads npm-version TypeScript

THIS BRANCH IS STILL IN BETA

homebridge-isy-hub is a Homebridge plugin that enables HomeKit support for Insteon devices and scenes controlled by the ISY-994i hub.

This plugin finds all nodes linked to the ISY-994i hub and creates the corresponding HomeKit accessory. Nodes are all Insteon scenes and Insteon devices paired to the hub, that are supported by this plugin (see table below).

Changes to the ISY-994i, such as adding, updating or removing nodes, replicate automatically to HomeKit. Further more, optional features such as Stateless Scenes can turn Inteon KeyPads into Stateless Programable Switches.

Key Points

Supported Nodes

ISY-994i Node HomeKit Accessory Description
Insteon Micro Dimmer Lightbulb (dimmable) Simple lightbulb with brightness.
Insteon Micro Open/Close Window Covering Simple window covering with level.
Insteon Scenes Switch (default) or Stateless Programable Switch If configured in the optional setting
Stateless Scenes, a node will become
a Stateless Programable Switch accessory,
allowing for automation in HomeKit. If left
untouched, nodes will default to a regular Switch accessory.

Supported Hubs

Hub Model Supported firmware version(s)
ISY-994i 5.0.0 and up

Installation

  1. Install Homebridge by following the instructions.
  2. After installing,

Configuration

This plugin will auto discover nodes linked to the hub and that are supported.

If installed with Homebridge Config UI X, this plugin can be configured using the GUI.

If configuring manually, below follows a minimal configuration sample with the required parameters only:

"platforms": [
    {
        "name": "ISY Hub",
        "platform": "ISY Hub",
        "hostname": "192.168.x.x",
        "login": "LOGIN",
        "password": "PASSWORD"
    }
]

This minimal configuration is enough for the plugin to work.

For optional and advanced features, refer to the parameters definition below, and the subsequent explanation of all features.

Parameters Definition

Parameter Required Data Type Default Details
name yes string ISY Hub Can be changed, affects logs mainly.
platform yes string ISY Hub DO NOT CHANGE! Used by homebrigde.
hostname yes string   Hostname or IP address of ISY-994i hub.
login yes string   Login for the ISY-994i hub.
password yes string   Password for the ISY-994i hub.
hidden_nodes no list of strings   Used to specify which devices or scenes should
be hidden from auto discovery. List of addresses
as strings, even if address is numeric.
stateless_scenes no list of strings   Used to specify which scenes become Stateless
Programable Switches
 in HomeKit. If not specified, scene will default to regular Switch. List of
addresses as strings, even if address is numeric.
on_level_scenes no list of dicts   Used to specify the on level of a scene. Default ON
level for all scenes is 255 (or 100%). Only change
if on level is different. List of dicts, each dict with keys:
> address - string, even if address is numeric.
> on_level - numeric (number from 0-255).
refresh_interval no integer 60 Time in seconds for the plugin to fetch all nodes
via REST API.
(minimum: 1)
reconnect_interval no integer 30 Time in seconds for the plugin to attempt a
reconnect if the WebSocket terminates.
(minimum: 10)
heartbeat_interval no integer 30 Time in seconds for a heartbeat to be received
from the WebSocket. If no heartbeat is received,
plugin will attempt a reconnect.
(minimum: 25)
rest_timeout no integer 10 Time in seconds for REST requests to timeout.
(minimum: 5)

Full Example

"platforms": [
    {
        "name": "ISY Hub",
        "platform": "ISY Hub",
        "hostname": "192.168.x.x",
        "login": "LOGIN",
        "password": "PASSWORD",
        "hidden_nodes": [
            "12345",
            "AA BB CC 1"
        ],
        "stateless_scenes": [
            "12345",
            "5555"
        ],
        "on_level_scenes": [
            {
                "address": "44444",
                "on_level": 76
            },
            {
                "address": "9090",
                "on_level": 76
            }
        ],
        "refresh_interval": 60,
        "reconnect_interval": 30,
        "heartbeat_timeout": 30,
        "rest_timeout": 10
    }
]

Optional Settings

Hidden Nodes

Hides nodes from the auto discovery. If a node already exists, and then is added here, it will be removed (and if removed here, will be added by auto discovery). Requires changing the parameter hidden_nodes, which expects a list of node addresses as strings.

Stateless Scenes

Allows nodes that are Insteon Scenes to act as Stateless Programable Switches in HomeKit. The main use of this feature is in combination with Insteon KeyPads. Although not directly supported, if an Insteon Keypad is linked to a Stateless Scene, it will act as a button in HomeKit. The accessory comes with two actions (buttons presses), the first one for ON and the second one for OFF. These actions can than be configured to control HomeKit in various ways. Requires changing the parameter stateless_scenes, which expects a list of node addresses as strings.

Scene ON Level

Allows nodes that are Insteon Scenes to adjust their ON level. By default, nodes will consider ON the value 255 (or 100%). This value can be changed here if a scene is considered ON on a level different than 255. If multiple devices in a scene dim to different levels, the ON level for that scene should be the average of the device's ON level. Requires changing the parameter on_level_scenes, which expects a list of dicts, each dict composed of two keys:

Advances Settings

Refresh Interval

Time in seconds for the plugin to refresh the devices via REST API. This is what enables the auto discovery. If the WebSocket is closed, it is disabled. And when open renabled. Minimum of 1 second.

Reconnect Interval

Time in seconds for the plugin to attempt a reconnect of the WebSocket if it closes or exits with an error. Minimum of 10 seconds.

Heartbeat Timeout

Time in seconds for a heartbeat to be received from the WebSocket when it is open. If the timeout expires, a reconnect is imediatelly attempted. This is paired to what is emitted by the hub (wiht some margin), change with caution. Minimum of 25 seconds.

REST Timeout

Time in seconds for REST API requests to timeout. Minimum of 5 seconds.

Development

This plugin was based on the homebridge-plugin-template repo, thus allowing live code changes. To setup, clone this repo, and configure homebridge to start with the option -P <PATH_TO-homebridge-isy-hub. Further more, to use live code, run npm run watch. Sudo might be required.

For further instructions on the Homebridge API, refer to documentation.

License

Apache 2.0