mqtt2loxone2.0.7 • Public • Published
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
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.
This node.js application is installed from the npm repository and executed with the node command.
npm install -g mqtt2loxonenode /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:alpineRUN npm install -g mqtt2loxoneCOPY config.json /etc/mqtt2loxone.jsonENTRYPOINT [ "/usr/local/bin/mqtt2loxone", "/etc/mqtt2loxone.json" ]
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.
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.
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
Command On specify the mqtt command in the following format:
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.
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
=\v to the topic and use an analogue input.
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.