Home Assistant MariaDB Install and System Monitoring

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
ah did it again didn't i told you why you should do something but i didn't actually tell you how to do it hey guys and welcome back to another tech tutorial tuesday the series where you guys ask questions and i do my best to answer them as quickly and efficiently as possible and today at the request of a lot of you guys we are going to cover the mariadb and the systems monitoring install so in the previous video we covered my top six essential beginners tips for things to do after you've installed home assistant and i showed you quite a few things on and how to do them but one of the things i did not show you exactly how to do we just discussed it was how to install the mariadb and the systems monitoring integrations and if you don't know the systems monitoring integrations just allows you to keep an eye on your home assistant resources and the mariadb um sort of gives you a speed boost and a reliability boost into home assistant it'll allow you to load the history graphs more easily and quickly as well as the log books and it seems to be a lot more reliable than the standard sqlite database so that's what we're going to do today we're going to cover both of those in this one video firstly let's start off with the systems monitoring integration oh and very quickly if you like this video make sure to drop it like and get subscribed if you aren't already and if you want your question answered in the next tutorial tuesday make sure to leave it in the comments box down below and you never know might just answer it a very quick note before we jump into the home assistant configuration it's worth noting that you will lose your sensor data and sensor history none of the actual sensors will be lost or none of the integrations will be lost it's just simply the the previous history and the logbook entries you will lose them when you move over to mariadb with that said let's jump into the home system configuration and get the mariadb installed oh also also do not do the mariadb install if you're running a raspberry pi with an sd card if you're running an ssd you should be fine to go ahead but i suspect this may cause the sd card on the raspberry pi to wear out even quicker than it otherwise would if you're running a raspberry pi with an sd card then you should probably consider moving to an ssd as fast as you can but yeah do not do this on an sd card and yeah i promise we're actually gonna go into the home assistant configuration now firstly you want to head into the supervisor store click on add-ons and click on mariadb then hit install once installed i would suggest hitting the watchdog option but leaving the auto update off for this add-on head over into configuration and you'll notice some options are already pre-configured you can change these options if you want but for the purposes of this video we'll just leave them as stock except we need to set a password in the password field make sure to set this to something strong hit start and then head over to logs and hit the refresh button and you'll see some lines telling you that the mariadb is starting up and creating some new tables then we're going to head over to the home assistant configuration and enter a new database url but before we do that head to the documentation tab and grab these two lines of config from the bottom we could type these out manually but this is tech tutorial tuesday we ain't got time for that head over into your home assistant configuration and then paste in these lines we just copied the only thing we need to do is to change the password to the one that we set inside the add-on head over to configuration then general check your config as always and then hit the restart button once home assistant has reloaded you should now be moved over to mariadb you can confirm this by heading to the history page and you'll see the sensor data is now all very fresh and only goes back a minute or two and that's pretty much all there is to the mariadb install once you're happy everything is running there is one final tidy up that we want to do and that is to remove the old database file only do this once you're happy everything is working on mariadb the only thing you'll lose by deleting this file as i mentioned before is the sensor history and logbook data nothing else is deleted but just make sure you are happy with that you can find it inside your config folder and it's called homeassistantv2.db if you decide you don't want to run mariadb anymore simply remove those lines from the config restart your home assistant and a new database file will be generated the exact same as before and that's pretty much it for the mariadb installation hopefully you now have a much quicker load time on the history and logbook pages as well as much more reliability in the long run now that we've laid the foundations with our new database we can then go and install the systems monitoring integration so you can keep an eye on your home assistant head over into your home assistant configuration and we're going to add a few new sensors so define a new sensor block or use an existing one if you already have some sensors and we're going to use platform system monitor from there we need to add some resources to the monitor i'll give you the most useful ones here but there might be some more you want to add and you can get a full list of those in the home assistant docs the first three are pretty self-explanatory we have the processor usage which is a percentage of how much cpu is currently being used we have the processor temperature in degrees and the memory free in kilobytes a quick note on the processor temperature if you're running this in a virtual machine like i am for this demo then this sensor won't work because it doesn't have access to the hardware sensor inside the vm if you're using a raspberry pi or similar then you should be good to go there are ways to monitor the temperature of your host if you're inside a vm but it's a little bit out of scope for this video because there are tons of different virtualization platforms but you should be able to find a guide online which can hopefully help you to add it the next couple of resources are for monitoring disk usage you can optionally define which paths you want to monitor if you want but i'm just going to monitor the entire disk for this video if you omit the path argument then it will just monitor the whole disk now if we check our configuration and restart then head to dev tools and states you will now have a few new sensors which is good but you'll notice we haven't yet set up the network sensor yet and that's because we first need to retrieve the name of our adapter if you head into the terminal or ssh which you hopefully have enabled if you don't then check out my top six beginners tips video where we covered how to install it once you're at the terminal then use the ip address command and hit enter chances are this is going to generate a long list of interfaces one for each of the docker containers as well as the usual system interfaces if you know what you're looking for then you can find the information pretty easy but you can filter this list down by doing something like this using grep something to note here is that most wired adapters will start with en and if you're using a wireless adapter which i don't recommend by the way but if you are using one then it probably starts with wl once you add grip to your command your list should be much smaller and you can see in this example my adapter is called enp to s1 your adapter will vary slightly in name you can confirm you have the correct adapter name by checking the ip address associated to that adapter it should match your home assistant ip address take a note of your adapter name and then head back to your configuration file and we're going to add a couple new lines for throughput in and throughput out again there are other resources you can monitor here if you wish so make sure to check the docs you'll notice that i am adding the interface name that we got earlier this is important otherwise it won't work once done you can go ahead and check your config and restart again then head to devtools and states and confirm that has worked you should now see two sensors for throughput in and throughput out and that is pretty much it from here you can add cards to your dashboard so that you can keep an eye on things or you can create automation so you can get notified when certain sensors get out of control such as the cpu temperature and there we go that is pretty much all you need to do hopefully you now have a fresh new database running very quickly and most importantly reliably and you also have the ability to keep an eye on your home assistant and monitor everything that is going on but that is about all the time we have for this video that was a nice super quick and easy one today um hopefully you guys enjoyed it and you got something out of it at least and uh yeah let me know what you want me to cover in the next tech tutorial tuesday and if you want to support the channel you can do so by becoming a patron on patreon and your support allows me to keep on making these videos thank you to all my current supporters on patreon very much appreciate it thank you to you for watching make sure to drop a like and hit the subscribe button if you aren't already make sure to leave your um questions for the next tutorial in the comments box down below thank you so much for watching and i will see you in the next one
Info
Channel: Everything Smart Home
Views: 75,703
Rating: undefined out of 5
Keywords: home assistant, home assistant mariadb, home assistant database, mariadb, home assistant recorder, home assistant system monitor, home assistant monitoring, home assistant cpu, home assistant memory, home assistant disk usage, home assistant sqlite, smart home, home automation, home assistant setup, home assistant guide
Id: FbFyqQ3He7M
Channel Id: undefined
Length: 9min 35sec (575 seconds)
Published: Tue Mar 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.