5 Home Assistant Built-In Integrations You Probably Should be Using

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to talk about five built-in home assistant integrations that can really help simplify your automations and scripts and perhaps even get you closer to living in that true smart home and chances are there's at least one of these you're not using today so stick around because we're about to automate some boring stuff [Music] welcome back to slacker labs my name is jeff today we're talking about five built-in home assistant integrations you may not be using and we're gonna go through how they could help you on your smart home journey if you're looking to build that true smart home that relies on automation then these integrations could do some of the heavy lifting for you by performing math eliminating repetition and even providing some of that much needed context that could take your automations from just flipping switches to actually deciding which switches they need to flip now of course we're only covering five here so this is not meant to be an exhaustive list and this is probably not even the best or the top five integrations built into home assistant but i do find these five integrations to be quite useful in my automations so i'm hoping that you might find some use in them as well so with that let's cover the five built-in integrations that could come in handy when building a smart home with home assistant [Music] okay first up is the time of day sensor this sensor on the surface may seem a bit meh after all you can trigger automations based on time or the position of the sun already but the time of day sensor allows you to define sections of the day that make sense to you and in my setup i currently have six of these defined and unfortunately you can't define this via the ui so you're looking at raw unfiltered yaml here you would add this bit of code to your binary underscore sensor.yaml file if you have one of those or under your binary underscore sensor colon heading in your configuration.yaml platform is tod for times of day and the first two here are simply based on the position of the sun night i defined as the period between sunset and sunrise and day is the time between sunrise and sunset you could also include an offset here if for example you want to include 30 minutes prior to sunset in what you call night but you could also define it based on time so in my house quiet time is defined as 9 pm until 6 am and if you've already caught on these can overlap all this integration does is create binary sensors for each one of these definitions and they'll be either on or off so binary underscore sensor dot quiet underscore time will be on between 9 pm and 6 am and from there i can use this as a condition for my notifications to either not allow general audible notifications to occur when quiet time is on or perhaps simply adjust the volume when i'm playing the messages based on the time of day again you can define whatever makes sense to you here maybe you want to define a portion of the day as workout so that you can have home assistant trigger your workout routine when that binary sensor turns on or you could define the time period during the day in which your kids are at school allowing home assistant to have some context of when school is in session but i find this sensor to be really useful as conditions in a choose action of an automation and the times of day sensor allows me to define sections of the day in more general terms as opposed to using specific times [Music] i almost didn't include the workday sensor since it's closely related to the times of day sensor but this one comes in handy when you want to automatically adjust when your automations fire based on whether it's a work day or a non-work day and the workday sensor is aware of holidays in your region so you don't have to worry about a separate holiday sensor to take advantage of this sensor though you're once again going to have to sling some yaml this workday sensor is a binary sensor so it'll be located in the same place as the times of day sensor platform is workday and you'll need to define a region and a providence so it knows your holidays and you should define your work days since you may not work monday through friday now you may have more holidays than the official ones so you have the ability to define custom holidays using either the date or the name and you can exclude certain holidays if for whatever reason you have to work on specific holidays after that restart and you'll have a workday sensor that will be on for the days that you've defined as long as it's not a holiday this sensor is perfect for using as a condition in an automation or even as a choose condition allowing you to write an alarm automation that only triggers on actual work days or to customize a morning notification so that it only provides traffic to you on days that you're having to go into the office again not a super wild integration here but it does allow you to write smarter automations and let home assistant make decisions based on whether it's a workday or not meaning you don't have to go in and manually adjust your automations if you want to change one based on those conditions [Music] i can't remember if we've talked about this little helper in my past videos but it is one of the first helpers i started to leverage when i started looking for ways to write smarter automations setting up this helper is easy and you can do that in your configuration menu under helpers just choose whether you want to use it to store a date or a time or both in my smart home i have quite a few automations that trigger at specific times now i could have hard coded those times in my automations but if i wanted to adjust that automation later i would have to edit the automation and frankly that's boring stuff and not easy for other members in my house to do so in cases where i wanted an automation to trigger at a specific time i used an input date time as the trigger and then added it to my ui so that making changes doesn't require a lot of effort in fact you can do it right on the dashboard like here on this config page i've set up in home assistant all of the date times you see here on this page are used as triggers for automations for example my kid has two different bed times based on whether he has school the next day or not and when we need to change his bedtime we just adjust it here and then the automation triggers at that specific time now of course this means that this automation fires twice every day but with the choose action i can define another condition so if it's not school tomorrow it just skips that action at that time and in some cases i have an automation that's only job is to look at the criteria and then set the input date time to the correct time each day for example here's an automation i have that sets the good morning time which handles the lighting each day here it's looking at whether it's a school day and if it's not then it checks to see if it's a work day and if it's not that either then it sets the time to the last option this means that the trigger time for the morning lighting automation changes based on the calendar and workday sensor and it requires zero input from us of course all of this takes extra work when you're setting up your automations because you would have to define an input date time for each of these automations but at the end it allows you to write smarter automations that require less effort in the future to update and you did it all using built-in tools now we're getting into more informational integrations and the math portion of this video and the next two integrations complement each other nicely [Music] first up history stats can let you know how long an entity was in a particular state for a period of time so if you want to know how long your hvac ran over the last 24 hours or how many times your front door was opened in the last week this is the sensor you need the data it can provide breaks down into three groups time which is the amount of time it was in this state ratio which is the percentage of time it was in the state divided by the length of time it was monitoring and count which is the number of times the entity changed to the state you're tracking setting it up can be a bit confusing so let's walk through it and just to keep things basic and not in the typical slacker labs overly complicated i'm going to use the documentation setting up this sensor will be defined in your sensor section or your sensor.yaml whichever one you have there's no ui option here platform is history stats name is what you want this sensor to be called entity id is the name of the entity you want to track state is the state you want to track for example on or maybe running type is one of the three types we mentioned before and then you need at least two of the following a start time an end time and duration these will define the time period you're monitoring thankfully the docs provide quite a few examples of time periods and my guess is most of what you are looking to do could be found here and just copied like yesterday today or last 30 days and if not hopefully you got enough from these examples to roll your own once you have that set up and you've restarted you get some stats for example in my system i have a washer time that tells me how long the washer has ran in the last seven days so that home assistant can tweet it out because i'm a geek and more recently front door motion which counts the number of times the front door motion sensor switched on which is useful but what if i wanted to know how many times the front door motion sensor came on in the last 15 minutes that's where the next integration comes in [Music] i think the utility meter integration on this list might be the most underutilized integration in home assistant the utility meter integration allows you to create a sensor that monitors power usage over a period of time at least i think that's what its intended purpose was based on its name and you could totally use it for that to set this up simply define the utility meter section in your configuration.yaml then you need a source which will be the sensor or entity you want to track and cycle cycle is the time period and it can be quarterly hour all the way up to yearly what makes this useful is that it does math for you let's say you have a smart plug that reports power consumption in kilowatt hours and just keeps a running total so every time you look at the sensor you get the total power this plug has used since the beginning of time or at least until its buffer ran out and the counter went back to zero but what if you wanted to know how much power this plug has used in the last week so that home assistant can let you know if it's using more than the previous week just set up a sensor that looks at your power sensor and define the cycle or time period you want to track but since we're doing this in home assistant we don't have to exactly follow the rules in fact in smart home there are more guidelines than actual rules the front door motion counter we created with history stats can now be made more useful by pointing this integration at it and we can get the hourly count of the motion at the front door if you have a local rain gauge integrated directly into home assistant this integration can give you a daily and weekly rainfall sensor if you wanted to track how much power your washing machine used every day define it as daily washing machine power and set the cycle to daily this integration like some of the others is not based on your history data though so it will start from zero when you add it but once it's run for two cycles you'll get both the current period and the last period from there you could create automations that trigger based on large changes in sensor value between the current cycle and the previous cycle and you wouldn't have to do any of that math home assistant would do it for you or perhaps just use that data as context to make your automation smarter in any case i hope this brief look at these five integrations get you a little closer to the smart home of your dreams if you found this video useful hit that like button and consider subscribing to my channel if you haven't already for more smart home content like this let me know in the comments if any of these integrations sparked new ideas for automations in your smart home and as always thanks for taking time out of your smart home projects to watch mine until next time go automate the boring stuff [Music] you
Info
Channel: SlackerLabs
Views: 16,481
Rating: 4.9467378 out of 5
Keywords: home assistant, smart home, home automation, raspberry pi, lovelace, yaml, scripts, home assistant automation examples, home assistant basics, home assistant for beginners, home assistant guide, home automation ideas, home assistant tutorial, home assistant beginner's guide, smart home ideas, beginner's guide, home assistant scripts, home assistant integrations, home assistant tips and tricks, smart home tips and tricks, Get more out of home assistant, home assistant setup
Id: QZB_o62AuV0
Channel Id: undefined
Length: 12min 44sec (764 seconds)
Published: Tue Oct 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.