Control Your Windows PC With Home Assistant!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
over the past year or so i've tried various different projects that allow you to integrate windows computers with home assistant so that you can use the controls and sensors in automations but each one i've tried i've always run into various challenges with the projects either they work great but use up too much processing power and therefore battery power are missing key features or the project hasn't received any updates for a while and appears to be abandoned but recently while browsing the home assistant forum i saw a new project that i've been using for a few weeks now and it takes many of the boxes that i've been looking for let's take a look at how it works and what kind of things you can do with it this new project is called hass agent and while it's a relatively young project it's got a lot of really good features and i like where it's headed so far has agent can report various sensor information back to home assistant including cpu and gpu usage your active window status of audio devices it can also send notifications straight to the windows notification panel you can control lights switches and other devices directly from your keyboard with shortcuts and you can even use your windows pc as a media player straight from home assistant 2. so this is a project specifically for windows that we are going to be covering today if you are on mac then you can already use the native home assistant companion app and if you're on linux then you can use the system bridge application which works on linux as well as windows and just recently had a full rewrite from the ground up but for this one we are going to be covering windows specifically haas agent is split into a few different components there is the main one that does all of the communication between your computer and home assistant and does all of the shortcuts and sensors and things like that and then there is two optional components that you can install one for adding notifications and one for the media player functionality we will be installing the main component plus the notification component but if you want to install the media player functionality too then i'll leave that down in the description for this to work you'll also need to make sure that you have mqtt set up and configured in home assistant 2 and there is a video over here if you don't already have that installed head over to the github linked in the video description and download the hass agent installer file and run it hit next to run through the first few steps accepting the defaults and then when you get to step 5 you'll want to enter your home assistant url or ip address making sure to add http or https as well as the port number that you use for your install generally port 8123 if you have not changed it next we will need to quickly generate an api key from home assistant head over to your user profile in home assistant and scroll down to the very bottom under the long live access token section click create token and then give your token a name finally copy the generated api key and head back to the installer and paste the key into the box and hit test connection at which point the test should successfully complete if you are going to be installing hass agent on multiple different computers using this process i would suggest creating an api key for each different device rather than reusing the same one on the next screen over provide your username and password for your mqtt server this is actually how the sensor information will be sent to home assistant so make sure to get this information correct then hit the finish button and wait for the process to complete and you will then notice that you have an icon down in your taskbar for hass agent right click the icon and then select show hass agent this is the main configuration screen for hass agent you'll see that it gives you the system status in the top box and how each component is working and then your configuration buttons are underneath notice how our api service and mqtt labels are all green and connected meaning that we did the setup correctly the quick actions sensors and commands are all yellow because we haven't yet set any of them up so there is nothing for haas agent to actually do so let's fix that by adding our first sensor hit the local sensor button and then click add new this will bring up a box of all of the sensors that you can report back to home assistant click on any of the sensors and it will give you a description of what it does plus a configurable update period for how often you want the sensor to report back to home assistant you will also notice these three columns and icons next to the sensor name the first icon indicates that the sensor provides more than one value and then the second and third icons indicate whether the sensor can work when logged in and if it can also work with the hass agent service the hass agent service will collect sensor information even when not logged in and runs when windows starts up but not all sensors can be collected in this way the menu we are in now is to configure sensors that work when logged in but if you want to configure sensors that run in service mode then you can do this from the main menu in the exact same way i'm going to select the active window sensor and then hit the store button repeat this process for any additional sensors you want to collect and then hit the store and activate button if you now head over to home assistant click on settings devices and services and then head into your mqtt integration you should now see your computer listed along with all of the sensors that you selected the last active and active window sensors are pretty useful i use these for creating a smarter sleep automation that will only run if i'm not active and also depending on what my active window is i actually wrote a detailed guide on how to set up that exact automation over on the recent free newsletter which went out last week and i'll leave links to that down in the description if you're interested in signing up along with the detailed guide if you want to follow along with that automation the next thing we can also do is set up some commands so commands are issued from home assistant to your computer and can do things like sleep restart open a web page play media and many more options you can set these up in pretty much the exact same way that you set up a sensor select the commands button from the main page hit add new and then select the command that you would like to add you can also change the entity type to change the way that it will be displayed in home assistant if you want to once finished hit store commands and then store and activate to save again the command will now appear in home assistant in the entities page ready for you to use the last thing we will look at here is how to create a hotkey that can then toggle any entity in home assistant right from your keyboard click on the quick actions button and then add a new quick action select the type of entity you want to control from home assistant and you'll see that it has automatically pulled in a list of all of your devices already connected to your install which is pretty cool you'll also see that you can select other hass agent commands to run if you want to select the entity the desired action and then click the hot key box press the keys that you would like to set as the hotkey and then tick enable hotkey once configured hit store action to save and then give the hotkey a test this is really cool for setting up super quick toggles for lights or blinds and saves you having to open up the app to quickly control them you can just do everything right from the hotkey on your keyboard the final thing i wanted to show you is how to send notifications directly to your computer at the moment you can send text and image notifications straight to your desktop which would be useful for sending images to your computer if someone rings the door for example and you are at your desk one thing i would really love to see that's not currently possible is for actionable notifications so i'd love to be able to add one or even two buttons on here same as i would a phone notification that could then be used in automations to trigger something else that would be really cool and is probably my number one feature that i would love to see implemented you'll need to add the extra component for notifications through hacks head over to hacks integrations and search for hass agent install the hass agent notifier integration and you can also install the has agent media player integration to while you are here once installed head over to the github page for the hass agent notifier link will be in the description and grab the example code that is halfway down the page now head over to your configuration.yaml file using your favorite text editor i like to use visual studio code and paste in the example code that you just copied making sure to change the name as well as set the ip address to your computer's ip address once set make sure to restart home assistant for that to take effect you can then use the notification service just like you would any other device like your mobile phone if you want to give it a test head over to developer tools services and then select your device from the drop down enter a title and a message and then hit the call service button if it worked for you you should see a notification pop straight up in the bottom right hand corner so there we go that is the hass agent application for windows like i mentioned this hasn't been under development for that long but i really like the work that's been done so far and it's progressing along nicely with some really good features planned as mentioned i'd love to see actionable notifications get added to be able to do more advanced automations but this is some really great work that has been done so far so make sure to head over and show some support for their incredible work let me know down below what automations you would do on your computer with this really interested to see what creative ideas you guys will come up with and other than that i hope you did in fact enjoy this video if you did make sure to drop this video a like and get subscribed and i will see you in the next video
Info
Channel: Everything Smart Home
Views: 92,014
Rating: undefined out of 5
Keywords: home assistant, smart home, home automation, home assistant windows, home assistant windows 11, home assistant windows 10, home assistant pc, home assistant computer, control pc with home assistant, control windows with home assistant, home assistant automations, hass.agent, hass agent, home assistant agent, hass.agent guide, hass agent guide
Id: B4SnJPVbSXc
Channel Id: undefined
Length: 10min 32sec (632 seconds)
Published: Tue Jul 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.