I still love the original you inspired me to build.. and then modify, then modify again.. and then send away to get a custom pcb.. see what you did.. although gotta say it's been completely faultless, wife loves the his and her led's and the built in pir's. I know i've said this before.. but Many thanks for the inspiration and help in discord... even if it does end up costing me everytime you release a video.. 🙂
Thanks Lewis for being so inclusive in your channel and recognising the requirement for bed multiple occupancy. It clearly made you giggle as much as I did. 😆 #sharingiscaring
I used the pressure mat for about a year, they don't last if you put it above the bed, under the pillow. I ordered mine from RS components. I forgot they had a 3-year warranty, hence I opened them up. Inside is just a foam sandwich between aluminium foil that is stuck onto cardboard. There are holes all around the foam, so when you put weight on it the two aluminium foils touch. One wire connected to the top foil on connected to the bottom. The foil will break up after about a year. If you move a lot during sleep, they will break apart sooner. I connected mine to the Aqara door sensor with a little mod, so its wireless use ZigBee battery lasted a very long time. Maybe I should try putting them under the bed...
This was an interesting and informative video. I enjoyed your experimentation and process. I have been using a load sensor array with ESPHome and Home Assistant for some time now. I use it to try to keep the dog off the couch. When the weight is within a range (e.g. 10 to 70 kg - based on the sensor, not actual weight), it starts recording video, grabs a snapshot, uses TTS to say "off the couch", and sounds a smart alarm for 10 seconds. It has really only truly effectively worked once. The reliability issue stem from these factors: 1) The sensor array is uder the cushions and the weight it reads varies considerably based on how the cushions are arranged. 2) The sensor has sporadic spikes. I will look into the filter command in ESPHome as you described (Thanks!). 3) The couch is also used by humans. Since the dog does this occasionally and when we are not there, scheduling the alarm has helped to some degree. The variability in the sensor performance in this application defeats a weight based approach. I have enjoyed this home automation experimentation with weight sensors. As you say, it opens up interesting use cases.
Used this as inspiration to try with the international mat you linked to, and wiring it into the dry contact terminals of an EcoLink DWZWAVE 2.5-ECO door and window sensor. Took ten minutes, works like a champ in Home Assistant so far. Thanks for the idea / mat recommendation.
That's the same thing I was thinking about doing. when he mentioned esp or whatever it's called. I use Hubitat & have no clue what Esp is or if it's even available for hubitat.
Oh this will be the sensor I'll be implementing on my bed! I bought the weights but once they arrived and I started checking how to install them I realized I didn't really like them as it would significantly increase the height of the mattresses. This is a way better sensor! Thanks man for trying and putting out regularly new sensors I had no idea about!
Great video. I was just thinking about doing something like this the other day. Also, a potentially even more simple approach, hooking up one of these pressure sensors to a zigbee/zwave water leak sensor. Since the water leak sensor just detects when a circuit is closed, it might just do the trick.
@@oliverwemyss5527 I haven’t done it yet, but I’ve looked around and it seems like a lot of people have got it working. I’ve even heard of people doing it with contact sensors.
Simplicity wise, been thinking about this sort of mechanism for my bed for a while, but was wondering about which pressure switch to be put down under. And thanks to your video, i now know there's a thing called "pressure mat". Sometimes it's just a keyword away to find what you need online. And you just nailed it. THANK YOU very much!
I am fortunate that I have a "Sleep Number" bed, which has integrations with Home Assistant already, and there is occupancy detection built in so I don't have to build/add anything to use it. If I get out of bed at night it turns on an under bed LED light so I can see my way into the bathroom. I plan on extending that in the future with some LED's under the vanity in the bathroom that will turn on and off on as well based on that occupancy state, so I don't have to blind myself by turning on an overhead light. I also use the bed's occupancy detection to auto-mute certain broadcast messages (for example if the 3D printer finishes printing) through the smart speakers, as well as mute certain notifications on the phone.
The sensing part is a generally easy solve and you've posted a few workable solutions. I'd also recommend for anyone who wants less fiddling/flashing/setup that they can use a Shelly Uni instead of a ESP for anything that requires binary or analog sensing. It's cheap, small and already has wires and harness, plus all the built-in software to run it with a web GUI to configure various settings. It has direct ADC sensor reporting and also two built-in relays (low current) that can be used to trigger other things (or used as binary sensors to report the ADC or attached switches as on/off). Built-in Shelly integration in HA works great or even MQTT can be used. Lots of options. That said, I think the most difficult part of most automation is coming up with sensible logic to create 1. great/seamless usability and 2. Wife-Acceptance. :) That's going to be a big part of bed sensing when tying it to things like lights/blinds/curtains, etc...
OMG, got an idea when combined with a smart lock. Auto lock the door when you're getting jiggy with it 😎, and play (loud) music in every smart speaker to cover the noise. And/or play something on TV to keep the kids busy... Finally got my next project! 👍
One thing I found is that the pressure mat I got required wire 1 connecting to 1 pin, and wires 2 + 3 connecting to another. In my case Pin 1+2 were always-on, Pin 3+4 are always on, and no combination of any 2 wires caused it to act like a pressure mat - only combining (1) + (2+3) was I able to get it working. Something to keep in mind for anyone else considering this (YMMV of course). With that said - great video! I've been trying to sort out a life-long sleep problem, so I've been ruling out different factors which might be causing problems. Recently discovered that humidity is a major factor for me - 53-59% is perfect for sleeping. Any lower = dry sinuses = waking up with headaches and low energy. Any higher = generally uncomfortable in a room that's already quite hot. So far, I've been using time as a condition, but now I can use bed pressure as an additional condition! Also, because it's literally just a pin high/low check, this makes it one of the simplest projects and workable on even the cheapest microcontrollers.
Thank you for this video! I have also built a similar sensor on my bed. I have built a simple switch under the slatted frame and the slatted frame is lifted slightly with a spring, so that it moves slightly downwards when lying down. This also works great and I use the sensor to record my sleep time. This time is then sent to my cell phone in the morning and added to statistics for the average sleep time. Works great for years now!
Great idea, lots of interesting uses. For my bedtime I use shortcuts on my iPhone to tell HA that my phone is charging, if it’s after 10:30pm it turns on my bedtime routine/turns off my house. I always charge my phone while sleeping so this has worked great for me!
Just take a „car seat sensor“ . You can get that one for 12 dollars and then solder it to a Aquara door/ window sensor (by replacing the reed contact). And viola, when you lay down on your bed you get the signal that the door sensor is „closed“
Did not know they existed, great idea. Using the aqara water sensor is easier though, they have two bolts on the back where you can attach the sensor persure sensor without disassembling it
This got me thinking that the FSR sensor could potentially be put into the garage to immediately close the garage once a car has been pulled in. Preferably at night since during the day there may be groceries etc. Or heck put them under carpet on stairs to start automations. Very cool
Those FSRs generally have a thin spacer between so if you squeeze them between two flat plates larger than the sensor they don't give much (if any) response. You can attach something smaller than the sensing area to it (eg put a coin on top) and that will press down on the active area. They're still not great for measuring actual weight because they have an exponential response going from >>1MOhm when unloaded and
@@EverythingSmartHome There is a 600mm long FSR available from SparkFun. It works extremely well and does not fail from compression like pressure pads (eventually) do. There's a a great topic on it on the Home Assistant forum.
Instead of the small round FSR just get a long one like the SF15-600 which is a 600mm long band. I used that for my bed and it worked very well. Only the automation i had to turn off the lights in my whole apartement wasn't really working for me cause i often wanted the light to stay on while being in bed so i replaced it with a small zigbee button which i simply press to turn on and off all the lights.
First of all the video was nice. Now a little suggestion for the FSR or DMS (if you are in Germany). I use the FSR instead of unter the mattress, under the legs of the bed. There it works without problems and you don’t have a problem with a person moving around because the value is pretty stable. The only drawback I can think of is, that you can only detect if someone is in the bed, because I think the difference between the one and two people in bed aren’t reliable measurable.
I love these videos! One of my jobs is to program the logic for a crystal maze/ the cube style activity centre. We are always trying new types of sensors. I've used those matts for detecting people in certain areas, they degrade quickly in a commercial environment. There was another carlo gavazzi sensor I used that you could place behind a board and could detect if someone was standing on it by density.
That's another good option very practical. Also reminds me of a couple sensors I did using a old mouse micro switch and another one with a travel switch I belive it is called on a chair. I guess just glueing one small switch in the wood slab against the mattress deformation will just work the same. Another idea would be to use a weight cell but the beam type that measure on the deformation of a aluminum bar, all would take would be to screw it directly to the bed slad that will deform together with the sensor if tighten together. 👍 video!
I use a variation in my sons bed. The pressure mat wired to the dry contacts on a contact sensor. When he’s in bed it closes the sensor. Alerts me if he gets out of bed and if he’s up in the morning it kills his white noise machine and nightlight WLED wall art.
Great video! This is a project that I prepared to do already. I am planning to connect the wires from the pressure mat to a contact sensor instead of an ESP
Thanks! Be aware that while that will work fine, you won't be able to adjust the on and off time directly on the controller, so the response time will be immediate which may cause problems I mentioned in the video
Thank you for answering the "why not IR or microwave sensor" question. My first thought was, why not put two microwave sensors on the floor under the bed pointing up? I thought that you might be able to restrict a microwave sensor's field of view to allow for both sides of the bed.
the FSR could have worked, they come in many shapes and sizes but the one you got was far too small for a bed. they make large square ones and long strips those are the kind you need for a bed. Also you could simply use the pressure mat with a door/window sensor, all you need to do solder the wires to the magnet sensor bar thing.
This is indeed true! I may revisit it again! A few people commented that and it's s good idea, but I think I'd still prefer using an esp in this instance for being able to control the on/off time more easily - you could do this in automations but I think it's nicer doing it on the sensor itself. Nonetheless, it's a good idea!
Really interesting idea! Buying everything from the soldering iron to weight sensors is rather expensive while this would be a fun first esphome project.
The timing of this video is spooky. I went with the load cell method, bought them ages ago but only got round to wiring them last week, Couldn't figure out the best way to get them under the bed as I don't have a 3D printer, so I bought a FSR sensor, which arrived yesterday. Tried it and discovered like you did that it works great on the bench, but not when the expensive mattress is spreading the load. So, while trying to think of a way round it, I downloaded some files for load cell holders and sent them off to a well known Chinese manufacturer to get 3D printed. Now... do I go buy one of these as well.... ?? :D
@@EverythingSmartHome I'm guessing it is due to wiring as I wires on those load cells are really thin and might have damaged them whilst setting them up. I've got a super king bed and struggled to 'stretch them out' properly. I'll probably end up reusing those on my sofa. Looking forward to these new sensors though!
Great video. I was just thinking about doing something like this the other day. Also, a potentially more simplified option might be attaching one of those pressure sensors to a zigbee/zwave leak sensor. Since leak sensors just detect if it's circuit is closed, this might just do the trick.
I use one of these pressure mats under my mattress: I wired it to an Aqara door sensor (cutting away the magnetic sensor) and it works well, but as you experienced it's too quick and it has a bunch of false positives. And it's not good for the purpose I had in my mind: turning on the nightstand lamp when I got up at night. Turns out that the light goes on and off randomly (even if I added a delay to the automations) :D
LOL!!! I’ve been developing a medical sensor with the same logic and had the same issues with those FSRs having too much variance to be useful. Also using an esp on my app too.
I use a PWN sensor to see if our phones are plugged in, I'm tempted to just make it a use of shortcuts in iOS to make a post when plugged in (thinking the in built app might even send this automatically)
Great video! I am using also a similar sensor. I just wanted to point out my method with such sensors. The way they work better is to register them as trigger sensors throught tempate (template: in yaml) like: - trigger: - platform: state entity_id: binary_sensor.bed to: 'on' id: 'on' - platform: state entity_id: binary_sensor.bed to: 'off' for: '00:01:00' id: 'off' binary_sensor: - name: Bed Occupied unique_id: bedoccupiedid device_class: 'occupancy' state: > {{ trigger.id }}
I loved your original video about the bed sensor but it was a little bit out of reach for me to do the same. I achieved the same thing using the Withings sleep sensor, the only down side is that I need to use IFTTT to update the states of the sensors to home assistant by using a webhook. But other than that it works quite well. I love that now everything in my house turns off when we go to bed.
Super cool idea, and I might find some way to use this, however we read in bed so I don't want to turn off everything when we get into bed. I may look into this for when we both get up it turns off night mode. Currently I just detect when we turn our sound machine off for that.
If you're detecting when you turn it off to turn off night mode, are you detecting when you turn it on to turn on night mode? No, I wouldn't expect it to be a perfect solution either.
What about creating a durable, thin fluid or air filled plastic bladder with an internal pressure sensor when the bladder is under pressure? That could be placed under both sides of the mattress.
Nice build, cudos - but will it last? Some guys on the community home-assistant io seem to think these type of sensors will degrade fairly quickly? search the community for "Pressure pads for bed presence sensorts".. Comment was along the line of:"Don’t. They compress after a few months and start false triggering. Consider a force sensitive resistor instead."
Great follow up. This sensor reminds me of a sensor I did using a old mouse micro switch and on another chair one travel switch I believe it is called like that. I guess just glueing one of this on the bed wood slab would work just fine. Looking to this case and the bed slab deformation also could be used the weight cells but not the original design bridge configuration single cells but instead the ones based on an aluminum bar, just screw that alu bar sensor directly on the wood slab and the deformation will be the same on both triggering the weight sensor. Anyway 👍 video!
I saw in some video arround youtube a person using the aqara door sensor, connectec to those pressure sensor and looks to me a easy way to create presure sensores :)
What if you used multiple pressure sensors and place them under the feet of the bed frame? You could add the sensor values together to get the total weight of the bed, tare it, and trigger when the total weight increases by more than 100lbs from the tare level.
I am doing something similar, but with smartthings (for now). I think i have the same pressure pads, but they are connected to a zooz relay box, so the NC relays open when i get in bed. When we are both in bed and both relays are open, then it starts an automation that shuts down the house. Im moving those automations to espresence now, though, because it seems to be more reliable and easier to create personalized automations.
@@EverythingSmartHome im on the fence, but leaning towards being happy with them to be honest. in a couple of rooms it works really well, but i have issues in other places where the beacon bounces back and forth between 2 ESPs. my bedroom is above my rec room, and i have one in both, so my wife and i can both be in the rec room watching a movie and HA has one of us as in the bedroom and the other as the rec room or not home. Its better than it was, but having 8 of them in place, tweaking the absorption and distance to get accurate room readings has been a LOT of work. i think itll be awesome if i can ever get everything dialed in, but its been kind of frustrating so far.
Was there anything different that you did with the pressure mat? seems like no matter what I try, it seems to have the state as "on" once I put it under my mattress. Any suggestions?
Or, for a foolproof, long-term solution - just use Lewis's original bed weight/presence detector using the load cells. It's been working here for many months with no trouble.
Is the change in resistance dramatic enough that a moisture sensor (like the Aqara, with screw terminals) might be used? That'd obviate the need for the ESP device entirely.
I don't understand why my comment was removed, but those pads are not supposed to be folded. They break when folded. And they also break when your kids are jumping in the bed. But seeing how bouncy your slats are you could have used a aqra vibration sensor and looked at the angle of the sensor when mounted to the underside of the slats.
Great ideas! I love how simple analog accessories can be added a an esp and result in something awesome. I would love to see an explanation tho, on how a specific esp can be connected to HASS.
I managed to create the bed sensor using the pressure pad, but it's too sensitive. After sleeping on it, it stays in the on state. Any suggestions? My mattress is quite heavy.
I bought the US version you linked. The mat is connect to the chime via a connector with two wires. I just disconnected the chime put two dupont wires in the mat connector and connected the two ends to the opposite sides of an Aqara Water leak sensor. Seems to work fine. Takes maybe 10 seconds to register off. I will spin up mqtt explorer and time it. I don't know yet whether the cats sill trigger it.
Have you tried strain gauges? To me they seem like a good option as you stick them under your bed bottom, which flexes only when you lay down on it. (and when you throw a bag or something on it) I have ordered some, but haven't received them as of yet.
Could you put a loadcell under each post, and then zero out the weight of the bed? For use with multiple people, this could track what time and how often our 2yo and 4yo crawl in our bed each night.
Other than having something to tinker with why not use something like the withings sleep sensor? HA has integrations for withings and it supports ifttt
Interesting. But I simply put a motion sensor under my bed. When it senses my feet moving from my bed to the floor, my under bed strip light turns on. Allowing me to see where I’m walking at night.
See I think an FSR on the opposite end of an ottoman divan mattress to the hinge would be a very reliable method and one I intend to test out when I build my bed.
@@EverythingSmartHome I think because the end of the lifting frame will provide a hard reference point that is affected by pressure on any area of the mattress it will be a lot more reliable. Will try and remember to get back to you when I eventually get that project underway!
Those pads are not supposed to be folded. That will destroy them. With slats that bouncy, you could make it even simpler with a aqara vibration sensor which also gives a angle reading.
@@phil-jc8hp i haven't tried it but I have seen others with good results. And given how bendy his slats are I would believe there is enough to get a result.
There are a couple of 'sleep monitoring' sensors that will track respiration and heart rate, operating in the 60 Ghz range. I've no experience with it, but I suspect that the target market is folk suffering more from sleep apnea than the home automation market. Considering that market, the (about) $50 US per sensor (on up to over $150) probably isn't unacceptable, but I would consider it unacceptable for home autmation home brew kit. A fix for the FSR limitations would be to get 4 (or more if needed) and treat them as load cells under the feet of a bed. I realize that there may be some limitations for accuracy, but if the bed has 4 'feet' of some sort, then 4 of these wired to a wemo d1 on analog ports would give a simple solution for setting up at home to see if a load sensor solution would end up working out. After all, getting things 3d printed isn't really difficult, even if you don't have a printer.
Nice alternative sensor run through. Though is be nightly careful about making an automated door unlocker without soon AI detection: to many house thefts around here taking adventurer of doggy doors 😜
I still have that pressure mat when i tried using it with zigbee door sensor as wireless bed sensor. But it didn’t work too well I might have to try it again with esp.
@@EverythingSmartHome in fact, if you do try it again, they often have a sliding plastic end. If you put it inside between plastic and slat there would be less abrasion to the sensor.
@@EverythingSmartHome Thank you for the response and I apologize, but what I meant was: does the D1 mini receive its power through the USB plugged into a wall receptacle in order to read the changes of the states at the pressure mat.
Need to get one! Wonder if it works in a queen size bed (two matrasses, one sensor each) detecting the presence of one or two persons. In other words, one side is occupied is it detected by the detector on the other side as well? I will see ...
@@EverythingSmartHome Thanks for replying! Though, currently I am trying to automate using bluetooth oral-b toothbrushes as we always go to bed straight after brushing. However, I haven't had the time to finish up sadly.