Skip to main content

Secure IoT Open Lynx ↔ Home Assistant MQTT Discovery bridge

Project description

iotopen-bridge

Secure, extensible bridge between IoT Open Lynx and Home Assistant using MQTT + HA MQTT Discovery.

Quick start

Install (PyPI)

pip install iotopen-bridge

Install (dev)

pip install -e ".[dev]"

Home Assistant integration helper (optional)

If you are writing a Home Assistant custom integration and want minimal glue code, you can build a BridgeConfig from your config flow values and start the runtime from HA:

from iotopen_bridge.ha import HABridgeHandle, build_bridge_config

cfg = build_bridge_config(
    base_url="https://lynx.iotopen.se",
    api_key="...",
    installation_id=2222,
    mqtt_host="localhost",
    mqtt_port=1883,
)

handle = HABridgeHandle.from_config(cfg)
await handle.async_start(hass)

Configure

Create config.yml (see examples/config.example.yaml):

lynx:
  base_url: "https://lynx.example"
  installation_id: 2222
  api_key: "${IOTOPEN_API_KEY}"

mqtt:
  host: "mqtt.example"
  port: 8883 #tls 1883 non secured 
  username: "${MQTT_USER}"
  password: "${MQTT_PASS}"
  client_id: "iotopen-bridge"
  tls:
    enabled: true
    cafile: "/etc/ssl/certs/ca-certificates.crt"
    verify_hostname: true

ha:
  discovery:
    enabled: true
    prefix: "homeassistant"
  state_prefix: "iotopen"

Run

iotopen-bridge run --config config.yml

Probes

iotopen-bridge probe-api --config config.yml
iotopen-bridge probe-mqtt --config config.yml --sub "2086/obj/#" --count 20

Design

  • Inventory from Lynx API (FunctionX).
  • Telemetry from FunctionX topic_read.
  • Commands to FunctionX topic_set.
  • HA MQTT Discovery auto-creates entities in Home Assistant.

See docs/architecture.md.

Project details


Download files

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

Source Distribution

iotopen_bridge-0.1.7.tar.gz (117.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iotopen_bridge-0.1.7-py3-none-any.whl (170.2 kB view details)

Uploaded Python 3

File details

Details for the file iotopen_bridge-0.1.7.tar.gz.

File metadata

  • Download URL: iotopen_bridge-0.1.7.tar.gz
  • Upload date:
  • Size: 117.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for iotopen_bridge-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ffbba61109befcd57a17e7c26de8840cf5af5ac5a3581da6d463ae3743e42997
MD5 dffcd82ff06ed3ca8f25cda209258ae6
BLAKE2b-256 c9b522081e4c5ce85aca6b3a24f6b47d78b9be668f245e9ff62faa513daa0c2e

See more details on using hashes here.

File details

Details for the file iotopen_bridge-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: iotopen_bridge-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 170.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for iotopen_bridge-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd9898a7793eb830707979c06971c78b6de80e7380416d0fdc4f158784f1adf
MD5 a9dc375bf4bebe5d1bb22f9cbe5f654f
BLAKE2b-256 e603d7268c18d75ae2ce2b41a99ec8bf7bbc8e87e917a3a276b318ef86b3be4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page