Sitting still for long periods may increase the risk of serious health conditions such as type 2 diabetes, stroke, heart disease, obesity, and some cancers. Even as little as one minute of walking every 30 minutes could provide modest benefits, such as reducing blood pressure. That’s why I use one of my smart home sensors to nag me when I’ve been sitting for too long.
I turned my presence sensor into a desk presence monitor
My sensor can “see” when I’m at my desk
I have an mmWave sensor in my home office that I initially set up to control my lights and computer. When I come into the office, my presence is detected, and an automation in Home Assistant turns on the lights and wakes my computer, ready to work. As long as I’m in the room, the lights and computer stay on, and when I leave, the lights go out, and my computer sleeps.
Some mmWave presence sensors allow you to set up multiple zones. As well as monitoring the entire room to trigger the lights, I’m also able to create a zone that only covers my office chair. The sensor is accurate enough that it can detect when I’m in that zone and when I’m not.
With a little testing, I was able to confirm that the sensor would accurately report the zone as occupied when I was sitting in my office chair and unoccupied when I wasn’t. This means I have an effective way to determine when I’m sitting at my desk.
Creating an automation to nag me to get up
Shaming myself really works
Once I had the zone configured correctly, the next stage was to build my automation in Home Assistant. I wanted a way to remind me to get out of my office chair if I’d been sitting there for 30 minutes or more. Since I have some smart speakers and a Hi-Fi in my home office, the obvious solution was to use a voice announcement.
My automation starts whenever the state of my office chair zone changes to occupied. It starts a 30-minute delay at that point. If at any time during those 30 minutes the zone becomes unoccupied, the delay timer is canceled and the automation stops.
If I’m still in my office chair at the end of those 30 minutes, then a spoken warning is played through one of my smart speakers, telling me to get up from my chair. If I do so, the automation stops, and only restarts again when I come and sit back down.
If I don’t get up when I’m nagged, then the automation nags me again after five more minutes of sitting down. If I stay seated, it nags again after a further three minutes, then two minutes, then one minute, and finally every 30 seconds until I finally give in and get up.
Each time, the volume increases, making it harder and harder to ignore. The message that plays also becomes increasingly aggressive, eventually listing some of the worst health conditions that I could suffer from if I don’t get up.
I can’t trick the automation by quickly getting up and sitting straight back down, either. The zone only changes to being unoccupied once no presence has been detected in the zone for a full minute.
Adding real-world logic
Sometimes I need to stay seated
As with most automations, while I want to be nagged to get up most of the time, there are times when I don’t want this to happen. If I’m working late at night, or early in the morning, for example, I don’t want loud spoken notifications disturbing the other people in my home.
There are also times when I may need to stay sitting down for longer than 30 minutes. For example, if I’m on a work video call, I don’t want my smart speaker to suddenly start telling me to get out of my chair.
I therefore needed to add some real-world logic to my automation to ensure that it only nagged me when I wanted it to. Adding some time exceptions was simple enough to do; you can add time conditions in Home Assistant automations, so that the automation will only run between set hours or on set days.
I also added a condition that stops the automation from running if I’m on a video call. The Home Assistant desktop app on macOS exposes an entity called Camera In Use, which turns on when my MacBook’s webcam is activated. The automation won’t run if Camera In Use is on.
The automation works better than I expected
My stand hours are through the roof
I’ve always really struggled with sitting down for too long when I’m working. Despite my best intentions, several hours can pass before I realize that I haven’t left my seat the entire time. I’m fully aware of how unhealthy a sedentary lifestyle can be.
I thought creating this automation might help, but I wasn’t convinced that it would make a huge difference. A smart speaker telling me to get up isn’t something I would necessarily obey. However, by having the reminders come at increasingly short intervals, the announcements can quickly become irritating enough that I can no longer ignore them.
The master stroke was not giving myself an easy way to disable the automation. If I want to turn it off, I need to wade through some menus in the Home Assistant UI and manually disable the automation. It’s less effort just to get out of my seat and walk around for a minute or two.
Thanks to my mmWave presence sensor, I’m now standing up multiple times throughout my working day. The proof is that I’m now closing my Stand ring on my Apple Watch almost every day, when previously I’d hit it once a week or less.
They say that technology can make us lazy, but sometimes it can help to make us more active. It’s satisfying to know that my smart home is not only making my life easier, but it’s also helping me live a healthier lifestyle.
