MQTT and Home Assistant

preview_player
Показать описание
You may have heard the term MQTT come up when people start talking about their Home Automation setups. Usually you hear it alongside things like Zigbee or Z-Wave, and Home Assistant.

Well have you ever wondered what exactly MQTT is, or how it works? Do you want to know how to set it up in Home Assistant?

You’ve come to the right place, because in this video I’m going to show you:
00:00 - Intro
00:32 - What is MQTT and how does it work?
03:09 - Using MQTT with Home Assistant
03:53 - Installing the Mosquitto Add-On in Home Assistant Operating System
05:06 - Installing the Mosquitto Docker container with Docker Compose (Home Assistant Container)
11:06 - Next Steps

Links:
Companion Blog Post showing how to install the Mosquitto MQTT Container using Docker Compose:
Рекомендации по теме
Комментарии
Автор

This is a really full service video. Not only do we get a video of the installation of the MQTT broker and the HA integration, we also get an index, chapters, and a companion blog that includes all the code he uses, so you don't have to scrape the code off the screen. I even appreciate the fact that he doesn't waste my time during his intro and outro. Bravo!

RickFarris
Автор

Important to note if you run Docker hass and docker mqtt you neet to enable 'listener 1883' in the mqtt conf for the mqtt container to start and run, otherwise no clients can connect to it as it cant bind ports onto the loopback socket of the docker container. This is a change for mosquitto 2.0

FlaxTheSeedOne
Автор

This is absolutely the highest quality home automation channel available. Thank you so much for all your work!

laurenbarger
Автор

Just wanted to thank you so much for this video! The most informative thing I could find on the topic without having to reference several different articles to get the full guide I needed. Cheers dude!

NickInRealLife
Автор

Again a great video Alan, learned a lot from you. Can't wait until the next video!!

drbyte
Автор

That's a very insightful and useful, clear video. Thanks for taking the time to make it. I look forward to your next video as I want to ditch my Phillips Hue hub and move everything onto my Conbee II.

IanTakats
Автор

Thanks again Alan! I'm working though your videos to migrate a Raspberry Pi HA system to an HA Docker system. The knowledge I have picked up on Docker has been invaluable, thanks to your content. I look forward to the next video on Zigbee2MQTT, cause I need that too.

RocketBoom
Автор

thanks so much Alan! I remember asking for specifically this a short while back as a comment to one of your docker/Portainer vids, and you replied that you might cover this topic later. I am very thankful, after your next video (Zigbee2MQTT) I can fnally pick up where I got stuck along the way

mauvanheusden
Автор

Hi Alan, Great video. Thank you for taking the time to make this vidoe

grahammccann
Автор

great video, simple and every explanations are pretty clear. Thank you

benoitgaussein
Автор

For real. I really want to go the home assistant route but I wasn't sure if I would be able to do it all.
In the last few days I watched 100 of videos about the topic and I already feel confident that I can do it. Big part of it are YOUR videos.
I have so much ideas already.
I'm testing it in a vm on my gaming rig right now. And when I get a hang of it I'll buy a used intel nuc i5 6200 since the price is roughly the same as a respberry pi (prices of the pis are ridiculous at the moment).

Thanks!!!

Kevin-rfsx
Автор

Thank you for such a clear explanation.

artyb
Автор

Dude, yes you are a total geek, excellent. Looking forward to more of your vid's. Great Job!

bgable
Автор

Nice video and well though out in advance. Been using mqtt for about 4 months now with espresense for room presence detection. I'm running HA and mqtt on a raspberry pi though so easier to setup. But i am running it from and booting from a SSD instead of a micro SD card. Runs much faster that way and don't have to worry about the micro sd card crapping out on me like they do when being written to a lot.

HATipsByLarry
Автор

ESPHome completely replaced MQTT for me. But it's such a great protocol! Nice vid.

areks
Автор

Thank you Alan for this insightful and very useful video! Congrats on your work!
I have a question regarding the mosquitto log file. In the video I noticed that whenever you show no errors on the mosquitto log using portainer you are not actually showing anything of what is inside that log file. I believe that is to do with this config parameter "log_dest file /mosquitto/log/mosquitto.log" . I think that if this is enabled the logs are not redirected to Portainer but will be registered real time in this file. If you disable this option and restart the container the logs instantly show up in Portainer container logs. At least I had to comment this config option in order to get them in Portainer, not sure if I am doing something wrong or there is a way to have them both sides, log file and Portainer dashboard.

I am really looking forward to your Docker Frigate video. Great work 💪

carloslindo
Автор

I'd just like to say a brief thank you. I've been building and using PCs for nearly 30 years now but have largely shied away from this particular side of computing. Over the last 3 days I've been trying to get things like docker, portainer, HA, etc all running on a Pi4 (all of which are new to me) and frankly have felt like a complete idiot at every turn. Practically every instruction I've seen and attempted to replicate only to have a problem that somehow didn't exist for the person whos video/blog I was reading. Every. Turn.

Yours on the other hand pretty much all clipped along exactly as I had hoped for the most part. The only difference being I had already installed Docker, and so using your docker compose install left me with the 1.2.9 version and for the life of me I couldn't work out how to get a newer build running. Only to find out when attempting to install docker-compose-plugin that version 2.5 was already installed. It does mean console commands are now docker compose, not docker-compose but it seems to work so hopefully world ending outcomes are not on my horizon.

But, just thank you. I feel like slightly less of a moron now and hopefully by the end of this weekend I'll get my solar storage inverters talking locally to my new HA via mqtt after this video helped me out so much.

Do. Not. Stop.

MrDBT
Автор

advice please.... i setup mqtt docker as i followed your explanation and when come to setup authentication all stopped when i clicked on console in mosquitto - error message said "Unable to retrieve image details"
where have i missed?

davidforbes
Автор

Can I use rabbitmq instead of mosquitto?

danieln
Автор

@9:50 The reason why it happens is because the user inside the container is "root" and all files created by root are automatically owned by root. Since docker just containerises on top of the kernel of your host system, the access permissions and ownership will also propagate back to your host system.
You would need to create a specific user inside the docker container that is allowed to run all necessary commands. Since that is not always straight forward, it is often easier to just run a script once a day to change the ownership of all the data of your /opt/xxx directory (preferably before you start your backup)

Markste-in