Git Product home page Git Product logo

mqtt2loxone's Introduction

mqtt2loxone

mqtt-smarthome npm travis

This node.js application is a bridge between the Loxone Smart Home and a mqtt broker. The Loxone MiniServer can publish a message by using the UDP virtual output and using port 4000 on mqtt2loxone by default. The mqtt2loxone will publish the message afterwards to the mqtt broker.

On the other way, the mqtt2loxone will subscribe to the topic loxone/set/# and forward all messages received from the mqtt broker to the Loxone MiniServer. The mqtt2loxone will check the val property. If the property is a string, it will be forwarded to a Loxone virtual text input. If it's a number, boolean or null, it will be forwarded to a Loxone UDP virtual input, using the same port 4000 by default.

Installation

This node.js application is installed from the npm repository and executed with the node command.

npm install -g mqtt2loxone
node /usr/local/bin/mqtt2loxone

Alternatively, the module can be executed as a docker container. Use the following Dockerfile to build a container injecting the config file.

FROM node:alpine

RUN npm install -g mqtt2loxone

COPY config.json /etc/mqtt2loxone.json

ENTRYPOINT [ "/usr/local/bin/mqtt2loxone", "/etc/mqtt2loxone.json" ]

Configuration

The following configuration file is an example. Please replace the desired values like the mqtt url and add your loxone ip address, username and password.

{
    "log": "debug",
    "mqtt": {
        "url": "mqtt://192.168.1.10",
        "name": "loxone",
        "secure": false
    },
    "loxone": {
        "host": "192.168.1.20",
        "port": 4000,
        "username": "user",
        "password": "pass",
        "subscriptions": [
            "/my/topic/#"
        ]
    }
}

API

UDP Virtual Output

This module contains a udp api to receive udp datagram packages from the Loxone MiniServer. The virtual output must be configured with the address pointing to the ip address of mqtt2loxone and the specified port. Also remove the ; separator in the virtual output.

UDP Virtual Output

Within the virtual output, a virtual output command can be created to specify what will be send to the mqtt broker. Please use the option digital output. For the field Command On specify the mqtt command in the following format:

  • <topic>;<value>;<qos>;<retain>;<name>;<mode>

UDP Virtual Output Command

By the way, you can also use the logger component in loxone with the UDP target to log change or status messages to mqtt.

UDP Virtual Input

The virtual udp input can be used to receive commands and numeric values. Just specify the udp port and optionally the remote ip.

UDP Virtual Input

Afterwards, for every topic create a udp virtual input command. If it's just a command without any value, just use the digital input option. Else, append the string =\v to the topic and use an analogue input.

UDP Virtual Input Command

Virtual Text Input

If you want to publish text to the Loxone MiniServer, the udp virtual input will not work. You have to use the virtual text input and specify a name. This module will automatically detect text and invoke a http query to update the text, by using the name property in the mqtt payload to identify the virtual text input.

Virtual Text Input

mqtt2loxone's People

Contributors

claudiospizzi avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.