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

hassio-repository
hassio-addon
Tags: #<Tag:0x00007f1b9c2a7c68> #<Tag:0x00007f1b9c2a7ad8>

#21

Sorry I do not understand what that is … newb. Yes 1883 is the mqtt port, I do not know which websocket poert to use


#22

You need to check that on the broker you are using, look for ws or websocket.
if you are using the broker in this add-on the default ports for WS are 1884 (non-SSL) and 4884 (SSL)


#23

I see, I do use the mosquitto hassio addon

and this is the config,. I do not see anywhere mention of ws or websocket ports … ?

{
“plain”: true,
“plain_websockets”: false,
“ssl”: false,
“ssl_websockets”: false,
“anonymous”: true,
“logins”: [
{
“username”: “”,
“password”: “”
}
],
“customize”: {
“active”: true,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}


#24

Look again :wink:

Both are disabled.


#25

thanks, I works now


#27

What would I use this for if I already use the standard broker? Is it just giving me information for troubleshooting? Something like MQTT.fx?


#28

Correct.
IMO the ACL configuration of this is easier (especially is you are not running custom hassio install)


#29

Not had a chance to try this yet but I suspect this is the biggest selling point. I have been swithering as to which platform to use to host my internal MQTT broker and this may just have swayed me :smile:.


#30

Addon appears to be running, but in chrome I see:

INFO: Starting mosquitto MQTT Server...
1538121720: mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) starting
1538121720: Config loaded from /opt/mosquitto.conf.
1538121720: Opening ipv4 listen socket on port 1883.
1538121720: Opening ipv6 listen socket on port 1883.
INFO: Starting NGINX for the MQTT client...

Config

{
  "log_level": "info",
  "certfile": "",
  "keyfile": "",
  "web": {
    "enabled": true,
    "username": "user",
    "password": "something",
    "ssl": false
  },
  "broker": {
    "enabled": true,
    "enable_ws": false,
    "enable_mqtt": false,
    "enable_ws_ssl": false,
    "enable_mqtt_ssl": false,
    "allow_anonymous": true
  },
  "mqttusers": [
    {
      "username": "user",
      "password": "somethingelse",
      "readonly": false,
      "topics": [
        "#"
      ]
    }
  ]
}

#31

put http:// and not (it does automatically) https …?


#32

@Klagio yes that’s it! However now I get an error:undefined

Also tried 1883, in logs:

INFO: Starting NGINX for the MQTT client...
1538123520: Saving in-memory database to /data/mosquitto/mosquitto.db.
1538125321: Saving in-memory database to /data/mosquitto/mosquitto.db.
1538125774: New connection from 192.168.1.74 on port 1883.
1538125774: Socket error on client <unknown>, disconnecting.

#33

put this to true


#34

and / or try this to true


#35

"enable_ws": true fixes it, thanks @Klagio


#36

Hi,

What is the benefit to running this addon only compared to running this alongside the mosquito addon?

Thanks


#37

Alongside, you will get a nice tool to inspect your topics and messages.
But remember to disable the broker in this (and change the ports)


#38

i just disabled the mosquito addon and commented out this from my config. None of my sonoff tasmota switches will now work. Any ideas?

I kept the user and password the same and subscribed to “#” topics. the ip and port are also the same.

Thanks

 mqtt:
   broker: core-mosquitto
   username: ?
   password: ?
   client_id: ?
   discovery: true
   discovery_prefix: homeassistant

#39

well… if you no longer have mqtt: defined in your config, MQTT devices will no longer work.


#40

yeah i realised that and tried to reintroduce it into my config.yaml but now i get this.

image

2018-09-28 19:05:59 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=140 from 2018-09-28 17:58:33.998420)
2018-09-28 19:06:01 ERROR (MainThread) [homeassistant.components.mqtt] Failed to connect due to exception: [Errno -2] Name does not resolve
2018-09-28 19:06:18 ERROR (MainThread) [homeassistant.setup] Setup failed for snips: Could not setup all dependencies.
2018-09-28 19:06:20 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
2018-09-28 19:06:20 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.
2018-09-28 19:06:20 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
2018-09-28 19:06:20 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.
2018-09-28 19:06:20 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt


#41

That also make sense since core-mosquitto (the mosquitto addon) now are disabled.