Community Hass.io Add-on: MQTT Server & Web client

hassio-repository
hassio-addon
Tags: #<Tag:0x00007f1b93d83988> #<Tag:0x00007f1b93d835f0>

#1

This add-on is provided by the Community Hass.io Add-ons project.

GitHub Release GitLab CI Project Stage Project Maintenance

Supports armhf Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

Mosquitto MQTT Server bundled with Hivemq’s web client.

About


This add-on combines the power of Hivemq’s web-based MQTT client, and the powerful Mosquitto broker (MQTT Server). With this, you can host your own MQTT server, and inspect/publish messages using the built-in web client!

Key features

  • The Hivemq web service can connect to a WebSocket enabled MQTT Server, it will enable you to see or post messages to specific topics easily.
  • The Mosquitto broker has multi-user support with ACL! This allows you to limit the access of an MQTT user to a specific topic.
  • With the ACL support, you can have a separate user for every device that connects to your MQTT server.
  • You can also have read-only users that cannot post messages.

ACL = access control list.

Installation


The installation of this add-on is pretty straightforward and not different in comparison to installing any other Hass.io add-on.

  1. Add our Hass.io add-ons repository to your Hass.io instance.
    Add the following URL: https://github.com/hassio-addons/repository
  2. Install the “MQTT Server & Web client” add-on.
  3. Configure the options.
  4. Start the “MQTT Server & Web client” add-on.
  5. Check the logs of the “MQTT Server & Web client” add-on to see if everything went well.

Support


You can always get support here at the Home Assistant community forums, join the conversation!

You have several options to get them answered:

You could also open an issue on GitHub, in case you ran into a bug, or maybe you have an idea on improving the add-on:

We will do our best to help you out!

Repository on GitHub


Looking for more add-ons?


The primary goal of our add-ons project is to provide you (as an Hass.io / Home Assistant user) with additional, high quality, add-ons that allow you to take your automated home to the next level.

Check out some of our other add-ons in our Community Hass.io Add-ons project.


Home Presence Appdaemon App
How to subscribe using mosquitto_sub with HassOS?
Add-on, MQTT Install
#2

Interesting, it should work with the mosquitto addon installed?


#3

Yes, it will work with any WS enabled broker.


#4

Interesting!!

To clarify this runs its own broker too right ??

Could I use this to have two brokers?

(One locally with no auth and this one running on a different port, open to the world with with enabled )


#5

Congrats on the new add-on! Very nice addition of the HiveMQ web client.
Just installed and tested, it works.

I could not find it in the docs, but is there a way to make the fields in the web client persistent?
When I change screens now and return, all fields are empty again and I need to re-logon the server.
Although I love the addition of it, this behavior makes the web client not that useful.


#6

By default it runs it’s own broker, but you can disable that in this add-on :slight_smile:
Yes you can have two, just make sure they uses different ports.

By upping the the value for “Keep alive” (default 60) in the UI it should stay alive longer :slight_smile:


#7

Ah thanks, that helps. It’s a case of ‘as designed’ I guess.
:wink:

[EDIT]
This does not solve the issue of going to some other screen however. Even when you go back within the keep alive time frame, all fields are emptied and you need to setup a connection again.


Add-on not showing as green in dashboard despite being started
#8

Just installed but it won’t start, nothing in the log (no log)


#9

That is wierd, I have had my window in the background for hours at the time.
Are you using this with the broker it came with?

if so can you activate debug logging and open an issue for it on GitHub?
https://github.com/hassio-addons/addon-mqtt


#10

Most likely you have something else running on one of the ports.
Check the hassio system log :slight_smile:


#11

its not showing up in the add-on store for me :((


#12

Check the Hassio system log (Hass.io panel -> system) it might contain valuable information on this.


#13

Yes, I use the included broker.
When opening the web client in a separate browser tab, it stays connected ok. The behavior I described is when using the iframe integration.

I will test some more tomorrow and open an issue when needed. Going to get some sleep first.


#14

Refreshing the store (top right icon) helps!


#15

18-09-26 21:37:35 INFO (SyncWorker_13) [hassio.docker.interface] Clean hassioaddons/mqtt docker application
18-09-26 21:37:35 ERROR (SyncWorker_13) [hassio.docker] Can’t start addon_a0d7b954_mqtt: 500 Server Error: Internal Server Error (“driver failed programming external connectivity on endpoint addon_a0d7b954_mqtt (ffdaa59c662ae98ef1eb7fb5f9673144d1ec37077d4c2af08da2aa5b8c1fa699): Bind for 0.0.0.0:1884 failed: port is already allocated”)
18-09-26 21:38:39 INFO (SyncWorker_15) [hassio.docker.interface] Clean hassioaddons/mqtt docker application
18-09-26 21:38:40 ERROR (SyncWorker_15) [hassio.docker] Can’t start addon_a0d7b954_mqtt: 500 Server Error: Internal Server Error (“driver failed programming external connectivity on endpoint addon_a0d7b954_mqtt (4287d80d59602da7749a9c5de94a2288736e30b2bcd8d681e6531bed7ef74691): Bind for 0.0.0.0:1884 failed: port is already allocated”)
18-09-26 21:40:56 INFO (SyncWorker_0) [hassio.docker.interface] Clean hassioaddons/mqtt docker application
18-09-26 21:40:57 ERROR (SyncWorker_0) [hassio.docker] Can’t start addon_a0d7b954_mqtt: 500 Server Error: Internal Server Error (“driver failed programming external connectivity on endpoint addon_a0d7b954_mqtt (87516794ea474dcd01499acbd3842f66390ec01ccfc6d81dcc4990f250755e7d): Bind for 0.0.0.0:1884 failed: port is already allocated”)

But I set the part with the broker all to false (I just want to use mosquitto addon server and just check topics


#16

You have another add-on using this port (probably another mqtt addon)
Even if you set the broker part to false you also need to change the ports under the configuration to something else.


#17

Ok done that. It starts but when opening the web ui I received this


#18

I see in the background that you are using 1883 that is usually an mqtt port,
You need to use a WebSocket port with the web client.
Can you verify that you are using a WebSocket port?


#19

I am getting this error on a fresh install of the add-on.

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
INFO: Password is NOT in the Have I Been Pwned database! Nice!
FATAL: The configured certfile is not found
[cont-init.d] 10-requirements.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------

using this config

{
  "log_level": "info",
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "web": {
    "enabled": true,
    "username": "XXXXX",
    "password": "YYYYY",
    "ssl": false
  },
  "broker": {
    "enabled": true,
    "enable_ws": false,
    "enable_mqtt": true,
    "enable_ws_ssl": true,
    "enable_mqtt_ssl": false,
    "allow_anonymous": false
  },
  "mqttusers": [
    {
      "username": "ZZZZZ",
      "password": "EEEEE",
      "readonly": true,
      "topics": [
        "#"
      ]
    }
  ]
}

#20

It can not find the certificate file you have defined in your add-on config.
If you don’t have a certificate you have two options:

  • Create a certificate , and use that. (best option)
  • Set all ssl options to false in the add-on config