Actionable Notifications in Home Assistant Automations.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] it's your open source advocate and i'm back with another video today i wanted to talk about actionable notifications so whenever you actually have home assistant setup and you're using it on your mobile device one of the best things about that is you can actually generate notifications to go to your device and i think i've shown this in some other videos but if not we'll we'll get there but i want to introduce it today fully and kind of show you how to set those up and what you can do with them and they've really improved this recently so that setting up for ios or android is really the same process it used to have a little bit more setup on the ios side it does still look like from the documentation there are more options on the ios side but i think android will catch up pretty quickly so hold out for that if you're android users i do have an ios device today that we're going to test with so inside of home assistant we're going to jump over to our notification or our automations in order to kind of set this up and one thing you want to make sure you have set up first is that you have your your ios device assigned to a person so we'll get into all the setup and we'll get into how to do that in just a second first i want to say thank you so much to all my patrons over at patreon i truly appreciate your support and all of my subscribers at youtube i really appreciate everything you guys do by watching my videos every week and give me those thumbs up if you haven't already click the thumbs up button click subscribe click the little bell icon so you'll get notified when i put out new videos and then if you if you really want to support me jump over to patreon and pledge a little bit of money every month that just helps me keep this going it helps me get these videos going it helps me do giveaways like i'm doing here in a few days and it just keeps things moving for me and it just encourages me so much and i appreciate it i love doing this for you guys i hope you get a lot out of it let's get on with the video okay so first thing you want to do is go over to configuration and just make sure that you have a device set up for your user so you can scroll down to people and then here you see i've got several people but for me i'm just going to click and you'll see right here that i've got two devices actually with the app on it and they're set up for me as a user but any user you want to have a device assigned to in your system that want that you want to be able to get notifications make sure they've got a device assigned and then at least with ios make sure before you even set up that device save yourself some headaches and go into their settings into the general section about and then touch the name of the iphone because it's probably just iphone by default it might be like iphone se or something like that but it's a generic name rename it to like you know whoever's phone it is because that will help separate it inside of a home assistant and make the notifications work much more smoothly it took me a while to work that out because i had added my mother my mother-in-law both of their phones were called iphone and neither one of them would get notifications for some reason so i've renamed everybody's iphones in here just to make it easier for for a home assistant to give those notifications so make sure you've done this and that you've used this little area down here to assign a device to a person and once you've got that then you're able to send notifications to a specific person or to everybody and we'll jump into how to do that right now so next you're going to go to configuration you're going to go down here to automation so i'll show you an automation that i have a couple of automations i have set up so one thing is my office ac is just a window unit ac that i use a smart plug to control the on and off i don't have a temperature sensor yet but i'm getting ready to build one i'm excited about that but i don't have one yet that really controls this so i just kind of turn it on during the day when i'm in here and then sometimes i leave and leave it running because i have computer equipment in here and it's really hot where i live you know it gets up around 110 115 degrees all day long even late into the night you know it'll be over 100 degrees so i'll leave it running but about 9 o'clock i like to know that it's still running so i can turn it off because i do want to turn it off and and save some electricity um so i have this thing called ios turn off turn off this ac off um basically this one's off but then i have this one down here called notify if ac is still on and here you'll see i have notify if alarms not set by nine by 8 30. so basically this notifies my wife whenever we have to be away from the house which in the pandemic hasn't been a lot but we've had to go to a couple things for my dad for for medical reasons out of town and it leaves her mom and my mom here by her by their self we wanted to make sure they got the alarm set in the evening like they're supposed to um so this thing would notify her by 8 30 if they hadn't said it so she could call them and say hey why have you not set the alarm yet and kind of remind them she can also set it from here i can turn off the ac from this one and then i have one that's set up for my dad where i set up a shelly button for him um he can't see he's blind he's 87 he does a lot of things on his own he is very much a person who can do things on his own still but sometimes he does need help he'll drop something and he can't find it you know things like that so he'll need to call for help and he had this little horn that he would use and one day he fell but he was able to reach and grab the horn and he was blowing it well it sounded like a cat dying and we hadn't heard this thing in years so we didn't even remember what it was when we heard it we weren't sure what the noise was and finally it dawned on us that it was him so that kind of freaked me out so i set him up a button where he just presses the button and it sends us a notification to everybody's phone that hey dad needs help and we go in there and uh you know it's a really great system my mother-in-law was in 350 miles away from here for a couple of weeks and he pushed it one night and we went in there but she went ahead and called us to tell us hey i got this notification if you checked on him just to make sure he was okay so it works really well so notifications are a super useful tool inside of home assistant for so many things and i'm sure you can come up with a hundred other reasons to do it but i'm gonna walk you through how i set up the ac stuff so we're gonna go down here on the right we're gonna click create a new uh automation we're just gonna click into a blank one and we'll give it a name i'm gonna call this turn off ac now um or actually notify so we'll just call it notify so i try to give it a name so i know kind of what it does when i'm looking at it you can give it a longer description if you want to but it's not necessary now for the first trigger i want this to be that my device is still on at a certain time so i'm going to say state i'm going to say time actually i need it i need to set this as a time trigger so at a time and it's a fixed time now you can set up other types of times you can check documentation for how to do it i'm just going to set this i just need to look at the current time actually to make sure i get it right it's 1107 so let's just say i might have this done by 11 12 am here and that that's it so 11 12 am my time conditions so i'm going to set a condition here that my device which is my office ac actually i'm going to set it as a state so we'll set the state of the device is on and this is ac unit uh should be here somewhere there it is so the ac unit no that's the switch ac unit yeah that's right that's what i want um and the state is on so we're going to do a little on here so i'm sorry it takes me a second to kind of remember what to do here but state pick the switch that you want and it's in the on state so we've got a time so at 11 12 a.m if this thing is on i want it to do something so in this case i want it to send me a notification the way you do this is you say call service and the service is notify and you'll notice as you type you get these options and you can see i could i could notify just me if i want to send it to everybody i can type in notify.notify and that's a send a notification to everyone with with notify options so if they have a device and it's set up for them they'll get it in this case i just wanted to go to me i don't want to bother everybody else so i'm going to click on just my iphone and it's going to send me this notification and then you see here you get some more options so the message i want is office ac unit is still running and then you can give it a title so if you want to make a little shorter title you can just say office ac on something simple the target i'm not using yet but we're going to do data so i'm going to say data actually we'll just we'll just start with this start with this message and title we're just going to say let's just make sure we get the notification so i'm going to save that okay now i'm going to go up here and we can actually just run a test to make sure we get the notifications so let me record my phone screen here yes it is running and i'm going to click the button and you see i get the notification and if i tap it doesn't really do anything but i can swipe down to get rid of it and that's really an ios notification if you just need something to give you a notification there you go you're done notification came i got it and i can dismiss it that's what i do with the one like where my dad pushes the button it's just a notification to tell us he needs help there's nothing else to do there's no other action to take it really just does exactly what we said so the next thing we want to do is actually take an action so i get the notification great but now i want to actually be able to turn off the air conditioner from my phone from from the notification so i'm going to go down here to the data section i'm going to check that little box and over here we're going to write a little bit of yaml code but it's not that bad so we're going to type in actions with an s and then colon we're going to hit a return and hit two spaces and then a hyphen and a space and then action without the s and i'm going to give this a name so this name needs to be something unique because it's going to be a name that you reference to actually call the action here in a minute so make sure you make this kind of unique i'm going to call this office let's see office unit off and make sure you check your spelling and capitalization because that will matter we're going to go out here and we're going to put title right under action and this is really what you want to show up on the button so i'm going to say turn yeah turn off ac this is my action this is what's going to show up under the button everything should work like this i'm going to go ahead and save it and we'll test it so it's probably about to go off on its own but we're going to start recording and i'm going to move up and we are recording the screen and i'm going to send that notification and it's there now if i tap and hold you see i get that little button below that says turn off ac now if i tap it it's not going to do anything yet because that action doesn't have anything to say hey i did something so there's my actual timed notification again i can tap and hold it i can tap on turn off ac so we'll change that time here in a minute so it goes off again for us but it did work on the timer which is what we want now of course i wouldn't set it at 11 12 am that's when i want the thing to be running but for our purposes it works which is great so we set this up and we've got a button that creates an action so the cool thing is used to you had to go through go from home assistant and go now set up another automation that this thing called to turn off the ac but in this case we don't have to do that anymore we can add another action so we're going to add an action we're going to go down here and we're going to set a we're going to set a wait for trigger so right here we're going to tell the system okay now we're going to wait for this trigger so this button so this action happens and then we say okay now wait for a trigger which would be us touching this button now it has a timeout i would suggest that you set that you know if you haven't done it within about 30 seconds you know move on basically this keeps your system from getting locked up so i'm going to hit 60 i can always open up home assistant and close you know turn off the air conditioning unit if i need to if i don't see it right away so you set this for 30 seconds 60 seconds but this is in seconds and then you're gonna say continue on time out which means the system just keeps running afterwards now we're going to add our trigger and we're going to say okay we get this event the event type is in our case ios dot notification action fired and on the event data we're gonna put action name with a capital n for name colon and it's going to be this name that we gave it right up here so we can just copy that to make sure we get it correct so i'm going to copy it i'm going to paste it right there so it's exactly the same and if you only want this to be something that a certain user can do so you may be sending the notification to everybody but only one user can take this action you could pick that here i don't think it makes a lot of sense just send it to the person you want to be able to do whatever it is they're going to do with it but maybe there's reasons for that that you might think of and then we're going to say now add an action so once that happens what do i want i want a device that device is the ac unit in the office and i want it to turn off so i'm going to save this i'm going to go back up here to my time because we expired my time while ago and we're just going to change this to another minute here and we'll change this to 11 17 that should give me time to save and get the phone into a recording state okay we're going to use that i'm going to give it a few seconds here and then i'll start recording the screen now i don't have to cut down so much of the recording there it is now i'm just going to tap and hold and you'll see i get the turn off ac i hit it now i don't know if you can hear it in the background but the ac did turn off now it's really hot so i'm going to jump back over here and turn it right back on because it's too hot to not have it running i apologize if that creates a lot of noise in the background i hope that it doesn't with the mic set up the way it is but there you go we've created an actionable notification which is really great when you think about all the things that you could do in your house to kind of double check triple check what's going on with your smart home i think actionable notifications are an amazing feature i'm super excited about it i hope that you will be too if you enjoyed this video like subscribe tell your friends about it so they can come along in the journey with us and i'll talk to you next time
Info
Channel: Awesome Open Source
Views: 11,976
Rating: undefined out of 5
Keywords: open, source, opensource, open-source, self, hosted, selfhosted, self-hosted, free, libre, software, server, web, internet, browser, linux, mac, macos, os x, windows, microsoft, unix, bsd, ios, android, pi, raspberry, desktop, digital, ocean, digitalocean, vps, tutorial, how to, setup, installation, instructions, cli, command line, terminal, interface, open source software, open source news, open source projects
Id: qL-gOHMChwA
Channel Id: undefined
Length: 14min 42sec (882 seconds)
Published: Fri Jul 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.