9 ms·
Making my own bed sensor
- pricechild 3y agohttps://www.revk.uk/2023/03/bed-sensor.html?m=1 https://www.revk.uk/2023/03/bed-sensor.html?m=1 has another take on the idea after frustration with a "smart" & expensive Withings solution drove him to something different.
- a_t48 3y agoI need one of these to stop my cat from turning on the bedroom lights when he’s hungry. Unfortunately with HomeKit doing automation like this the easy way involves converting the action into a shortcut, which comes with execution delay.
- blorenz 3y agoI never thought of using a water leak detector like that nor have ever actually used a water leak detector. I can now create my own pressure plate activated door or true AFK notifier. Thanks for the write up!
- 1-6 3y agoI thought the Aqara water sensor technique was brilliant. I wish more device makers would build IoT devices that connect directly to sensors.
- tapland 3y agoAqara zigbee devices are the first non-lights I've used and they have been great!
- jcrawfordor 3y agoThe Zooz ZEN16v2 or ZEN17 are also good options for connecting arbitrary sensors via Z-Wave, and the ZEN17 in particular is electrically more flexible (sink or source inputs). That said two water leak sensors will often be cheaper than one ZEN17 with its two inputs. An even cheaper option are door/window contact sensors and desoldering the reed switch to replace it with whatever you want, but it's less convenient for sure. And to wrap it all up, Zigbee devices are often a bit cheaper than Z-Wave.
- deleted 3y ago[deleted]
- robalfonso 3y agoFibaro makes a similar device in a smaller form factor as well https://www.thesmartesthouse.com/collections/fibaro/products/fibaro-z-wave-plus-smart-implant-fgbs-222 https://www.thesmartesthouse.com/collections/fibaro/products...
- toast0 3y agoWater leak detectors are handy. I've got one under every sink and near every toliet now. Should help prevent a small leak from making a huge mess.
- gjpolly 3y agoSensor shows 2 people in bed, when you're not home.
- sokoloff 3y ago"That can't be right; it looks like there's a sinusoidal error signal in the sensor readings..."
- function_seven 3y ago"Wait... something is modulating that sine! The frequency is rising."
- petsfed 3y ago"I really need to tune the debouncing algorithm, these errors are driving me nuts"
- greenie_beans 3y agoyeah this is creepy, i hope the writer's love life is okay.
- Larrikin 3y agoIt's not creepy. Typically one of the first types of automations you do is presence and motion detection, for simple things like turning off lights when no one is home, turning on lights when you enter a room. Then you find edge cases like wanting the lights to turn off when you're in bed, but not turn on if only one person gets up in the middle of the night. If you want to automate any of these things then it's necessary for the system to see the events. In my experience, people say it's all worthless, until they experience it themselves.
- greenie_beans 3y agoi'm probably reading too much r/amiwrong and r/aitah
- nkozyra 3y agoForce sensor resistors can be had for $3-$8 a piece, would they not also do the trick? ESP32 is such a great platform, can you not just make an HTTP request depending on force to a Home Assistant API endpoint and skip the leak detector as a conduit?
- brainzap 3y agoyup FSR, thats how I do it
- stavros 3y agoYes but Zigbee is great.
- michaelt 3y agoWhat the leak detector gives you is a long battery life. You can achieve it with DIY but if you want microamp-level current consumption you’ve got to do without a lot of the components that appear on dev boards
- stavros 3y agoHow does the water leak detector work? What's supposed to go onto those contacts?
- CiaranMcNulty 3y agoWater
- lsaferite 3y agoWater. It works by having water (or another conductive liquid) provide a path between the contacts.
- stavros 3y agoInteresting, the terminals really look like those screw terminals you attach cables too.
- exhilaration 3y agoI'm guessing they sell some kind of extension to attach to those terminals. For example, here's what the $12 water alarm in my basement looks like: https://www.amazon.com/Glentronics-Inc-BWD-HWA-00895001498-Basement/dp/B000JOK11K https://www.amazon.com/Glentronics-Inc-BWD-HWA-00895001498-B...
- ska 3y agoI often find reading these sort of descriptions amusing, for the strange mix of "hey, cool seeing someones DIY project" vs "I just don't understand why". I guess my personal value on hacking up your own stuff is just way higher than that on home automation...
- ranting-moth 3y agoTo each his own is a good rule when it comes to hacking/geek projects. I've so often been asked "but why are you doing this" or suggested that I go and buy the stuff that I'm making. I find it very annoying. I find most people who ask so such questions won't "get it" even if I explain. But I do understand that most often people are trying to be helpful. They can't imagine going through the ordeal that I'm going through for something of no value to them.
- ska 3y agoOh I would never ask someone why; let a thousand flowers bloom. I just find I get tickled by the ratio of my interest in how someone solved their problem to (my) lack of interest in the product in this particular genre at least. "To each their own" is a good principle :) I guess a different way of looking at it is this, I'm laughing at myself realizing that I would happily spend hours helping you figure out a hardware/software problem in your home automation setup, but I wouldn't spend minutes automating my own home. probably. maybe the right itch hasn't presented itself.
- deleted 3y ago[deleted]
- userbinator 3y agoFor me, most of the amusement was that my mind went in a very different direction upon seeing both "leak sensor" and "bed sensor" being mentioned. Count me in the "I just don't understand why" group too --- I work with enough software in my day job that I really don't want more of it in my life beyond that.
- 3y ago
- MarkusWandel 3y agoKinky jokes aside, this sort of thing can give a pretty good overview of how much you slept and how well. I use a piezoelectric sensor plate from an "Angel Care" baby monitor. Takes only a handful of passives to safely interface to an Arduino analog pin (safety: The transient from the thing getting jolted not burning out the input pin). The result, graphed (at 1 minute per sample bin - don't get kinky ideas) gives a very good overview of awake/tossing and turning/really asleep. Which to a lousy sleeper like me can actually be reassuring - yes, I did get some sleep in all this.
- minimalist 3y agoAndreas Spiess' recent video [0] covered some milimetre-wave radar chips whose application includes presence detection at a distance (including if the bed is occupied). Does anyone know of any bed automatable bed heating/cooling solution (DIY or otherwise) that can work offline of with Home Assistant? I had my eyes on E*ght Sleep but it looks like a lot of the functionality is behind a subscription wall [1] and the device is very chatty [2] and I haven't been able to find any API reverse engineering / firmware mods. [0]: https://www.youtube.com/watch?v=s-GzUTyIH9c https://www.youtube.com/watch?v=s-GzUTyIH9c [1]: https://old.reddit.com/r/EightSleep/comments/1248wgz/buyer_beware_eight_sleep_has_now_moved_basic/ https://old.reddit.com/r/EightSleep/comments/1248wgz/buyer_b... [2]: https://old.reddit.com/r/EightSleep/comments/185cgm4/pod_3_traffic/ https://old.reddit.com/r/EightSleep/comments/185cgm4/pod_3_t...
- alxlu 3y agothere's bedjet. i find that it doesnt work well with adjustable beds though because when you raise the leg part up, the bedjet hose thing tends to slip off. https://github.com/pjt0620/Home-Assistant-Bedjet/ https://github.com/pjt0620/Home-Assistant-Bedjet/
- lm741 3y agoI suspect the sleep.me chilipad systems (ooler/dock pro) would work pretty well with adjustable beds since they just run a pair of insulated water hoses to a capillary tube network in a mattress pad. Further, if the hose routing didn't work for you out of the box with those you could DIY something else pretty easily since they use off the shelf connectors (https://www.cpcworldwide.com/General-Purpose/Products/Multiline/DPC https://www.cpcworldwide.com/General-Purpose/Products/Multil...)
- lm741 3y agoOn the bed heating/cooling front, you might try the Ooler series from sleep.me The older generation Oolers use bluetooth and there are a fair number of integrations including an [MQTT bridge](https://github.com/turmoni/ooler-mqtt-bridge https://github.com/turmoni/ooler-mqtt-bridge) and a [HomeAssistant integration](https://github.com/PostLogical/ooler https://github.com/PostLogical/ooler). I'm less familiar with their latest generation which uses WiFi, though there [seems to be an API](https://docs.developer.sleep.me/api/ https://docs.developer.sleep.me/api/ ) available for it now.
- ulf-77723 3y agoGreat project! Until now I do not have anything connected to my bed, I can't sleep with something attached to my wrist, so no sleep data. Tracking the sleep would be really great, but the current solutions seem not right to me. I would welcome a system, which may be used as a pod sensor, like the mentioned EightSleep or Withings, both not visible. But I want to set when something is radioing around my bed. Just like on my smartphone, where the flight mode is activated, I would like to set the device so that the data is only synchronized via WLAN or Bluetooth when I am no longer lying in bed.
- lawn 3y ago> I can't sleep with something attached to my wrist, so no sleep data. Another option would be Whoop that you can add to your underwear. Expensive I know, but it works very well.
- roywashere 3y agoI use a Google Nest Hub for two weeks now. It has sleep tracking via IR cameras. It promises this is all on-device. I think it is reasonably accurate. Google said it is going to charge 8 euros per month for it starting January 1st. I’ll stop using it then
- LCoder 3y agoI spent years in a previous job developing acute care pressure pads like these utilizing pressure-sensitive conductive ink. The simple open/closed circuit pads shown here work well above the mattress but (depending on your mattress weight and bed frame structure) can provide false positives when placed below. We had fun stories with our first home testers where many people (me included) planted our elbows and lifted when we turned during the night. This movement was enough of a weight lift over the pad to cause the first iteration of our sensors to trigger. The ability to adjust your bed's unoccupied zero point using an analog measurement, deciding how much weight should be added (or removed) to determine a state change, and over how much time the movement occurred makes a big difference in reliability. Near the end of my grandmother's life, she was living with my parents and a fall risk. I did this same ESPHome implementation to HomeAssistant to provide us with alerts when she got up on her own in the middle of the night, and it helped my mother sleep much better. Side note: those other two wires the author says they "have NFI what they do" are most likely wired into the pad as a permanently connected loop. Most monitoring equipment will look for a closed circuit on those wires to detect that a sensor pad is connected correctly and the sensor wire hasn't been broken (ripped, torn, cut, etc).
- mattmaroon 3y agoDamn, why did I never think to use a leak sensor? I’ve been goofing around with building some unusual devices and messing with relays and io pins and arduino and completely missed this obvious solution. It’s literally a device designed to do exactly what I sometimes need (start an action if a circuit closes) and I just never thought about it even though I know how leak sensors work and that there are ones available. Duh! Stuff like that is why I love HN. Thanks to the author if you’re reading.
- shellfishgene 3y agoDoor/window sensors also work and are even smaller than the leak ones. Just replace the reed switch with whatever.
- timemct 3y agoSome d/w sensors will even have dry contacts specifically meant for wiring in whatever open/close type thing you'd like to use, like a pressure pad.
- mattmaroon 3y agoI didn’t realize there were any that weren’t part of an alarm system/proprietary but it seems the same company makes those too. I guess that would also be a really easy to do the opposite (if it mattered) since a reed switch triggers the action when it opens, but a leak detector when it closes. Or I guess maybe they do both. I am curious why the leak detector is bigger if it’s a simpler device. Basically the same thing but without the reed switch right? Maybe just to make room for more battery since you actually care how big the door sensor is.
- shellfishgene 3y agoDoor/window sensors usually send a signal on state change from closed to open or the other way around. I think a leak sensor is more complicated because it needs to detect a somewhat lowered resistance between the contacts, as opposed to the door sensors that will get a fully closed/opened reed switch on activation. Detecting lower resistance with some threshold in a battery powered device that needs to sleep most of the time is probably more complicated. I would guess waking up on a pin state change is built into most microcontrollers, while measuring resistance to make it wake up requires additional components?
- robalfonso 3y agoI've done this as well, but I moved to 500kg load cells on the bed legs for reliability. 2 Load cells one on each back leg of the bed. Upside too is I've been able to discern things like, sitting on the edge of the bed to put on shoes etc based on the weights. Esphome, load cell, and hx711 chip for the load cell comes out to about $40-$50 each leg.
- jojobas 3y agoYou could get away with using just two cheaper 50kg load cells with some tinkering (i.e. a bracket and screw to send the just right fraction of the load to the cell, on just two legs).
- paradox460 3y agoMany years ago, I bought a bed/sleep sensor made by Withings. It worked fantastically, for about a year. Decent sleep measures, circadian aware alarm, all that. Then it just stopped working. Contacting support thought it might be the pad, and they sent me a replacement. That worked for a while longer, until it didn't. At that point, Withings had been sold to Nokia, and wasn't interested in maintaining their system anymore. I miss it. I'm sure that this system won't be able to do all the measurements the Withings one did, but thats OK. I've got a watch for that. Def. going to have to try this soon!
- themaninthedark 3y agoJust FYI, Nokia sold Withings back to the founder. They still sell the bed sensors, don't know if you would have any luck contacting them now. If you do I would be interested in knowing if they respond or not. I recently bought one of their watches and am thinking about buying a scale but I am curious about their long term support.
- teeray 3y agoThe new bed sensors post-Nokia are even better. I gave up on the Aura one and just use the new one now.
- joostlek 3y agoI did put in a lot of work to make the integration with HA as nice as possible. Their API is nice and they provide it for free. I am secretly hoping they aren't becoming the next MyQ where they want to avoid it. They even recently launched their Withings+ subscription, so they are trying to bring in more revenue. Their other revenue stream (apart from selling devices) is some kind of reseller program. Let's hope they can make it sustainable so we can enjoy our devices.
- paradox460 3y agoThis thing is probably well beyond it's warranty, and I got a decent amount of use out of it. But now I've largely moved on, and a simple switch like the op article will probably do everything I need to be fast, and let my Garmin track my sleep I can attest that the new withings scales are really nice. We've got one in the bathroom and have no complaints
- neilv 3y agoI see the photo of the sensor atop some springy bed slats, but don't see mention of how the sensor setup distinguishes the weight of of mattress above springy bed slats from when a person is atop.
- chetumal 3y agoI have a similar setup with the same kind of sensor. It just doesnt register the matress at all. My guess is that the matress weight is evenly distributed so it doesnt actually put that much pressure on the sensor.
- logtempo 3y agomatress are around 40, maybe 50kg/m3. water is 1kg/dm3, and acording to this website (https://www.aqua-calc.com/page/density-table/substance/human-blank-body https://www.aqua-calc.com/page/density-table/substance/human...) human is arround 1000kg/m3 which make sense. So, yes matress is light compared to human, I guess it does nothing to the sensor pad.
- pants2 3y agoI've always thought a Thermal Imaging camera mounted above the bed would be the best sleep tracking system. It could even be hooked up to a feedback loop where if it detects your body temperature rising it can increase your fan speed, things like that. It would be a fun computer vision project.
- mft_ 3y agoAn averaged heat-map would also help solve the pirennial relationship question of who encroaches on whose side of the bed the most :)
- taneq 3y agoI think you’d find that the actual physical locations of the bed’s occupants are less relevant than you might think to these accusations, ;)
- didntknowya 3y agowe've done projectd with kinect sensors for fall prevention in hospitals. one con is that many people are uneasy if there's a camera-looking sensor pointing at their bed.
- InCityDreams 3y agon=? ...would like to know more.
- throwaway81523 3y agoObligatory: https://biggaybunny.tumblr.com/post/166787080920/tech-enthusiasts-everything-in-my-house-is-wired https://biggaybunny.tumblr.com/post/166787080920/tech-enthus...
- chpatrick 3y agoI think it makes a big difference if your home is running on open source stuff or not. I wouldn't be comfortable with Google or Amazon running my house but if it's stuff I flashed myself from github it's a lot better.
- drtgh 3y agoAbsolutely. These things basically say to others what is going on in your own home. To have domotic connected to a wifi or internet is a no go. If I were to have it for a really heavy weighted reason, seeing the current state of things, I would have previously to spend months developing non standard custom encryptions with hidden rotatory keys methods of my own, custom non standard protocol, connections monitoring and so on. And even like that I would feel cautious, It would need to be a real weighted reason. I can not understand how is it possible the people is using IoT without needing it, totally naked, without even demand any kind of protection designs, or/and even giving third parties all that information, because it can be even dangerous. Semi-Of-topic: I would like to have a lidar vacuum cleaner, for to clean effectively zones without collisions with a mapping, etc. Past year I took a look to manufacturers and models, but it seems that from the beginning, when they started to sell them years ago, those devices with mapping require to be connected to the wifi and to the internet; they submit the mapping of your home to internet, the manufacturer server, for to let you make use of such mapping for to run the vacuum cleaner. Oh my... I could not even find more information on the forums (in several languages), people don't seem to find this as a inconvenient? for me it's an absolute no go. All of this is approaching the classic dystopian books that should remain in the sci-fi section.
- anotherevan 3y agoI wonder if it could distinguish between a human and our 35kg dog who often lays on the bed during the day.
- H8crilA 3y agoThe dog also deserves to not be suddenly flashed with light when it is lying in bed!
- anotherevan 3y agoYeah, but he tends to lie across the middle of the bed so would be detected as two people and send the house into bedtime mode. :-) Mostly I'm just jealous that the dog spends more time in my bed than I do.
- jaakl 3y agoI thought the sensor can be used to check if my kids are making their own beds properly.
- xp84 3y agoThe moisture sensor component. I can’t stop laughing picturing a readout like: “Greg’s Bed …. Wet”
- jackvalentine 3y agoI used to use the withings bed sensor combined with IFTTT to boil my kettle downstairs when I woke up in the morning.
- PMunch 3y agoThe trick with the water sensor is really neat, might have to look more into that. I also wish that more companies would design some of these building block smart devices for us hobbyist. Don't tie it specifically to water, maybe have a pot to trim the sensitivity, et voila you now have a pretty handy all-round ADC thing. For my bed detection though I just have Tasker on our phones telling the system when they charge. If it's after a certain point of day and our phones are charging that's a good indicator that we've gone to bed. Doesn't require any extra hardware, making it super cheap. Although accuracy obviously won't be 100%.
- stinos 3y agoBit off-topic, but having played with HA a bit I always wonder if there is a general strategy on how to deal with failures, i.e. is there a way to make everything go to the default/safe mode in case things stop working? A watchdog-like backup system? And another backup for that :) I get that it's unlikely to happen, but still.. Like: - some sensor triggers lights on via impuls relay (that's what I have to happen in my home), HA stops functioning, lights remain on. How to make sure instead they're turned off? I get that not using impuls relays but relays which need to be driven high constantly might be one step in the right direction, but that would still assume whatever line the relay is driven with is pulled low when HA stops functioning. - you setup HA to instruct your home battery to charge during off-peak hours, HA stops functioning during off-peak, battery is left in 'charge as much as you want' state. Unless battery has functionality to tell it 'charge max x hours' it will try to keep charging, whereas it would be nicer if it wouldn't - same for heating: leave for vacation, tell HA to put heating in low power mode but to start heating the house again in normal mode 3 days before I'm back (because that's roughly the amount of time needed with low temp heating to get everything warm again). HA stops, I come home to a cold house.
- Goz3rr 3y agoAt least for the lighting related concern, I personally use both Zigbee bulbs and switches. These can be bound together so the switch will directly tell the bulb to turn off/on without intervention of anything else. This results in a faster response and working light switches even when home assistant is down.
- stinos 3y agoOk but can you tell them 'go to state x when HA is down'?
- wkjagt 3y agoI love reading about implementations like these. I love the technology behind it. But I’ve never read about a project like this and wanted to automate my house in any way. Maybe I’m a weirdo, but I enjoy getting up and turning on the light, and making coffee. I’d be somewhat bored if it was all done for me. I would miss the routine.