I am currently using MQTT to provide Home Assistant with the status of my home backups and some cron jobs. You can build these devices for pennies on the dollar compared to their commercial counterparts As a substitute for devices that don’t have an API or a standard way to communicate with other devices in your ecosystem.Communication between relays and home automation controllers to open gates, garage doors, and to control irrigation, heating, and cooling systems.Integrating alarm panels that don’t normally talk to your smarthome hub.Sharing and reacting to sensor information like temperature, humidity, motion, and light levels.However, Home Assistant can also be a publisher and the clients can also be subscribers. In the diagram above, Home Assistant subscribes to messages published by sensors and jobs. MQTT uses a broker to facilitate communication between subscribers and publishers. It works well for IOT devices because it is low-bandwidth. It’s a lightweight publish/subscribe system where clients can both publish and subscribe to messages.
MQTT, which stands for Message Queuing Telemetry Transport, is often described as the protocol of the Internet of Things (IOT). Testing the Eclipse Mosquitto MQTT instance.Create and run the Eclipse Mosquitto container.Set up persistent data and base configuration.Setting up MQTT in Docker using Eclipse Mosquitto.What is MQTT and what can I do with it?.You can specify the user with: -user="root" or in docker-compose, user: root. My guess is the eclipse-mosquitto image be default uses a non-root user, meaning even if you open port 3000, that user isn’t allowed to send over that port. This also applies to users created in the container. Typically, by default anything under 3000 is treated as special and requires root permissions to open. Second and probably more likely the problem, some ports have special permissions. You can do this using the -network host flag or in docker compose, network_mode: host. Instead of opening the port to the container, you may instead want the container to share the same network as the host. Ive run into issues with HA in the past with service discovery when these two networks are separate. By opening the port, you are effectively letting your host machine running the docker daemon listen on whatever port. First, by default docker containers are issued their own network by the docker daemon, so think of a container being its own separate machine if you will. Thanks for the Its likely one of two things. I am very new to docker so please excuse my ignorance in explaining the problem. Is there a way to expose 1883 to the outside so tasmota switches etc. I use portainer to manage all my docker containers. If I use the docker command “docker run -publish=1883:1883 eclipse-mosquitto:latest” to expose 1883 to the outside world all works if I change the mqtt address inside hassio to 192.168.1.131. However for some reason 1883 was not exposed to the outside world. When I configured Mqtt I told it to listen on port 1883. However the switch which is a sonoff with tasmota can’t connect to the mqtt broker because the ip address for the NUC where Hassio and Mqtt is 192.168.1.131. Hassio can connect to the mqtt broaker just fine. My hassio configuration.yaml file is as follows. The ip address assigned to mqtt is 172.17.0.2. I am running hassio and mqtt in different docker containers.