Skip to content

Latest commit

 

History

History

horizon

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Horizon Control Addon for Home Assistant

This repository contains an Open Horizon horizon control addon to periodically scan the local-area-network (LAN) and automatically configured nodes identified by MAC address; currently only RaspberryPi model 3/3+ running Raspbian Stretch are supported. More information about the initialization script is here. Detailed documentation for the IBM Cloud Edge Fabric is available on-line. A Slack channel is also available. Refer to the examples available on GitHub.

Currently there are two supported patterns:

  1. cpu2msghub - Private CPU pattern (see also corresponding addon)
  2. sdr2msghub - Shared SDR pattern (see also corresponding addon)

Note: You will need an IBM Cloud account

Install Open Horizon

Please refer to the Horizon setup instructions.

Install addon

  1. Add this Hass.io add-ons repository to your Hass.io instance.
  2. Install the "horizon" add-on
  3. Configure the "horizon" add-on (see below)
  4. Start the "horizon" add-on
  5. Check the logs of the add-on for failures :-(

Configure addon

Options: Home Assistant

These options are for the Home Assistant environment hosting this control addon. These values will be specified in the modifications to the HA environment, which will be replaced (NOT YET).

log-level

timezone

unit_system

latitude

longitude

elevation

Option: refresh

Number of seconds between scans for new devices on the LAN and installation or update as appropriate.

Option: mqtt

Server required to send and receive MQTT messages between clients and servers on the LAN. Defaults are as below:

"mqtt": {
    "host": "core-mosquitto",
    "port": 1883,
    "username": "",
    "password": ""
}

Option: cloudant

Database required to store node (hzn-config) and addon configuration information; the addon database is <IBM_CLOUD_LOGIN_EMAIL> without the @host.tld appended. Configurations specified in the horizon.config attribute (see Option: horizon) refer to record identifiers in hzn-config.

"cloudant": {
    "url": "<CLOUDANT URL>",
    "username": "CLOUDANT USERNAME>",
    "password": "<CLOUDANT PASSWORD>"
  }

Option: horizon

Credentials required for controlling and interacting with the Open Horizon exchange. For more information about the horizon.config reference specification, please refer here.

"horizon": {
    "apikey": "<HORIZON_API_KEY>",
    "org": "<IBM_CLOUD_LOGIN_EMAIL>",
    "device": "<YOUR DEVICE NAME>",
    "url": "https://alpha.edge-fabric.com/v1",
    "config": "<CLOUDANT CONFIGURATION ID>"
}

USE

Listen to the MQTT host and port to receive JSON payload of nodes. The CONFIGURATION identifier is from the horizon.config option; the DEVICE identifier is from the node specified in that configuration (e.g. test-cpu-1).

  1. <CONFIGURATION>/<DEVICE>/start

A complete configuration is automatically generated from templates modified based on Options specified (per above).

  1. configuration.yaml
  2. groups.yaml
  3. automations.yaml
  4. secrets.yaml
  5. ui-lovelace.yaml

Sample output

horizon sample

Changelog & Releases

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Authors & contributors

David C Martin ([email protected])