GithubHelp home page GithubHelp logo

koktaildotcom / nl.hdg.mqtt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harriedegroot/nl.hdg.mqtt

0.0 2.0 0.0 1.24 MB

MQTT Gateway for Athom Homey

License: GNU General Public License v3.0

JavaScript 100.00%

nl.hdg.mqtt's Introduction

MQTT Gateway

With this app you can communicate with Homey using MQTT messages.

Functionality

  • Dispatch device state changes for all connected devices.
  • Dispatch system info (memory, cpu, etc.) on a regular basis.
  • Request info (system, zone, device, capability, etc.).
  • Update the state of a device (set capability).

Communication

The gateway allows two ways of communication, by topic & by message.
E.g. These two messages will both dim the tv light to 30%:

  1. publish to topic 'homey/light/living/tv/dim/update', with message payload: 0.3
  2. publish to topic 'homey/command', with message payload:
{
  "command": "update",
  "device":{
    "name": "tv"
    "class": "light", // optional
    "zone": "living", // optional
    "id": "<your-device-guid>" // optional
  },
  "capability": "dim"
  "value": 0.3
}

MQTT Client

This app uses the MQTT Client (beta) to communicate with a MQTT broker.

MQTT Topic

The following message format is used for communication:
system name/device class/zone/device name/capability/command

Note: system name, zone & device name will be normalized.
E.g. Homey/light/Living room/Light tv/... -> homey/light/living_room/light_tv/...

Messages

Messages with the following commands are dispatched by the Gateway:

  • state: Current state value. Dispatched on device state changes or on request command.
  • info: JSON Object describing the element(s) in the request (Zone, Device, Capability, etc.).

Commands

The gateway provides the following commands to interact with Homey:

  • request: Request current state, a state message will be published.
  • update: Update a device state (capability).
  • describe: Request a description of a Zone/Device/Capability/etc. Results will be published in a info message.

Device mapping

  • Device id's will automatically be resolved from the device id, name or topic (in this order).
  • The device name may contain either de original name or the normalized version.

Homey firmware v1.5 and v2

Homey 2.0 users should use the beta version of this app.

Future

  • Create the abillity to listen to app flow triggers.
  • Trigger flows.
  • Settings page for managing the Gateway (on/off, select devices/capabilities, etc.).
  • etc.

Change Log

1.0.2

  • Fixed getting device name
  • Normalize device name

1.0.1

  • Fixed messages for boolean capabilities

1.0.0

  • Initial release for Homey firmware v1.5

nl.hdg.mqtt's People

Contributors

harriedegroot avatar groot406 avatar scanno avatar

Watchers

James Cloos avatar Leendert de Kok | koktail.nl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.