Skip to main content

An async Python library for interacting with Konnected home automation controllers (see

Project description

Konnected Python library

This is a simple Python library to talk to a Konnected device. Konnected is an open-source software for ESP8266 devices that enables simple wired binary sensors and actuators to talk to home automation frameworks such as Home Assistant and SmartThings. The most popular use case for Konnected is to connected a wired home alarm system to your Smart Home hub.

This library was written to support Home Assistant integration.

For more information see


import aiohttp
import asyncio
import konnected

async def fetch(session, url):
    async with session.get(url) as response:
        return await response.text()

async def main():
    async with aiohttp.ClientSession() as session:
        k = konnected.Client('', '17000', session)

        # Sync settings to the device

        print(await k.put_settings(sensors=[{"pin":1}], actuators=[], auth_token='secureToken', endpoint=''))
        # True

        # Get status of each input pin

        print(await k.get_device())  
        # [{'state': 0, 'pin': 1}, {'state': 1, 'pin': 2}]

        # Get status of a single input pin

        print(await k.get_device(2))
        # [{'state': 1, 'pin': 2}]

        # Actuate an output pin

        print(await k.put_device(pin=8, state=1))
        # {'state': 1, 'pin': 8}

        # Get status of each input zone

        print(await k.get_zone())  
        # [{'state': 0, 'zone': 1}, {'state': 1, 'zone': 2}]

        # Get status of a single input zone

        print(await k.get_zone(2))
        # [{'state': 1, 'zone': 2}]

        # Actuate an output zone

        print(await k.put_zone(zone=8, state=1))
        # {'state': 1, 'zone': 8}

        # Get device status

        await k.get_status()
        # {'mac': '2c:3a:e8:43:8a:38', 'gw': '', 'hwVersion': '2.0.5', 'rssi': -31, 'nm': '', 'ip': '', 'actuators': [{'trigger': 1, 'pin': 8}], 'port': 12426, 'uptime': 2349, 'heap': 23904, 'swVersion': '2.1.3', 'sensors': [{'state': 0, 'pin': 1}]}

if __name__ == '__main__':
    loop = asyncio.get_event_loop()

Python version

This library was designed to work with Python 3.5 and above.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for konnected, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size konnected-1.2.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View
Filename, size konnected-1.2.0-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page