Konnected


The konnected integration lets you connect wired sensors and switches to a NodeMCU ESP8226 based device running the open source Konnected software. Reuse the wired sensors and siren from an old or pre-wired alarm system installation and integrate them directly into Home Assistant.

Visit the Konnected.io website for more information about the Konnected Alarm Panel board and compatible hardware.

The integration currently supports the following device types in Home Assistant:

  • Binary Sensor: Wired door and window sensors, motion detectors, glass-break detectors, leak sensors, smoke & CO detectors or any open/close switch.
  • Switch: Actuate a siren, strobe, buzzer or relay module.
  • Sensor: Periodic measurements from DHT temperature/humidity sensors and DS18B20 temperature sensors.

This integration uses the discovery component, which must be enabled for device discovery to work. If you don’t want to use discovery, set the host and port for each device in the description.

Konnected devices communicate with Home Assistant over your local LAN – there is no cloud component! For best performance we recommend allowing unsecured HTTP API traffic between Konnected devices and Home Assistant on your LAN. This means that you should not use the http integration to serve SSL/TLS certificates. Instead, use a proxy like Nginx or Caddy to serve SSL/TLS. Read more.

Configuration

A konnected section must be present in the configuration.yaml file that specifies the Konnected devices on the network and the sensors or actuators attached to them:

# Example configuration.yaml entry
konnected:
  access_token: REPLACE_ME_WITH_A_RANDOM_STRING
  devices:
    - id: 438a388bcd53
      binary_sensors:
        - zone: 1
          type: door
      switches:
        - zone: out
    - id: 8bcd53438a38
      binary_sensors:
        - pin: 2
          type: door
      switches:
        - pin: 5

Configuration Variables

access_token

(string)(Required)

Any random string. This is used to ensure that only those devices which you have configured can authenticate to Home Assistant to change a device state.

api_host

(string)(Optional)

Override the IP address/host (and port number) of Home Assistant that the Konnected device(s) will use to communicate sensor state updates. If omitted, this is defaulted to the value of base_url in the http component. If you’ve set base_url to an external hostname, then you’ll want to set this value back to your local IP address and port (e.g., http://192.168.1.101:8123).

Default value:

value of base_url

devices

(list)(Required)

A list of Konnected devices that you have on your network.

id

(string)(Required)

The MAC address of the NodeMCU WiFi module with colons/punctuation removed, for example 68c63a8bcd53. You can usually find the mac address in your router’s client list. Or, check the home-assistant.log for log messages from automatically discovered devices.

binary_sensors

(list)(Optional)

A list of binary sensors connected to the device. See Konnected Binary Sensor for configuration variables.

pin

(Exclusive)

The number corresponding to the IO index of the labeled pin on the NodeMCU dev board. See the NodeMCU GPIO documentation for more details. Valid values are 1, 2, 5, 6, 7 and 9.

zone

(Exclusive)

The number corresponding to the labeled zone on the Konnected Alarm Panel board. Valid values are 1, 2, 3, 4, 5 and 6.

type

(Required)

Any binary sensor class, typically door, window, motion or smoke.

name

(Optional)

The name of the device used in the front end.

Default value:

automatically generated

inverse

(boolean)(Optional)

Inverts the open/closed meaning of a binary sensor circuit. Commonly needed for normally open wired smoke alarm circuits.

Default value:

false

sensors

(list)(Optional)

A list of digital sensors (currently supports DHT and DS18B20 sensors) connected to the device

pin

(Exclusive)

The number corresponding to the IO index of the labeled pin on the NodeMCU dev board. See the NodeMCU GPIO documentation for more details. Valid values for sensors are 1, 2, 5, 6, 7 and 9.

zone

(Exclusive)

The number corresponding to the labeled zone on the Konnected Alarm Panel board. Valid values for sensors are 1, 2, 3, 4, 5 and 6.

name

(Optional)

The name of the device used in the front end.

Default value:

automatically generated

type

(Required)

The type of sensor. Valid values are dht or ds18b20

poll_interval

(integer)(Optional)

The frequency (in minutes) that the Konnected device will report sensor data. Minimum 1 minute. Note: this is only implemented for dht sensors.

Default value:

not set (device default is 3 minutes)

switches

(list)(Optional)

A list of actuators (on/off switches) connected to the device. See Konnected Switch for configuration variables.

pin

(Exclusive)

The number corresponding to the IO index of the labeled pin on the NodeMCU dev board. See the NodeMCU GPIO documentation for more details. Valid values are 1, 2, 5, 6, 7 and 8.

zone

(Exclusive)

The number corresponding to the labeled zone on the Konnected Alarm Panel board or the word out to specify the dedicated ALARM/OUT terminal on the Konnected board. Valid values are 1, 2, 3, 4, 5 and out.

name

(Optional)

The name of the device used in the front end.

Default value:

automatically generated

activation

(Optional)

Either low or high to specify the state when the switch is turned on.

Default value:

high

momentary

(Optional)

Duration of the momentary pulse in milliseconds. To make a half-second momentary contact using a relay for a garage door opener, set this value to 500.

pause

(Optional)

Time of the pause between pulses in milliseconds when also used with momentary and repeat. To make a door chime “beep” with piezo buzzer, set this value to 55, set momentary to 65, and repeat to 3 or 4.

repeat

(Optional)

Number of times to repeat a momentary pulse. Set to -1 to make an infinite repeat. This is useful as an alarm or warning when used with a piezo buzzer.

host

(string)(Optional)

Optionally specify the Konnected device’s IP address or hostname to set up without discovery.

port

(integer)(Optional)

Optionally specify the port number for the Konnected API on the device. Note that the port is different on every device. See help.konnected.io to learn how to determine the port number.

discovery

(boolean)(Optional)

Enable or disable discovery for this device. When true, the device will respond to discovery requests on your network. When false, the device will not respond to discovery requests, so it’s important that you set reserved IP for the device and configure the host and port here.

Default value:

true

blink

(boolean)(Optional)

Blink the blue LED upon successful transmission of a state change.

Default value:

true

Configuration Notes

  • Either pin or zone is required for each actuator or sensor. Do not use both in the same definition.
  • Pin D8 or the out zone will only work when activation is set to high (the default).

Extended Configuration

# Example configuration.yaml entry
konnected:
  access_token: REPLACE_ME_WITH_A_RANDOM_STRING
  devices:
    - id: 6001948bcd53
      binary_sensors:
        - zone: 1
          type: door
          name: 'Front Door'
        - zone: 2
          type: smoke
          name: 'Bedroom Smoke Detector'
          inverse: true
        - zone: 3
          type: motion
          name: 'Test Motion'
      switches:
        - zone: out
          name: siren
        - zone: 5
          name: 'Beep Beep'
          momentary: 65
          pause: 55
          repeat: 4
        - zone: 5
          name: Warning
          momentary: 65
          pause: 55
          repeat: -1
    - id: 5ccf7f438a38
      binary_sensors:
        - pin: 1
          type: motion
          name: Office Motion
        - pin: 2
          type: door
          name: Office Door
      switches:
        - pin: 5
          name: Garage Door
          activation: low
          momentary: 500
        - pin: 8
          name: LED Light
      sensors:
        - pin: 6
          name: Kitchen
          type: dht
          

Unique IDs and the Entity Registry

Beginning in Home Assistant release 0.90, unique IDs are generated for each sensor or switch entity. This enables end users to modify the entity names and entity IDs through the Home Assistant UI on the Entity Registry page (under Configuration).

Unique IDs are internally generated as follows:

Binary Sensors: {mac-address}-{zone-number}

Switches: {mac-address}-{unique-hash}*

DHT Sensors: {mac-address}-{pin-number}-{temperature|humidity}

DS18B20 Sensors: {sensor-serial-number}

* Switches are identified by a unique hash including the pin number, momentary, pause, and repeat values. If these values are modified, a new entity will be created and the old entity must be removed manually from the Entity Registry.

Pin Mapping

Konnected runs on an ESP8266 board with the NodeMCU firmware. It is commonly used with the NodeMCU dev kit WiFi module and optionally Konnected’s Alarm Panel hardware. The following table shows the pin mapping between the Konnected hardware labeled zones, the NodeMCU labeled pins and the ESP8266 GPIO pins.

Konnected Alarm Panel Zone NodeMCU pin IO Index ESP8266 GPIO
1 D1 1 GPIO5
2 D2 2 GPIO4
3 D5 5 GPIO14
4 D6 6 GPIO12
5 D7 7 GPIO13
6 RX 9 GPIO3
ALARM or OUT D8 8 GPIO15

Revision History

0.91

  • Improved Unique ID generation for Konnected switches

0.90

  • Added support for dht and ds18b20 temperature sensors
  • Added Unique IDs

0.80

  • Added ability to specify host and port to set up devices without relying on discovery.
  • Added discovery and blink config options to enable/disable these features.

0.79

  • Added inverse configuration option for binary sensors.

0.77

  • Added support for momentary and beep/blink switches. [#15973]
  • Decouple entity initialization from discovery, enabling devices to recover faster after a Home Assistant reboot. [#16146]
  • Breaking change: Device id in configuration.yaml must now be the full 12-character device MAC address. Previously, omitting the first 6 characters was allowed.

0.72

  • Adds api_host configuration option [#14896]

0.70

  • Initial release

Binary Sensor

The konnected binary sensor allows you to monitor wired door sensors, window sensors, motion sensors, smoke detectors, CO detectors, glass-break sensors, water leak sensors or any other simple wired open/close circuit attached to a NodeMCU ESP8266 WiFi module running the open source Konnected software.

This integration supports all of the built-in device classes of the generic Binary Sensor component.

Switch

The konnected switch platform allows you to actuate an alarm system siren, strobe light, buzzer or any other wired device using a Konnected Alarm Panel board or relay module and a NodeMCU ESP8266 WiFi module running the open source Konnected software.