Your PC is secretly a Home Assistant sensor: here are 5 automations you can try today


You may not think about your PC or a smart home sensor, but there’s a lot it can tell you. Your computer knows when you’re active, when you’re idle, when you’re using a particular app, or even when you’re on a video call. You can use that information to create some very useful automations in Home Assistant.

Avoid getting distracted

Your smart home can tell you to get back to work

An Echo Show 5 showing a reminder with incomplete to-do list tasks. Credit: Adam Davidson/How-To Geek

This is something I set up to try to help me focus more when I’m working. I have a terrible habit of getting distracted when I’m supposed to be concentrating, diving down a rabbit hole of how to do something obscure in Home Assistant instead of writing the article I’m supposed to be working on.

Using the Home Assistant app on my Mac exposes a number of sensors, including one called sensor.frontmost_app. This returns the name of the app that is currently focused, and I can use it to determine when I’m using a work-focused app and when I’m using an app that’s definitely not work-related at all. On Windows, you can use HASS.Agent to expose the active window and use it similarly.

I created an automation that bothers me with a spoken advertisement from my smart speaker whenever I’m in an app that doesn’t work for too long. The same automation also bothers me if my computer goes idle when I should be working, indicating that I’m playing on my phone. The automation works surprisingly well; It’s usually enough to snap me out of my procrastination and get me back to work.

MacBook Neo colors on a white background.

Brand

Apple

Operating system

macos

The MacBook Neo with the A18 Pro chip is Apple’s most affordable laptop yet, with all-day battery life and smooth performance in a thin and light profile.


Activation of work mode

Turn on a scene when you start using your computer

A person closing or opening the lid of a laptop. Credit: Laktikov Artem

Another useful sensor your computer can expose is whether it is active or not. On a Mac, there is a binary_sensor.active that tells you if your computer is currently being used, and HASS.Agent exposes the active state in a similar way.

You can use this information to trigger an automation that triggers a work scene when you start using your computer in the morning. For example, when your computer wakes up, your automation can set the lights to a bright, cool color to increase concentration, start a work playlist, set your phone to Do not disturband more.

The same sensor is also useful for knowing when you are not working. When your computer is not active for an extended period of time, you can have an automation turn off the lights, pause music, or do anything else you want to happen.


Track weight in Apple Health using the iPhone Shortcuts app.

5 ways your smart home can monitor your health

Well, well, well.

Use a smart light bulb to indicate that you are busy

No more interruptions during video calls

A Cync smart decorative RGB bulb that displays a red color. Credit: Justin Duino/How-To Geek

This is something that I have found really useful, because I have to make a lot of video calls to work. Many times these calls coincide with the time my children get home from school, and on more than one occasion they have burst into the room shouting nonsense while I was in the middle of a call.

The solution was incredibly simple. There is a sensor called binary_sensor.camera_in_use exposed by the Home Assistant app on a Mac, and HASS.Agent has a similar Webcam Active sensor. This sensor detects when the webcam is in use.

When this sensor is activated, such as when I am making a video call, the smart bulb in the hallway outside my home office it turns red. When my kids come to my office, if they see the red light, they know I’m on a call and they stay outside. Once the call ends and the webcam is no longer active, the red light goes off and my kids know it’s okay to come and bother me.

Create the environment to play

Play deserves the same love as work

Having a work scene activated when you open your laptop is useful, but your smart home doesn’t have to just focus on the boring stuff. It can also help with the fun stuff. You can use your computer to determine when you are playing and act accordingly.

You can use the front app or active window sensors to determine which app is currently in use. If that app is a gaming app, like Steam or PS remote useYou can activate the automation of your game.

For example, you may have the lights dimmed so you can focus on the screen, LED strips behind your monitor turns on and the RGB lighting is set to a specific color. You could lower the blinds to reduce glare, put your phone on Do Not Disturb mode, and turn on the red light outside your home office so your kids don’t come in and interrupt you.

Smart charging

Keep your battery healthy

A laptop next to a green battery icon with a plug and a red warning sign. Credit: Lucas Gouveia/Justin Duino/How-To Geek

This is another boring and convenient automation, but it can be very useful. The Home Assistant app on Mac or HASS.Agent on Windows can expose the battery levels of portable devices. You can use this information to help you. preserve your laptop’s battery life.

Modern batteries don’t like to be fully charged or dead; They are happiest somewhere in between. If you keep your battery between 30% and 70% most of the time, for example, it’s likely to stay healthy longer.

You can use a smart plug to control your laptop’s power and set up automation that turn off the smart plug when the battery reaches 70% and turns it on again when the battery reaches 30%. If you know you will be using your laptop without power, you can temporarily disable automation and let the battery charge to 100%.


Your computer can tell you a lot

Your PC or Mac can provide you with more useful information than you think. You can use these sensors to create some very useful automations, all of which are triggered solely by what you do with your computer.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *