Giter VIP home page Giter VIP logo

zway-mqtt's Introduction

MQTT Z-Way HA module

Publishes the status of devices to a MQTT topic and is able to set values based on subscribed topics.

It is possible to publish the status for single devices, or for devices which are tagged. Per publication you can customize the topic and decide if the message should be retained or not.

Installation

Make sure that the BaseModule is installed prior to installing this module.

The preferred way of installing this module is via the "Zwave.me App Store" available in 2.2.0 and higher. For stable module releases no access token is required. If you want to test the latest pre-releases use 'mqtt_beta' as app store access token.

For developers and users of older Z-Way versions installation via Git is recommended.

cd /opt/z-way-server/automation/userModules
git clone https://github.com/Edubits/Zway-MQTT.git MQTT --branch latest

To update or install a specific version

cd /opt/z-way-server/automation/userModules/MQTT
git fetch --tags
# For latest released version
git checkout tags/latest
# For a specific version
git checkout tags/1.0
# For development version
git checkout -b master --track origin/master

Usage

Add an instance of the app through and fill in the details about your MQTT broker. After this configure for which devices you want to publish the status to MQTT. You can either configure this for a single device or for all devices tagged with a certain tag at once.

Defining the publication topic

You can define the topic used for publication. It's constructed from the following parts:

  • Topic Prefix โ€“ The start of each topic
  • Topic โ€“ Per publication defined topic

In each of these you can use %deviceName% and %roomName% as variables. For example having Foo/bar as prefix and %roomName%/%deviceName% as topic can result in a message published on the topic Foo/bar/livingRoom/dimmer. Both %deviceName% and %roomName% will be camelcased.

Interacting through MQTT

You can also publish to certain topics to interact with Z-Way. For this the two postfixes are used:

  • Status postfix (default: status)
  • Set postfix (default: set)

Taking the same example as before, when you publish an empty message to Foo/bar/livingRoom/dimmer/status the current value will be published again. When you publish a value (for example on, off or 87) to Foo/bar/livingRoom/dimmer/set the dimmer will be set to that level.

Acknowledgements

I want to thank @goodfield for finding and fixing a fully JavaScript MQTTClient which I could use in this module as well. His module can be found at https://github.com/goodfield/zway-mqtt.

License

Copyright 2019 Robin Eggenkamp - Edubits

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

zway-mqtt's People

Contributors

duiffie avatar edubits avatar i8beef avatar isaksson avatar pastukhov avatar vectah0 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.