My first project: desk presence detection

There are so many cool things to explore with HA I’m a little overwhelmed. So to just get started I identified a fun project I’d like to figure out.

I have a standing desk and a chair in my home office. I’d like to have my music turn off when I’m no longer in the room. And when I return, music resumes.

I’m running a Linux desktop that could run MPD for controlling the music pause. I’ve actually got that set up in HA and can play/pause the music via a media_player card. That seemed like a good step 1.

What I’m stumped on is how to detect my presence. I wonder if using BLE on my phone might do it? I explored the idea of using my phone’s proximity sensor or light detector such that if I turn the phone on its face it plays the music, but then it would also play when I put it in my pocket perhaps. I have a spare old phone with both sensors that I could leverage by attaching it to my desk in some manner, but in testing it looks like the proximity sensor basically is “near” when something is within 2 inches of the sensor or “far” when nothing is there.

I reviewed ideas around creating and putting a sensor in the chair (would need to DIY) but I sometimes stand too. I thought about using some kind of PIR sensor, meaning I’d need to buy a light switch with PIR and wifi.

I’m open to spending some money to figure this out, but I wonder if there’s something already figured out in the community that I could leverage/explore. Thoughts/ideas/help?

hi

Interesting ideas thank you. I came across the Shelly Motion WiFi, I wonder if there’s experience with that in the community. I’ll search. Seems like a cheaper/proven alternative to the FP1 idea :slight_smile:

I have HA detect if my PC is on/off and take action on that.

I’ve been thinking about this and thought I’d drop my ideas here.

  1. Measure power draw on a monitor.

  2. Door sensor or endstop on my retractable keyboard tray (not going to work for everyone’s set-up).

These have thier limitations but I think they might work for my needs/use case.

I don’t think PIR, ultrasonic, ToF or BLE will work for my setup.

Edit: This is clever. Add a seat pressure sensor to a door sensor.

If you are using a chair with some moving parts a door sensor in the chair (triggered only when you are sitting) probably will work also.

I’ve gone overkill, but, an orchestration of these works:

Contact sensor on the door - only gets closed when I’m working….first check

Vibration sensor in the chair (with tilt sensing tells me off when I’m spending too much time lounging back, ie away from the keyboard) - second check (okay so I’m definitely in the office now)

Motion sensor to confirm I entered the room and switch on the monitors before I’m sat down and it’s all good to go

New addition of an aqara FP1 to sense I’m in the room and still there even if I’ve fallen asleep on a Zoom call. TBH this could probably replace most things now but does take a bit longer to sense your arrival

All Zigbee devices, Hue bulbs on the room ensure there’s always good signal in there for these end devices

1 Like

The aqara FP1 looks very interesting. I saw it a while back but forgot about it.

I think even if you have to have a PIR/Door sensor etc to do the “quick detection” and then the FP1 to monitor you are still there, you have still solved a major room occupancy challenge.

Isn’t all of this overkill when you can just corner all of these cases with a motion detector? They might be fun projects but i find most things, if not all i can cover with the mighty motion sensor.

I thought for a while to have bed motion sensors, but i’m not sure i can argue a case for it. I have pir sensors in the bedroom so they can check if someone is still moving/sleeping/waking up with some logic in HA.

I’m looking for desk presence detection. My desk is in my open plan living area.

And I walk past my desk regularly!

I’ve tried a PIR pointing towards my feet in the past, with “reasonable” results.

Also, there is a chance that they will detect you as away if you aren’t moving regularly (perhaps reading on screen etc).

I have lots of motion sensors which do the job for many other purposes.

I don’t think the aqara FP1 is necessarily a good solution for my desk detection situation (although you can define “zones”, but it fills a need, as the video explains.

Did you manage to buy one!? Jealous!

1 Like

The aqara vibration sensor I have in my chair spots straight away when I sit down (assuming you have a sitting desk). I’ve put it the back rest and because I constantly rock on the chair it knows I’m there. With the FP1 I’ve set it up low, pointing back at my desk with near range only so when my office door is open it won’t spot people walking down the hall and seems to work well

1 Like

I have a sit-stand desk! Another reason why I was thinking about using my keyboard tray or monitor power draw.

I’m tossing up whether to get one of these Tuya ones to tinker with given they are cheaper and available.

Can’t see much info about performance.

Thought there might be a slim chance of ESPHoming it.

Not sure if it has the zoning feature which would be required for my desk presence detection.

I may implement “sit detection” via a vibration or pressure sensor in my seat to trigger automations to promote switching to standing.

But I get that from my standing desk height sensor if I can tell I’m actually at my desk.

Not come across those - one final thought, not sure what flooring you have but an under carpet (if fitted) pressure mat (seem to be a few ESP base projects kicking around on that type of stuff). Post your final solution as I’d be interested to hear

1 Like

Actually that could work too!

I have a large carpet square (~1.5m) under my chair to protect my actual carpet from the castors.

Might need to check my sit/stand pressure locations, but sounds like it’s worth looking at.

Cheers.

I have a Xiaomi Mi sensor positioned close to my desk so that it is triggered when I am at the desk. I use that to monitor the numbers of hours I have been working from home (WFH) everyday.


This is clever.

I was independently thinking about the same idea but wasn’t sure what materials to use to build the switch, but someone has already figured it out.