You program the Arduino compatible microcontroller using the free Arduino IDE on any Windows, MAC OS, or Linux computer via USB.
If you've never done any Arduino programming, or microelectronics projects, this DIY Bed Presence might not be a good first project. It can be very frustrating trying to get it working reliably (electromechanically) and getting all of the software setup and working properly is not trivial if you're not familiar with C/C++ programming.
I am no longer using my own DIY solution as we changed our bed from a traditional queen to a split king bed, with power adjustable bases. Bed occupancy was interesting as a project, but I have put it on the back burner for now.
If that is what you need, then the 5 second delay from the bed sensor shouldn’t be an issue. You don’t need to poll the bed sensor (and wait 5 seconds) when the door opens. Unless there was a change in the state of the bed sensor within 5 seconds of the door opening, HE will already have the current state of the bed sensor.
Your rule only need to trigger on the door contact. Check if the bed sensor is indicating no one is in the bed and turn the light on. You’ll have less than 1 second delay with that rule. There is no need to poll the bed sensor for that and then incur the delay.
Disclaimer: I don’t have this bed sensor myself so I’m just assuming that the sensor would push events to HE rather than HE having to poll the sensor regularly for its state.
Having said that, even if you had to poll it, if the polling is set to every 2 minutes for example, it’s at worst going to turn the lights on when someone went to bed within the last two minutes. That may not be a deal breaker.
The Withings sensor is brilliant. I have 2 for our main bed. I use IFTTT, which as mentioned above means a 4 or 5 second delay. I don't give a monkey's about the Cloud connection, but a local solution to avoid the delay would be good as long as it doesn't interrupt the excellent HealthMate functionality. They are expensive but quite reliable now over 12 months of use (I do get some errors reported in IFTTT which I suspect occurs when my hub slows down and the connection times out). And they really do open up many opportunities for much better automations.
Ok, so if you don't care that you're in or out of bed, then here's a project i did to trigger mode. Quiet time, night, and home. This works wonders, though I feel like i want to improve upon it for a version 3 now just to be creative. I used wood for this project, but you could use anything. Even a 3-d printer could be used to create something. Your only limitation is your imagination. If you're looking for some unique solutions or ideas.
Nice! If you want/need any help (e.g., beta testing, feature brainstorming, even coding), let me know. Something I'm interested in as well. Would like to cut out IFTTT since it's proven a bit unreliable from time to time.
I'll definitely reach out once I have something to test. I already have a Withings smart scale so I can at least test connecting and pulling devices, but I don't have any sleep pads yet.
While I'm doing this, can anyone come up with a reason why I'd want my smart scale integrated into HE? I can't think of one, but I mean... why not?