Moved from MacOS to RP Hassio on RP 3B+ and now all MQTT switches are missing. Stumped

This is my first venture into RP 3B+ and I’m duly impressed. Amazing little device.

So, I automated my Chicken Coop (wife thinks I’m nuts). Sensors galore, 2 automated doors, cameras, sprinkler for hot weather, etc. All working well for quite some time on HA MacOS with Mosquitto broker also on the MacOS. So, I’m well past solving all the MQTT issues, configs etc.

I copied the relevant bits from the Mac config files to the Hassio config files. The MQTT stuff is all the same except for the server on Hassio. I’m sure thats where my problem is.

I’ll post the relevant bits o my config and whats not working:

Hass.io supervisor

|Version|184|
|System|HassOS 2.12|

Home Assistant 0.97.2
Path to configuration.yaml: /config
Frontend version: 20190805.0 - latest

Lovelace UI on HASSIO:

Same from my MacOS where it works great:
Sorry, new users can only put one image in a post.

States UI - all switches missing:
Sorry, new users can only put one image in a post.

I wont bore you with the states page on the Hassio - it doesn’t show any switches.

Heres the States page from my Mac HA instance- works great:

Sorry, new users can only put one image in a post.

configuration.yaml:

mqtt:
  broker: a0d7b954-mqtt
  username: !secret mqtt_username
  password: !secret mqtt_password
  client_id: home-assistant

amcrest:
 - host: 192.168.1.151
   name: outside
   resolution: high
   scan_interval: 5
   username: admin
   password: mypassword
   stream_source: rtsp
 
#Switches
switch:
  - platform: mqtt
    name: "Water switch"
    state_topic: "stat/water/POWER"
    command_topic: "cmnd/water/POWER"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    optimistic: false
    qos: 0
    retain: true
    
  - platform: mqtt
    name: "Inside Door ReedSW"
    state_topic: "/stat/chickendoor/S1/"
    command_topic: "/stat/chickendoor/S1/"
    state_on: "ON"
    state_off: "OFF"
    payload_on: ""
    payload_off: ""
    optimistic: false
    qos: 0
    retain: true

/config/.storage/core.config_entries

{
    "data": {
        "entries": [
            {
                "connection_class": "cloud_poll",
                "data": {
                    "track_home": true
                },
                "domain": "met",
                "entry_id": "7b9eb6343f7c4dda80ddc1973ed39cdd",
                "options": {},
                "source": "onboarding",
                "title": "Home",
                "version": 1
            },
            {
                "connection_class": "local_push",
                "data": {},
                "domain": "mqtt",
                "entry_id": "a4fa5e25628d4ae08932f45cea65f0da",
                "options": {},
                "source": "import",
                "title": "configuration.yaml",
                "version": 1
            }
        ]
    },
    "key": "core.config_entries",
    "version": 1
}

I removed the MQTT from the Integrations page as suggested in a different post. It shows its getting its config properly:

Sorry, new users can only put one image in a post.

I CAN connect to the MQTT broker on Hassio and post and see MQTT messages using the HIVEMQ app as well as the MQTT-SPY Java app.

Any help appreciated getting these switches to show up. It’s driving me NUTS!! I’m sure it’s something simple.

Jeff
PS limiting images to 1 on users trying to get help is not a good idea… making it 5 makes sense.

Did you set up an ACL as highlighted in the warning at the top of the Mosquitto mqtt broker docs?

I used “MQTT Server & Web client” add-on and there was no mention of that in the install doc. I do see it in the Mosquitto doc. Is that required with this add-on? If so, that should definitely be added to the install doc.

Jeff

Yep after V4.0 Mosquitto requires an ACL and the community mqtt client has this to say:

This add-on combines the power of Hivemq ’s web-based MQTT client, and the powerful Mosquitto broker (MQTT Server).
Key features

So if it is using Mosquitto V4 or above an ACL is very likely required.

You could ask about it here:

Fixed…

So I tried all your suggestions to no avail with the HiveMq+Mosquitto add-on. The broker still worked great, just no mqtt switches. So I uninstalled all that noise and used the basic Mosquitto broker add-on set for anonymous=true. Once I did that the switches all magically showed up and the broker worked as well so I’m good to go.

Someone with better skills and time than I have will need to document an “install fix” for that add-on.

Jeff

Jeff

That still sounds like an ACL issue.

What was in your ACL file?

Did you include a homeassistant user?

It needs access too.

Yes, I included that.

So, I’ve also set the customize flag to false as so many others have suggested:

“customize”: {
“active”: false,
“folder”: “mosquitto”
},

All is working after doing that.