Home Assistant MQTT Broker Install

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
mqtt is a messaging protocol used by iot devices and it opens up a lot of possibilities for home assistant now it doesn't need any additional hardware because it can take about a year existing computer network but it does require a broker something which is going to basically act as a post office for all of the messages being exchanged now fortunately home assistant does actually come supplied with an mqtt broker add-on but how do you install that software and configure it well that's something that you're interested in finding out then stick around and watch this video because that's what we'll be going over [Music] now the first thing to do is to install the mqtt broker add-on now i'm running the latest version of home assistant as of the time of recording and the layout has actually changed fairly recently but it hasn't changed that much so in my case instead of clicking on configuration for instance i'm going to click on settings and then i'm going to go to add-ons then down here i'm going to click on add-on store and then what we're interested in is this mosquito broga an open source mqtt broker so we'll click on that and then what i'm going to do is just click on install and then off it'll go and install the actual software then once that's installed i'll bring you back well the add-on is now installed so it's a matter of configuring the broker before we actually start it so here on the main page by default it's set to start on boost so that's good but we do want to enable the watchdog feature that way if the software were to crash for whatever reason home assistant will try and restart it again now on the configuration tab i'm not going to make any changes i mean i would like to enable the option uh for ssl tls certificates to give me encryption i mean that's something the actual developer of mqtt strongly recommends the only problem i'm finding is that there are certain projects out there for instance that don't support this in which case there's no point me enabling the feature if i can't use it anyway when it comes to the logins you can actually create users within home assistant set itself and actually take advantage of those rather than putting them in here that to me makes more sense having a central storage for your users and having each individual add-on having its own users basically i mean there are other options you can change for instance the ports but as far as i'm concerned i'm just going to leave these all at the default settings so we'll go back to the info tab and then we'll click on the start button and that'll start the actual software now there is some additional software to still install on home assistant but before i do that i'm going to create a user account because i don't like to use default accounts or building accounts so i'm going to click settings then i'm going to click people then add person i'm going to give this a name that i can recognize it by you can use something different if you like and i need to select this option allowed person to log in because they need to be able to log into home assistant i'm going to change the username then you can use something different to what i'm using i would suggest using something a lot stronger more complicated than what i'm using for the password and i would suggest actually selecting that option as well can only log in from the local network we don't need admin rights to home assistant but we do need this um account to be able to log in to home assistant but only from the local network i mean it's a it's a bad practice to actually allow direct access to your internal computers from the internet anywhere to be honest you really shouldn't be setting a port forwarding so you can remotely manage your actual home assistant for instance but regardless in this particular case this actual account is only a local but you know it only has local purposes anyway i don't want that risk of somebody from the internet being able to log into home assistant anyway so this is a nice extra feature to have by enabling this if somebody were to somehow get the ability to try and log in to home assistant over the internet this option is an extra step to try and prevent that from happening so what we're going to do is click create and then create again and then that creates our user account so the next thing to do is to install the mqdt integration software so we'll click on settings then we'll go to devices and services as you can see home home assistant's already discovered this possible integration might be interested in mqdt if it doesn't what you can do is click on add integration and what it does it brings up a list of known integrations and you can filter that out for instance and select mqtt from there now case it's already discovered that it's an option so we're just going to click on configure and then i'm going to click on submit then i'm going to click on finish and that installs the integration software but i don't want to use the the built-in account that it's trying to use so i'm going to click on configure then i'm going to click reconfigure mqdt then down here where we've got the username i'm going to replace that i'm going to use the account that i created earlier i'm going to change the password as well now we do have options for things like qos in a reliable network so far i haven't really encountered any particular issues um normally qos is when there are problems but in my case i haven't really experienced any issues to really justify using qos yet so at this stage i'm just leaving these settings as the defaults of zero so i'm going to click on submit then i'm going to click on finish then the last thing i'm going to do is go back to settings add-ons i'm going to select the mosquito broker because i want to restart this service so i'll click restart and that restarts it so that that basically gets all of the software installed that we need for home assistant and then we can start using devices to connect into that mqtt broker now one last thing i'd like to do is to create a separate user account for the actual devices that are going to connect to this broker so to do that we're going to go to settings then to people then we'll click on add person so in this case i'm going to call this one mqdt client for example we'll click on allow personal login because they do need to be able to log in to home assistant it's going to change that username and we'll provide it with a password and i'm going to select this option can only log in from the local network for the same reasons as before so then we'll click create and then create again so the idea is that whenever we set up a device that needs to talk to the mqtt broker we'll be using the credentials from that account now the best security practices to actually have a completely separate username and password for every single device that's out there but when we're talking about iot devices i think that's getting a bit impractical so that's the reason i've got two accounts one specifically for home assistant to be able to connect in and once for the actual devices themselves now if you're going to be using mqtt then there is one piece of software that i would recommend you download and install and that's this mqtt explorer by quest so that's the url i'll include it in the description as well and very easy to install and as you can see it supports quite a few different platforms so download the actual version that's suitable for your computer install that and then you'll be able to connect into the actual mqtt broker that we've created so i've already downloaded that for this linux computer so i'm just going to go to the application i've already set up a connection but just basically click the plus sign here then you fill in the details so i've called this aha broker i've disabled the option to validate the certificate which is enabled by default because the actual broker comes with its own self-signed certificate and we don't want to be trying to validate that because it's not going to work anyway so unless you've changed that then you do want to disable this feature the protocol it set the mqtt by default so i don't need to change that in here where it's got host either give it the fqdn or the ip address so it depends on you know what your network supports whether you've got a dns server or not the port by default to set the 1883. i mean there is an option for encryption but like i was saying earlier i know there are systems out there that don't support anyway so i haven't enabled that option so i'm just going to stick with a normal and encrypted session on port 1883 then we've got our username and password to log into the broker with now i've actually created a completely different user account for this demonstration i just want to show how you can actually set up an actual client as an example but i've had to create a separate account simply because this computer is a management computer and it's on a different network and that means if i try to connect in as mqtt client i'll get refused access because we're on a different network and that account does not allow connections from outside of the network it's really intended for smart devices that are in the same network as home assistant hence why it's refusing the access so in this case i've created this user account here it doesn't have those same restrictions so i can just click on connect and it'll then connect into the actual broker now there isn't any devices here there are posting information so i can't show that but at least what i can show you is how to actually set up a device the sort of information you need to give it but in this case just a simple walkthrough where it's kind of similar to windows explorer just like you would open up full folders to get access into subfolders and dig deeper you just do the same here just clicking on these little arrows to find more and more information but the good thing about this is it's very very useful for troubleshooting but also finding information sort of information the actual devices that are actually going to be posting to the broker so for example with es presence that posts information about the sort of devices that it discovers and you can find that information uh from the broadcast you don't necessarily have to connect into the actual base station itself you can get that through explorer for instance so very useful piece of software and that's why i recommend you do download and install it well thanks for making it to the end of this video i really do hope you found it useful if so then do click the like button and share as that'll help get the video out to more people who might find it useful as well if you've got any comments or suggestions please post those in the comments section below and if you're new to the channel and you'd like to see more content like this then yes do subscribe just remember to set the bell icon to actually send your notifications when new content gets released although i also post to twitter as well as facebook if you'd like to help channel and support it you can actually make contributions through paypal and buy me a coffee i've also got links to patreon and there's also the join membership option for youtube itself patreon and youtube members do have the option to actually benefit from early access as well but above all many thanks for watching this video i'll see you in the next one [Music] you
Info
Channel: Tech Tutorials - David McKone
Views: 29,988
Rating: undefined out of 5
Keywords: mqtt protocol, mqtt home assistant, mqtt esp32, mqtt home assistant configuration, mqtt home automation, mqtt home assistant broker, mqtt home assistant example, mqtt home assistant sensor, home assistant mqtt setup, home assistant mqtt sensor, home assistant mqtt automation, home assistant mqtt broker setup, home assistant mqtt broker, home assistant mqtt settings, home assistant mqtt url, home assistant mqtt address, mqtt broker homeassistant, home assistant mqtt install
Id: 8ol5pO7ZZhk
Channel Id: undefined
Length: 11min 30sec (690 seconds)
Published: Fri May 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.