Home

Awesome

Mqtt To Mqtt

MQTT

<a href="https://www.buymeacoffee.com/MVg9wc2HE" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

Fully configurable Mqtt to Mqtt gateway.

Why

There is almost an MQTT gateway for every protocol out there.

The problem is every gateway maps reads and writes in different ways depending on the protocol used. There isn't a standard way to map a protocol in MQTT topics and also there isn't a standard payload, some sends a JSON payload with different properties (like val or value or data for the value and tms time timestamp for the timestamp/date), others use a payload with just a numeric value.

This gateway inits an MQTT broker that sits between your MQTT gateways (or devices) and your broker to parse incoming/outgoing MQTT messages from/to your broker in the format you need.

Here is an example schema of how it works:

Diagram

Note here there are some bold text GET/SET from/to. More about them in docs

:electric_plug: Installation

# Clone repo
git clone https://github.com/robertsLando/

cd Mqtt2Mqtt

# install dependencies
npm install

# build for production with minification
npm run build

# Start the server
npm start

Usage

Once the app is running open the web browser to http://localhost:8100. Here you need to declare the Broker settings, Mqtt clients, the maps and (optionally) the values.

Broker settings

Used to set up the MQTT Broker. To edit settings click on the fab button in the bottom right corner

MQTT Clients

Used to init a connection to an MQTT broker. To add a new client connection click on the fab button in the bottom right corner

Maps

Set of rules to use for incoming/outgoing packets. To add a new map click on the fab button in the bottom right corner

Examples

Wildecards

Topic FromWildecard FromWildecard ToTopic To
a/b/c/d/ea/b/#myprefix/#myprefix/c/d/e
a/b/c/d/e+/b/+/d/emyprefix/+/+myprefix/a/c
a/b/c/d/e+/b/#+/my/#a/my/c/d/e

Payload



Values

If you don't want to map all values coming from the gateway but just some values you can add the values you want here using fixed topics instead of wildecards

:pencil: TODOs

:camera: Screenshots

Broker status

Broker

Clients table

Clients

Values table

Values

Maps table

Maps

Map Function

Function

:bowtie: Author

Daniel Lando

Support me on Patreon :heart: