MQTT 101: Integrate your DIY Devices into Home Assistant

preview_player
Показать описание
In this video, I'm going to show you how to use MQTT to integrate your custom DIY devices into Home Assistant.

After covering the basics of MQTT and how it works, I'll show some examples of using MQTT in Home Assistant, how it can be added to your custom device and how to integrate that device into Home Assisant via automations, sensors and switches. I'll show all this with a real world example of a DIY device I integrated into Home Assistant using MQTT.

Chapter Breaks:
==============
00:00 Intro
01:48 What is MQTT?
02:34 Overview of how MQTT works
05:32 MQTT payloads
06:30 Publishing and subscribing in Home Assistant
07:54 MQTT Broker options
09:18 Additionl MQTT terms
10:05 Overview of MQTT-based matrix clock
12:03 Home Assistant MQTT-based dashboard and features
13:39 Why this device needs to subscribe and publish
14:20 Using the MQTT retain flag
21:10 Adding MQTT to your custom DIY device
22:36 Adding device MQTT entities to Home Assistant
26:54 Wrap up and alternatives

Links to utilities and code shown:
=================================

Links to video of projects shown in intro:
=========================================
DIY Amplifier: New video with MQTT coming soon!

You can help support this channel, or just say thanks, by buying me a cup of coffee at:

#mqtt #homeassistant #diyelectronics
Рекомендации по теме
Комментарии
Автор

This is one of the best if not the BEST 101 MQTT Home Assistant video on the net! 👏 👏 thank you for making it!! 🙏

RND-USA
Автор

Nicely explained.
I did look at using MQTT a couple of years ago, but it was above my understanding as a new user. Then I discovered ESPHome and never looked back. Finally now I'm moving into projects where I need to use C++, and MQTT seems the way to integrate them with HA. This video really helped me get my head around the nuts and bolts of it.
Thankyou for the time and effort you put into helping others like myself.

desparky
Автор

You read my mind. Really needed this, thanks for the great explanation.

running_rich
Автор

I've been using MQTT for about three years and didn't really understand it. Now I do. Thanks,

brianmorgan
Автор

Your explanations are the best. Thanks for starting simple and going complex. Home Assistant is the most powerful tool out there and the most flexible too. Your explanation of a countdown timer let me power up my solar powered greenhouse watering system. For this project I am going to use a Pi Zero, with a POE hat, to read the gage on my house propane tank. THANKS.

libertine
Автор

Thank you for your great video explaining how to set sensors and switches. I looked throughout YouTube 2 weeks ago for MQTT and HA videos; and not once your video was shown to me. Now, I come across it causally on their home tab; the proof the search engine is broken.

iqaznili
Автор

I have been using Home Assistant and MQTT. I develop ESP based devices. I love MQTT, but to retain or not has been one of those things where I play with it until it works, hopefully. However, even as you began to explain your thinking on when and how to use retain, I lightbulb went off! Thank you! That was an excellent concept and explanation. I have already fleshed out how I will implement my next device. If it works as well as I expect it to, I will go back and re-code my older devices and fix the little bits I now realize I CAN fix with this newer idea. I know I will change the implementation to suit my MQTT topic ideas, but the retain portion is great! And, again, Thank You!!

tajjej
Автор

*Amazing technically detailed explanation!* 😳
I so like such content!
Very thank you! 😀

cyberianoid
Автор

Thank you very much, these examples helped me a lot to get the MQTT integration on HA running.

ariedemuijnck
Автор

Never in my life would I have thought I'd not only be able to retain focus, but actually enjoy learning during a 30 minute video. Just for that you deserve a medal. I had a couple of projects lying around that I wanted to integrate and I figured using ESPhome was the way to go, until I found out having to upload their way of writing firmware was required. I like my C++ and wanted to be able to create projects without worrying if later I'd be able to integrate them should I wish to do so. Thank Google for letting me know MQTT existed and you for explaining it so well. The end part threw me for a bit of a loop but I figure that''ll be fine when I'm more versed in YAML. Thanks again.

yaronbakker
Автор

Great video!!! Thank you for posting!!

MrToy
Автор

Excellent video as always. Interesting how you separated out the status and commands. I may redesign how I am using MQTT based on this. ~Brian

brianjohnstone
Автор

Thanks. mqtt seems genious. Not only for homeassistant stuff. Suddenly all of my devices can communicate via the homeassistant unit.

And a great video b.t.w.

dr.ekkamer
Автор

Cheers That was helpfull. Gone dig into your channel some more. :-)

ronaldronald
Автор

Unbelievably useful 101 on MQTT. You have a gift for breaking down concepts into fundamental bits and setting the base to build further understanding on. Brilliant!

I'm new to HA and MQTT and am having trouble to find resources to explain the basics well in order to be able to use the vast amount of resources and examples that are already out there. This is by far the best explenation I've viewed or read.

The HA team should hire you to improve the existing support documentation and tutorials.

HansLaros
Автор

Hi, Thanks for creating this video.
I have a custom control system for my outside lights and greenhouse temperature monitoring using (Arduino) C++ on ESP32 dev boards and NodeRed running on a Raspberry Pi Zero 2W. I have been considering using Home Assistant for a while but thought it would be difficult to integrate with what I’ve got now. You have shown me that I can use HA with what I already have and expand my system to use proprietary devices (which hopefully will be less flaky than the ones I’ve made and programmed myself). Self programmed devices are never finished, their programs can always be improved (For ‘improved’ substitute ‘broken’) when I learn something new about C++. For some of my devices a bought device would work out of the box without me having to reinvent the wheel. I already have a Raspberry Pi 4b waiting for to be used for ‘something’.

SprocketN
Автор

This is a really good video. The overhead with transmitting a topic say in LoRaWAN seems expensive on the bandwidth. Do you know if you can transmit a raw data field only, that may have proprietary information (no topic stuff), on the RF side and then have a custom HA integration (???) that formats this into JSON which then can be written to the MQTT Broker? If so what would that integration be?
Thanks

tezlallc
Автор

Hi! Thx for the video! I'm struggling to find content about tasmota mqtt entitys without standard device class on HA (like MPU 6886 accelerometers/Gyros) and so, those entitys cant be shown on statistics with graphics. Could you give me some hint about how to solve it?

Tfmt
Автор

Thanks for this! Old hand at python/MQTT for my home alarms, but new to HA. Any chance you could post your yaml file? I would love to roll my whole system over to HA.

qwerughweiugrwiehrg
Автор

I still dine like HA over 7 years ago. I tried using home assistant for my diy projects. I end up using Node-red as it just worked even with Google in the end. Now, I can not start Node-red in HA. It just starts, then stops. People show off with HA and don't always show the code or how they got their stuff working.

chuxxsss