Home Assistant Community Add-on: MQTT Server & Web client

He is using the Hass.io addon… this ia a HASSIO addon - nothing he can apt or apt-get

Any reason you’re not using the inbuilt broker?
You could also try the Discord Server for Frenck’s addons for support…

Do you have a mqtt dir with a custom mosquito.conf file in your /config dir?

Location in error shows opt/Mosquitto.conf
What does it means?

Yes under /config/mqtt/mosquitto.conf

With the same config I pasted above.

Don’t do that, remove that file and restart the add-on.

That file needs to follow the config structure that mosquito expects, and only use that if you needs it, like when setting up a bridge.

That is inside the add-on container.

Oh
Ok
I was think he might have installed it earlier with something else which might be interfering with this

That fixed it! Thank you!

Hi all.
Trying to get this add-on to work. This is the only MQTT broker installed and installation went smoothly (Hassio add-on).

I’m using a simple config:

{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "broker": true,
  "allow_anonymous": false,
  "mqttusers": [
    {
      "username": "mqtt-user",
      "password": "########",
      "readonly": false,
      "topics": [
        "shellies",
        "homeassistant"
      ]
    }
  ],
  "log_level": "trace"
}

Somehow publishing is denied from every device. Here is a log sample for my Shelly-1 switch:

1566984294: New client connected from 192.168.86.29 as shelly1-BA2C36 (p2, c1, k60, u'mqtt-user').
1566984294: Will message specified (5 bytes) (r0, q0).
1566984294: 	shellies/shelly1-BA2C36/online
1566984294: Sending CONNACK to shelly1-BA2C36 (0, 0)
1566984294: Denied PUBLISH from shelly1-BA2C36 (d0, q0, r0, m0, 'shellies/shelly1-BA2C36/online', ... (4 bytes))
1566984294: Denied PUBLISH from shelly1-BA2C36 (d0, q0, r0, m0, 'shellies/announce', ... (131 bytes))
1566984294: Denied PUBLISH from shelly1-BA2C36 (d0, q0, r1, m0, 'shellies/shelly1-BA2C36/relay/0', ... (3 bytes))
1566984294: Denied PUBLISH from shelly1-BA2C36 (d0, q0, r1, m0, 'shellies/shelly1-BA2C36/input/0', ... (1 bytes))

Any idea?

Hello to all !
I need some help i installed this pakket but i cant get any message even the test doesnot send me a message. If want to conect i have to change hassio-mqtt-client to home-assistant but i use Hassio

What is wrong?

mqtt:
  broker: a0d7b954-mqtt
  username: !secret mqtt_username
  password: !secret mqtt_password
  client_id: hassio-mqtt-client`
{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "broker": true,
  "allow_anonymous": false,
  "mqttusers": [
    {
      "username": "MakkeLeon2",
      "password": "****************",
      "readonly": false,
      "topics": [
        "cmnd/,cam_voordeur/off,cam_voordeur/on"
      ]
    }
  ]
}

Here is my log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: MQTT Server & Web client
 Mosquitto MQTT Server bundled with Hivemq's web client
-----------------------------------------------------------
 Add-on version: 1.1.0
 You are running the latest version of this add-on.
 System: HassOS 3.5  (aarch64 / raspberrypi4-64)
 Home Assistant version: 0.103.6
 Supervisor version: 195
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] hivemq.sh: executing... 
patching file /app/index.html
[cont-init.d] hivemq.sh: exited 0.
[cont-init.d] mosquitto.sh: executing... 
[20:14:25] INFO: Adding configuration for MQTT Server...
[20:14:29] INFO: Setting up user MakkeLeon2
[20:14:30] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:14:33] INFO: Starting mosquitto MQTT Server...
1578773673: mosquitto version 1.6.2 starting
1578773673: Config loaded from /opt/mosquitto.conf.
1578773673: Opening ipv4 listen socket on port 1883.
1578773673: Opening ipv6 listen socket on port 1883.
1578773673: Opening websockets listen socket on port 1884.
1578773673: Opening ipv4 listen socket on port 4883.
1578773673: Opening ipv6 listen socket on port 4883.
1578773673: Opening websockets listen socket on port 4884.
[20:14:34] INFO: Starting NGINX for the MQTT client...
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
1578773677: New connection from 192.168.1.32 on port 1883.
1578773677: New client connected from 192.168.1.32 as ttgocam-30aea4d80418 (p2, c1, k15, u'MakkeLeon2').
1578773687: New connection from 172.30.32.1 on port 1883.
1578773688: Socket error on client <unknown>, disconnecting.
1578773688: New connection from 172.30.32.1 on port 1883.
1578773688: New client connected from 172.30.32.1 as hassio-mqtt-client (p2, c1, k60, u'MakkeLeon2').
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET / HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /css/normalize.css HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /css/style.css HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /css/foundation.css HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /css/jquery.minicolors.css HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /js/jquery.minicolors.min.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /js/mqttws31.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /js/encoder.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /js/app.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /config.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:13 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /assets/logo.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:14 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /assets/arrow_up.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:14 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /assets/jquery.minicolors.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
[11/Jan/2020:20:15:14 +0000] 200 192.168.1.50, 172.30.32.1(172.30.32.2) GET /assets/arrow_down.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36)
1578773739: New client connected from 192.168.1.50 as home-assistant (p1, c1, k60, u'MakkeLeon2').
1578773804: Client home-assistant disconnected.
1578773806: Socket error on client <unknown>, disconnecting.
1578773819: New client connected from 192.168.1.50 as home-assistant (p1, c1, k60, u'MakkeLeon2').

It looks like there is an extra

:tada: Release v1.2.0

:warning: Deprecation notice!

This is the final and last release of this add-on, which is now deprecated.

We strongly advise you to upgrade/migrate to using the Mosquitto add-on, as provided by the Home Assistant project.

This add-on will be removed from the add-on store soon.

Changes

  • :pencil2: Maintaince -> Maintenance
  • :ambulance: Fixes path handling for SSL certificates
  • :hammer: Updates HA Auth URL in NGinx LUA script
  • :hammer: Use Hass.io DNS as NGinx resolver
  • :fireworks: Updates maintenance/license year to 2020
  • :books: Update add-on documentation to use new YAML configuration format
  • :hammer: Re-branding
  • :pencil2: Fixes some typos
  • :hammer: Update add-on config with new password & list features
  • :arrow_up: Upgrades add-on base image to v7.0.2
  • :warning: Adds deprecation notices

Full Changelog

How do I migrate from the old add-on “MQTT server & web client” to Mosquitto broker add-on?
Just delete the old add-on, reboot HA, install and configure Mosquitto broker?
I am afraid HA will not reboot correctly with MQTT sensors configured and no MQTT server…

@ mchangsp
How to use here

I did as described there, everything works as it should work. :+1:

  • stop deprecated add-on, disable start on boot
  • if you configured old mqtt via configuration.yaml - delete mqtt part, restart
  • install and configure new one, start, check the log until it is fully running
  • create new MQTT user
  • integrate new MQTT broker
  • check if everything is back and running
  • unistall deprecated add on
  • done :slight_smile:
1 Like

Thanks for the instructions!
I will try it this weekend.

Hi @kajmaj, it seems you need to delete the old mqtt from the integration as part of the official add-on installation, does it mean to lose all the devices integrated via the deprecated add-on?
Best regards,

@Campoy Oh, not at all.
Assuming, that you will apply the same settings in the new add-on.

@kajmaj You are right, yesterday I replaced the deprecated add-on by the mosquitto add-on and in my case, keeping the same ports, user and password, my integrations and entities continue working :slight_smile:

hello.
Don’t work MQTT Server & Web client ver 1.2.0

1586107071: No will message specified.
1586107071: Sending CONNACK to hassio-mqtt-client (0, 0)
1586107072: Denied PUBLISH from office_dht (d0, q0, r1, m0, 'testtopic/1', ... (42 bytes))
1586107072: Denied PUBLISH from office_dht (d0, q0, r1, m0, 'testtopic/1', ... (42 bytes)) 

It worked in the beginning. Then I disabled PI4 and turned IT on 3 days later. What am I doing wrong?

Add-on “Mosquitto broker ver.5.1” I couldn’t launch it