Despite this, the previously working entities in hass.io still work with this topic tree under hass.io
Now when I copy everything (including .storage and the home-assistant_v2.db) to the new standalone HA docker container and fire it up, it will connect to the broker, but won’t discover any MQTT entities.
It’s definitely receiving all messages (I can see them all when I type ‘#’ under listen in configuration), and I can also publish from HA to the broker.
I don’t understand why
a) the external broker doesn’t add the ‘homeassistant’ topic prefix when none of the MQTT device configs have changed
b) the original hass.io installation doesn’t seem to care when pointed to the new external broker without the discovery prefix in the topic tree… is there some other setting in hass.io that I’m missing ?
I can’t see any way to force-add a topic prefix in mosquitto.conf, or to simply get HA to incorporate all topics for discovery
How can I get the new HA docker installation to discovery my devices ?!
Listening in HA shows their topics coming through. Just without the homeassistant prefix (even though they are both configured to do so - unchanged from when they did this in hass.io)
Yes re discovery prefix
And no, mqtt is set up with usernames
Interesting (to me!) update:
Reverting to hass.io and mqtt add-on, I’ve found that:
the mqtt devices (each in their own container with their own docker network), have to refer to the docker add-on by IP address (host) rather than ‘core-mosquito’ etc namespacing in order to connect. This makes sense re how docker bridge networking works, but does this imply that all mqtt containers, the broker and HA need to be in bridge mode and on the same bridge network for discovery to work ?
I could do that, but then wouldn’t having HA in a bridge network (rather than host network) break SSL for the HA web interface (I’m using lets encrypt, but no reverse proxy) ?
When I initially had the mqtt device containers set up to connect with the add-on broker with core-mosquitto (rather than IP address), the entities all showed up correctly in HA. However there was no connection in the add-on broker logs, and the device status was obviously wrong. Stopping the containers made the entities unavailable. So even though they weren’t connecting to the broker, HA somehow registered the entities - how does this work ??!