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

ok got it back now thanks. I think i will keep the mosquito add on as no point fixing it if it ain’t broken.

Can you please on the correct option to use this addon with the mosquito one?

thanks

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

Set this part to false

Do i change it in this addon or the original mosquito add on. What would be appropriate?

Setting it to false didn’t help. I think because I’m using the same ports.

That is correct, change the ports for the one that not are in use

OK I am getting an error when I start the addon. Here are my settings:

{
  "log_level": "info",
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "web": {
    "enabled": true,
    "username": "!secrets ssh_user",
    "password": "!secrets ssh_pass",
    "ssl": false
  },
  "broker": {
    "enabled": false,
    "enable_ws": false,
    "enable_mqtt": false,
    "enable_ws_ssl": false,
    "enable_mqtt_ssl": false,
    "allow_anonymous": false
  },
  "mqttusers": [
    {
      "username": "!secrets mqtt_user_name",
      "password": "!secrets mqtt_password",
      "readonly": true,
      "topics": [
        "#"
      ]
    }
  ]
}

So I can’t login. (I changed 1883 to 11883 so as not to conflict with the standard addon broker)
Is it correct to use my MQTT broker username and password for the mqttusers section?
Is it correct to use anything for the web username and password?

The addon is starting and prompting for a login when I go to http://ip-address:5713 but it won’t accept either and log me in.

What am I missing here?

hey i have it now which is working great but it wont save the details of the broker in the web page - is that correct? they need to be entered manually every time?

Any errors in the add-on log or hassio system log?

No, this are for creating users for the broker in this add-on.

Yes

That is correct, there are no save function on it.
The tool are designed to be used for troubleshooting, usually you need to change some of the details between tests.

1 Like

no errors in the log.

-----------------------------------------------------------
 amd64 / Debian GNU/Linux 9 (stretch) / HA 0.79.0 / SU 131 / beta
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

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!
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-patches.sh: executing... 
patching file /app/index.html
[cont-init.d] 11-patches.sh: exited 0.
[cont-init.d] 20-mqtt_broker.sh: executing... 
[cont-init.d] 20-mqtt_broker.sh: exited 0.
[cont-init.d] 21-mqtt_web.sh: executing... 
[cont-init.d] 21-mqtt_web.sh: exited 0.
[cont-init.d] 40-nginx.sh: executing... 
Adding password for user !secrets ssh_user
[cont-init.d] 40-nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
INFO: Starting NGINX for the MQTT client...

Tried setting allow anonymous to true and deleted the mqttusers but same.
Tried setting log to debug but not seeing any errors

Is this still your config?

At the very least "enabled" needs to be true, probably "enable_mqtt" as well if you just want to use the broker and not the web interface (personally I use MQTT.fx - the web interface is only really useful if you are not on the same network as the Hassio instance).

Otherwise, I think it is doing exactly what you ask it to do… :smile:.

I’m using the inbuilt broker so I don’t need the broker in this addon… I thought that was possible.

This is the reason for that:

  "web": {
    "enabled": true,
    "username": "!secrets ssh_user",
    "password": "!secrets ssh_pass",

it is

So I should have that false instead of true?
NVM - I changed it to secret yesterday.
It is at least loading now but I can’t connect. Using the IP address of the broker and tries 1883 as well as 1884 and 11884 using the broker username and password but it won’t connect

I’m using the IP address of the broker and 1883 as the port… the client I’d - is that fixed ID? Using then the broker username and password but it won’t connect.

1883 will not work, that is an MQTT port, you need to connect to a websocket port as described in the docs…

https://github.com/hassio-addons/addon-mqtt#option-group-web

This web client can only connect to a WebSocket (WS) port, make sure you have that enabled on the server (broker) you are connecting to.

If you are using SSL on the client the broker also needs to have that enabled on the port you are connecting to.

And if you are using SSL the host needs to match the host that the certificate are issued to.

So in the broker I have the web_socket set to false. Not using ssl. So I need to enable web_socket and connect on which port? 1884? Seems the broker is listening on 1884. Still won’t connect though

Check to logs of that broker

Nothing in the logs.

It is saying connection from ipad IP address (that I am using with chrome) but it says connection on port 1883 which doesn’t make sense as I am using 1884 (which the log says is the websockets port)

The inbuilt broker is set up like this:

{
  "plain": true,
  "plain_websockets": true,
  "ssl": false,
  "ssl_websockets": false,
  "anonymous": false,
  "logins": [
    {
      "username": "my-mqtt-user",
      "password": "my-mqtt-password"
    }
  ],
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

This addon is setup like this now:

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

When I try and connect using the broker it address, port 1884, my_mqtt-user and password as per the broker and any client ID I get a connect failed AMQ??? Socket error undefined.

I have no clue what I am doing wrong. When I try to connect I’m not even getting any additional entries in the log file.

I just tested this and I have no issues connection to the “Mosquitto Addon” broker.

socket error are thrown if port or ssl are wrong.

Ok thanks. As you can see I’m not using ssl with the broker. Just logging in using local IP address as well. Thanks for trying. I don’t seem to have any error or problem like this with any of the other community addons I use.