Home automation System Monitor and Speedtest Dashboard Tutorial using Home Assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey it's Joe fourth key toolkit and today we're gonna do something different home automation not only can we control a home but it's nice to be able to monitor the home and in this case we're going to talk about monitoring systems that are running the home this is my home assistant monitoring to make sure that the computer the Raspberry Pi actually that's running it is doing ok and this side I'm going to talk about using speedtest.net and measuring my internet health to make sure my Internet's ok the reason these are really important to me is my home automation system runs on a PI 3 be a Raspberry Pi 3 be is not really considered a super powerful computer anymore there's the 4 that's out the B+ was an upgrade so I was kind of curious do I need to upgrade that to a full PC or a 3 B+ and what I think you'll find from this tutorial is how to get the data to understand from your home automation system how to monitor it to know if you need to upgrade or when you need to upgrade on the internet side I work from home quite a bit right now due to the corona virus and I've had suspicions that my internet performance hasn't been consistent so this here will help me understand where my internet is right now and also I can monitor it over time the other thing we're going to talk about is how to build a graph on a dashboard well it's nice to have an at-a-glance to figure out where your stuff is this is very useful to understand where it is over time so for instance here I can see my processor is at 6% but how has it been over the last 24 hours and I can get a feel for do I have enough computer my Raspberry Pi has done quite well handling the home automation load and respect it's barely even stretching itself with about 6 to 10% usage the other thing I can see here this is my internet over time and I can see that I've actually do have some glitches where my speed goes down dramatically and so it's not just my imagination I do have something going on with my internet and it gives me a data point that I can investigate further now what I'll do is probably monitor this over the next couple weeks and try to see if there's any trends or if I see any consistent times from memory the Raspberry Pi fours have a couple different memory configurations I can see that I'm using about half the memory at any given time there's one gigabyte on the Raspberry Pi 3 I'm using these spikes all correlate to the speed test running and they're very short so I'm ok there so I can tell that my hardware is running my home animation system just fine with these graphs the first thing we want to talk about is the integration for the system monitor system monitor is a built-in integration it actually comes in two home assistant as a sensor typically what I start out with is I go to the home automation integration page and then I just paste it in here to start out and this gives me my spacing kind of the basics here so I can see I've got my disk use percent and argh there's another one from memory free but what I want to do is if you scroll down here you'll see that there's all of these things there's stuff for networking this one here is one I really care about what is my processor usage at any given time and it's basically just processor underscore use so what I will do here is add in type process or underscore use and I can see that that needs to be spaced out now I watch this green checkmark over here real closely to make sure that I don't have any errors because keep in mind if you corrupt this it kind of puts you in a rough state once you have it where you want it you're gonna hit save and then you'll go to your supervisor system and reboot the next one want to set up is speedtest.net and again to keep consistent we're gonna go to that page now this one has a trick to it and it actually took me a second to figure out so we'll just copy and paste this into our configuration file here and the thing I found out once you do this is it doesn't work if you do some searches you'll find that there's actually been a problem with speedtest.net for a while on a lot of machines the reason being is you have to specify a server ID and the way you do that is you indent in and you put a server ID like that in so now the question is where do you get this mad number what is this number map to and I'm gonna put this page in the comments this is basically the XML file of all of the servers that speedtest.net uses one of the things that makes speedtest.net so powerful is it's got servers all over the world and that really helps you get accurate speed and latency information so you're gonna want to find a server that's next to you so I just did um as a sample like search for Houston here's the the server next to Houston and this is the ISP that it's working through but there's the magic number there's the ID number and you would put that into your home assistant right here that seems to make speedtest.net work otherwise I was getting undefined and it was never updating by default this will update every hour if you want to have it go more than every hour there's a couple of settings here a scan interval and like I said there's a default of 60 minutes now once you have these the next thing to do is to figure out how to pull them in so services right here speedtest.net actually has a service to rent to run the speed test more than once an hour it has a way of doing it manually matter of fact one of the settings for it is to set it as manual so that it only runs when you want it to I like to have it every hour but I also like to have the ability to run it manually as well for here if we do if we search for things like disk we see the entity ID that we're looking for here sensor disk use % home this is how the system monitor on let's see the system monitor shows up if I do processor there's processor usage and the other one we want to search for let's say it's a gated memory yeah memory usage sensor dot memory use these any of these IDs are important to know because we're gonna use them when we go build our UI and so typically what I'll do is go to developer tools and search through here to see what shows up so the next thing we're going to do is actually build out our lovelace UI to look like this here and this is very simple we're gonna configure you I will start out from scratch we'll call it system monitor demo and here it is and now we can start adding our our UI the reason I'm showing this is you're gonna probably want different things than I picked so I just want you to understand okay you know you you're gonna select them and then here you gonna build out your UI for them for the gauge let's see the disk usage one that's how I did the the gauge for disk usage you can give it a different name here so if you want it to be friendlier whatever you type here will show up underneath and then you get to choose your minimum maximum you can also do severity which is kind of cool so I can say if it gets over 75% make it red if it's over 50% make it yellow and if it's 0 its green and then I actually get color coding here and I can change these values to whatever I want and there we go there's our first gauge so what we're going to do now is just build this out okay on the other side we're gonna want to talk about the speed test stuff and we can do it as a gauge as well for now so if I type start typing speed test you see they show up there's the download paying and upload now the download and upload being a gauge is no no big deal but the other one the ping I'm gonna show you something a little bit different so there's download and upload for ping we're gonna do a history graph and what that will do is we can get a nice graph here of how it's going over time we can do that with any of them but I just thought it was a little bit a cooler way of showing it now as I said the speed test only happens once an hour so we're gonna want to have a way of calling the service to overload this and I showed you where the service was how do we call a service well we're gonna add a button and as we add this button will learn a couple of interesting things so here's the default we don't need a hold action so we can delete that right off the bat for the tap action we're gonna want call service and the service will put underneath here it's gonna be speedtest.net speed test we need an icon and the icon is interesting because I typically see something like MDI : and I wanted to understand how do you know what your icon choices are well if you go to a material design icons com this is where the MDI comes from and you can search for things so if I search for Speed I will get some icons and the ones that are circled in orange are basically open-source they're there from the community I can actually click on that and actually filter everything down to only those which is nice so let's see so I'll do a speed here you see there's a ton of icons too it's just quite a bit so these are all open source so on this one here if I mouse over it says or its pedometer right there it is speedometer and that's what the icons look like and so to make that icon show up here I can I can say MDI speedometer and there it is and so now my button has basically an icon here I don't need state color show name I want on there that that would be good if we're gonna do that then we should probably give it a name and it's run speed tests and you see that showing up down here so that's how I set my icon and everything it will call service when it's hit I hit save and there we go so now I've got a manual button override for my speed test got a little history graph for our ping so this is where we're going to build in Griffon a-- basically the three charts for a memory processor and disk and then speed test here very simple dashboard so we'll start here we're gonna create a new dashboard we'll add a query and one of the key things we need to know is what the measurement is so the way we're gonna find that out is we'll go and add the end of the ID and we'll search for it here so let's do a speed test stop first there's speed test download and once you fill this in here we can then go to measurement and it will give us it will filter it down for us which is really really nice now again we see our dots we can do fill nut or I'm sorry yeah fill none and it will connect the dots the problem is this implies that the speed actually went down like the speed was this value between here and that's not really how speed tests work speed test works once an hour so there's a different setting here when you say fill we can say zero because this really what's happening we do a speed test and then nothing and then we do a speed test and so this is more representative of how things are working now I want to do the download and upload on the same graph so I'm gonna add another query and I should this before any of the ID we're gonna do is be test let's see that was downloads we'll do upload here yeah download and upload and so now the upload speed will get applied over it the other thing is if I want to change this down here let's see also make this philsie row oh and a measurement we gonna do measurement there we go we're gonna want these to be something more meaningful so I'm gonna say download speed for an alias and you'll see it get updated there and I'll say upload speed here and now I have a nice clean basically legend for my graph here the panel title is on the third one down here we'll say speed test and there we go we've got our speed test one up and running let's do the other ones real quick again you're gonna see the pattern we'll do it one more time and then we'll go fast for this one processor usage then they go the measurement and see it's percentage [Music] fill none to get that filled in and then give it a name here third one here processor there we go remember it we can rearrange these okay I'm going to go fast for the next two you there we go there's my dashboard something else to keep in mind is you probably don't want last six hours for these you're probably gonna want a lot longer time range to see how things are really going day by day and you know there you go so what can we do with this now now I can look at my processor usage and see do I need to upgrade my home automation system or I can look for anything that might be affecting the health of it maybe a badly performing module stuff like that my internet speed if my internet speed seems to be slow I can do this over the next couple weeks and really get a feel for how my performances I can also start should see if I can get other data points to correlate to what's going on when I see something like this here where it goes drops down quite a bit at 5:00 p.m. and the other thing I can do is start seeing does it happen every day at 5:00 p.m. like is there any kind of a pattern to the the loss there's the next video is gonna be getting this working on them on the magic mirror I know I promised that in the last video but I wanted to have a little bit cooler data data and honestly with the coronavirus putting me at home I was hitting issues that I needed solved and I needed this data now so I had to put it before that video thank you so much I appreciate all the likes in the positive comments in the community support I will talk to you in the next video [Music]
Info
Channel: GeekToolkit
Views: 16,008
Rating: 4.9595962 out of 5
Keywords: home automation, home assistant, tutorial, Grafana, Influxdb, Dashboard, beginners, System Monitor, Speedtest.net, Integrations, smart home, home automation ideas
Id: gBBCzKZIehw
Channel Id: undefined
Length: 15min 32sec (932 seconds)
Published: Sat Mar 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.