Thanks for the great video! I have build it myself with ESPHome and I found that the "delayed_on_off" filter works much better than "delayed_on" and "delayed_off" because "delayed_on_off" is intended to debounce binary switches, while the others are intended to debounce push buttons.
Just stopping by to say your videos rock, I've watched them all and they've helped me improve my HA setup. Super easy to follow, always pretty witty and just a good ol time. Thank you for taking the time to make these videos and educate some of us on how to improve our automations and homes!
@@HomeAutomationGuy Hi Alan, I opted for a pair of DIY pressure mats, filters lines made a huge improvement to my automations, but I have a very tight threshold setup on ESPHome due to mattress, duvet and my wife's countless pillows. How is sensitivity on this pressure mats you used?
FWIW the mat you chose was an alarm mat. That means the other 2 wires you could not figure out what they were, were the break-detect lines. All alarm equipment have them, from door switches to PIR sensors. It basically ensures the integrity of the alarm state should someone tamper with the sensor. Cool vid and yes ESP devices can be a very easy and low power way to set up smart sensors.
Great video. I saw another video doing similar thing, using Aqara water leak sensor, so I got the same pressure mat he did and the Aqara leak sensor. It worked, but an issue I had was the time it took to show clear was taking to long for my application. So I tried the ESP32 method, using your code, but I removed the delayed on and reduced the delay off to 3 seconds. We will see how that works. But first thing I noticed is it was precise to show clear on occupancy at the 3 seconds.
The other 2 wires are for a security loop, when used in alarm systems. They are powered from the alarm system and will 'always' be live unless the wires to the mat are cut, alerting the alarm system to a problem with that sensor.
I just wanted to mention that the version of this same sensor mat that they sell on Amazon in US only has two wires. The wires terminate in a plug that connects to a small alarm/chime box. I cut the wires a few feet from the female plug connected to the alarm box so I can disconnect it in the future and then connected those to my ESP32 and it worked great
Just wanted to say thanks for putting this video together. I had an ESP32 laying around so I went the ESPHome route with the config from your site and I just got it working!
Your esphome tutorial made me confident to move into the esphome. Somehow being quite bothered by lots of sensor need to be integrated via so many different platform
First when i started with ESPHome, I thought it was really hard to understand. But once i got into it, it was easier than i expected. 😀 Thank you for a great video as always!
I felt the same way - I thought it was really daunting and avoided it. As usual, once I discovered a project like this that I could use to test it out with that actually added value to my home, it became easier to understand and use!
That a good alternative use for the leak detector, I've used one like this as a rain detector connected to a rain sensor board. You can of course also use a lower cost window/door sensor just by by-passing the reed switch. I use such a device to detect when my front door is locked (not closed ... . actually locked).
I use ESPHome for almost everything. I now use about 130 different ones, ranging from controlling an LED strip to ESPs that have different sensors attached to them, but now also several with a Tuya chipset that I have flashed to get them from the cloud. .
I have several ESPHome devices. One is a small relay based on a Sonoff SV that unlocks the main security door with a toggle that keeps it powered for 5 seconds then releases. This door would normally be controlled via a push button on the intercom system, but I use it as a remote control so I don't need to worry about finding my key all the time for the common area doors. I also have several LED Strips, analogue and digital, that are controlled via ESPHome. I originally was using Tasmota on the door relay, but found ESPHome to be an easier option to maintain within Home Assistant.
I am using an Esphome device with an infrared receiver and an emitter to control the Air Conditioned with the "climate" module. It even detects when I control the Ac via the remote control and the settings are sent to HomeAssistant!
Nice video. Question, if I put the pressure sensor between my mattress and box spring, won't the weight of mattress trigger the pressure sensor on all the time?
I'm using ESPHome with an ultrasonic sensor in my water softener to give me the raw distance to the top of the salt pellets, then calculate the used and remaining height in cm and % of salt used vs remaining. I also used the same setup to measure the amount of water in the Christmas tree reservoir and sent alerts when it got too low.
Do you have a guide you followed for that? I have a water softener and I always forget to refill the salt blocks. The softener came with a Mobile App, but it sucks so bad and requires internet connectivity which is really annoying. I assume the softener already has ultrasonic sensors it for the inbuilt app, and I wish I could just wire into those!
Great video! Am going to try this out. The method using Aqara's water leak sensor is a good approach but I do also like the ESP32 option. The only drawback is that the ESP32 would need to be powered via USB.. unlike Aqara's water leak sensor on CR32 batt.
Yeah. That's true. But I'm on a mission to try and get rid of my battery powered devices. I'm also not sure how long a water leak sensor battery will last if it's constantly triggered via the bed sensor
Hey, also used those mats (sensor) under our bed and they worked quite a while. But after some months the triggered fals alarms or dont go from occupied to unoccupied sometimes. Now i am using two FSR stripes and ADC meassuring, but also have sometimes issues with fals triggers (after making bed...). I think the holes between the wood "destroying" them over time with the person weight on top. I think a solution would be to use some sort of thin plastic under the pressure mat to support it and not squeeze it into the holes between the wood. Do you guy's have those issues with the mat? What do you think about the idea? thx
I made an accent/night light in my bathroom which turns on via motion sensor and adjust brightness based on time of day. I also made an IR receiver which listens for specific buttons on my TV remote which the TV doesn't actually respond to. My TV remote has a numpad and so far as I can tell it is not used at all by the TV. I programmed HA to do various things like turn on or off lights in the area of that box, convenient diy universal remote for when you just sat down and forgot to turn the light off and you have the remote in your hand
I'm using an Aqara door sensor with a (much smaller) pressure mat. My goal was to have the nightstand light on when I wake up at night, but there are too much false positives and the light will turn on randomly during my sleep. Of course for this purpose I cannot use long delays, in fact in my automation the light will turn on after 2 seconds of "bed not occupied", otherwise I should stand still to wait for the light to turn on before moving away from the bed. So I use the sensor for the mornin wake up routine: if I'm not out of the bed after 10 minutes from the routine start, my bedroom light will turn on and the echo dot clock (playing my favorite radio station) volume will go up.
Here's an idea for your next project: try using 60GHz mmwave sensor to monitor your breathing/heartbeat while asleep, since you already have the contraption under your bed ;-)
I plan to use ESPHome for multiple different things like: - Water leak detection - CO2 fill grade and leakage detection for the water dispencer - Bed occupancy - Irrigation/Sprinkler system - Parcel and Letter box - Weather station (with multiple sensors including lightning detection, rain, wind, temp, uv etc) - Air quality (Airrohr, Sensor Community) - Air freshener - BT proxy for radoneye and for sure more upcomming. ESPHome is a great system with a huge amount of possibilities. Sometimes at smart homes you have to think about possible data and how to interpretate them like my temperature sensors at water pipes to detect if somebody uses the shower or bathtube.
This was great - I got set up in an afternoon following your guide and now have the alarm automatically arm and lights shut off for these. Still trying to figure out the right positioning for the pads. Has anyone done any adjustment to sensitivity for heavier mattresses? If not may build a container around the mat to alleviate some pressure
Honestly have just started with esphome, about to reconfigure 3 devices I built and one Tuya device I rechipped to esp yet programmed all to Tasmota. Then learned Tasmota needed MQTT... then learned I was running Container HA.... Then pulled a Nuk off the shelf, fought the HA OS install to get on the M2 with live disk.. Now just starting on ESPHOME or any other plugins. Want cloud free as much as I can, but it's a learning curve for someone with "Basic" skills... No I really mean the last programming language I learned played the theme to MASH over the PC speaker in DOS.. 30 years of catching up.
I love when a simple Home Project like this turns into a massive rabbit hole of "yak shaving". And kudos to the Basic skills, this is exactly where I started a few decades ago - re-writing parts of the Gorilla QBasic game to make the banana explosions have a massive radius. Keep it up Hawkeye 😉
@@HomeAutomationGuy Geeze talk of Qbasic and such... Sorry I got kicked out for rigging all the lab computers to play different parts of AxelF when the tardy bell rang... Entire 8 minutes. that was my best back then... go away from it all... OK kicked from class.. Now realizing I need to learn some code. Been fun learning for sure.
Using the leak sensors as the trigger is genious. I'd be tempted to set this up except worried that on a date night, if the dog walked into the room, it'd have a seizure with the lights strobing off and on (/j)
I went the half load cell method, turns the bed into a massive weighing scale so you can work out if it's just you, the wife or both in bed and run different automations
I agree that this is a much more accurate method. But it's a lot more work to set up. On the plus side, you can then use your bed to weigh your suitcase before you go on a trip!
Love this leak sensor idea to make it zigbee compatible. I actually already had a very cheap zigbee leak sensor I wasn't using that had two contact prongs on the end. I cut that off to expose the wires and they can then be connected to the pressure pad. Benefit of this is that the prong was on a long wire so it's more flexible where I place the zigbee transmitter.
Question: if you place the pressure mat underneath a mattress, won't the weight of the mattress trigger the pressure mat sensor mistakenly sending a message that someone is on bed?
I think you can change the pressure level to some extent allowing you to "Tare" the mattress pressure. My issue was with using a temperpedic which doesnt nessarly translate all the weight directly enough, which equated to needing a much higher sensitive device.
@@Vanka473We have a Tempur-Pedic and what I used was an esp wired to 2 load cell modules wired with a 4 cell H bridge configuration. I put three of the cells from each module on the side rails under the box spring and the 4th cell under the middle support about a 1/3 of the way in (basically where each person roughly lays). using ESPhome, I found the base signal (i.e. the matress/box spring weight), set this to equal 0 as a tare weight, the added 50lbs to 1 side to calibrate that side, the the other. It's not 100% accurate, but it works well enough that it knows who is in bed based off the weight. My only 2 complaints with the system is that the wires on the load cell are incredibly thin so they are fragile and difficult to work with. the other complaint is that box spring slides since the frame is metal and the load cell is metal.
I have a pressure mat under a foam mattress, which is much heavier than a conventional spring mattress, and it still doesn't register as occupied with the weight of the mattress alone.
I have the even more expensive sensor option. We own a Select Comfort SleepNumber bed and HA has an integration for their SleepIQ app. I do find that due to movements I can't rely on the occupancy state. Just thinking out loud, but in order to 'filter' the state (like you demo with the esphome sensor), I need to increase the "Duration" in the Automation for both both state changes.
@@HomeAutomationGuy This is my second Select Comfort bed. The first was bought over twenty years ago before home automation's current push into all facets of our homes. When we needed to replace the aging bed 5 years ago, I was excited to find out they moved away from RF bed controls to a phone app. Only after getting into Home Assistant did I find out that there was an integration for HA to control the bed -- under-bed light, bed firmness, head/foot position, and I am guessing bed temperature. We don't have that feature, but in the winter I dream of how nice it would be to crawl into a toasty warm automation-controlled bed.
No, rather the opposite. This sensor is for alarm system, so tuned to sense when someone steps on it, therefore the it is not too sensitive, the specification is 25 kgs / 5 cm2. So if it is a flat surface under the mattress, it is likely this won't even be triggered by your weight, as the mattress distributes it evenly on a large surface. If there are few cm wide boards under the mattress (like in this video) then the pressure is high enough to trigger the sensor. The problem is, how long this type of simple sensor will last, as it was not designed for constant loads, so in the long run it might produce false triggers.
... Oh man ... yet another sensor that I have to buy :D Thanks for the video! However, I am curious about the sensitivity of the sensor. Is it a simple binary switch or is it possible to set a threshold? I am wondering about the weight of whatever you put on top. What if you have a very heavy mattress?
I’ve been using it for approximately a month now and it’s been awesome so far! I’m using the Aqara method and using the sensor to only trigger the waking up automations like turning on the lights and blasting the alarm and lifting the shades only when I am already in bed.. and it doesn’t turn off the lights and keeps annoying me with the alarm until I get out of bed (eliminating the spaming snooze dilemma 😅) But lately I’ve been facing an issue where it stays on occupied even when I get up, and then I’ll have to hit the mat multiple times until it gets fixed.. it’s like the mat gets bent down and the circuit stays closed for some reason.. any ideas how I might fix it?
Trying to find an answer to a question on here what happens when you put the bed on top of the mat how does it know that it’s just the bed and not somebody occupying the bed? Is there a way to set a home position and then the occupy
This is very interesting and I've been wanting a bed sensor. The part i wished you covered was why this method over a load cell? For example how does this work eith say a heavy bed?
@@HomeAutomationGuy Hmm. I ended up watching Lewis's video on it and got some clarification where he was talking about the best slats distributing the load and such. I went ahead and ordered the pressure pad as I really want this solution to work for me. I did like how easy you made it. I didn't realize using the ESP32 GPIO was this easy.
Great video. I started with door sensor but the batter didn’t last long. Am no using your ESPHome method which is working great. Does any one knows a way to turn off the power LED?
I ordered 2 defender doormats to pair with the aqara sensors, but they only trigger when I'm standing on them.. A slight push or laying on my bed with the sensors underneath doesnt do anything. Any ideas?
Great writeup / video! Just having a play with one and find that it works when I get into bed but then thinks I get out when I lay down. I am guessing positioning is important - it looks like you have yours folded over -0 is that the key? Cheers!
I had to fold/move/adjust mine a few times to get it working accurately. I found placing it at "butt level" in a folded way worked best for me and my mattress
If you run your HA on a pi, you could also hardwire it using the raspberry pi's GPIO pins and make a binary sensor. That way you could make one dirt cheap
I've got a 4 switch box near my keyboard with an ESP8266 running ESPHome. One switch is set to toggle both of my Pi-Hole instances on or off (some website comments sections are blocked by Pi-Hole). The other switches control my WLED lights through Home Assistant.
Use velostat (Linqstat) more cheaper, more accurate and more flexible and finally you have choice to measure how much pressure as well!! (with ESPhome project)
I am wondering if it is somehow possible to tell which person is on which side based on weight difference? Are there alternatives to these pressure mats that can actually differentiate by weight rather than just on or off?
Hi Mate, great vid! I have a question though :) bed is not only for sleeping right? So how those sensors react when there are 2 person on one side of the bed in jumping motion? :> And how sensitive is it, I have 2 cats and I'm curious if they would trigger it.
I have an automation that detects if two people are on one side of the bed in jumping motion, to automatically dim the lights and start playing Barry White on the Sonos. In my experience you need to put at least 8-10kg of weight on it to trigger the sensor, so it depends how heavy the cat is.
@@HomeAutomationGuy Actually, how do you detect that two people are on one side of the bed, let alone in a jumping motion?I thought it's a "on" "off" trigger?
Question! Using the Aqara sensor, could you wire up two pads to the terminals and have the same effect? I know it would only see it as one sensor, but for the function I am thinking of that's all that would matter. I just want to know if one of either two beds, that are next to each other, is occupied.
Mine isn't triggered by the mattress weight if I spread the mat out under the mattress. Mine only triggers when a lump like myself gets on top of the bed too. There's no way to control the sensitivity of it, but I was able to get it working consistently by fiddling around with the placement of the mat under the mattress over the course of a few nights
I really enjoy your content. Also it comes in the perfect moment for me, as I bought a bunch of ESP8266 D1 mini for a BME280 and stuff. How would you take care of the power for the ESP? Usually I'd love to rebuild the ESP version but having several cables under my bed sounds a bit unsafe to me.
I just plugged it into a USB power adapter. I've got loads of cables under my bed already for charging my phone, and other devices. So I personally wasn't worried about adding one more
Mine isn't triggered by the mattress weight if I spread the mat out under the mattress. Mine only triggers when a lump like myself gets on top of the bed too. There's no way to control the sensitivity of it, but I was able to get it working consistently by fiddling around with the placement of the mat under the mattress over the course of a few nights
I have had plans to create such a sensor. for a long time. I just don't know how I'm going to integrate it into smartthings. There does seem to be a way to put an ESP 32 into the smart home platform, but I have. not had time to try it out. It seems kind of confusing. If you have any ideas, I'd be happy to hear.
I am having and issue with the yaml file being installed . Entered just like shown . Didnt know how to copy and paste but entered it manually. Any help would be greatly appreciated.
I use ESPHOME to get the water levels of my swimming pond and water tank using pressure sensors. Also outdoor and pond water temperatures. I get co2 values around the house to determine how hard my ventilation system should work. I have light sensors, buttons, humidity sensors, the built in Bluetooth captures the i go from my xiaomi scale... Esphome can do it all! How do you power your esp32 bed sensor? Usb power plug or battery?
My immediate thought when I saw this was about a system we tried to use for an elderly relative that lives on their own. To be clear, it is not Aqara based an had very few settings and none that we could tweak ourselves. It only allowed us to specify when the person should be in bed and when they should be getting out of bed. If they went to bed earlier that was fine and if they got up in the night and returned within an acceptable window of time then that was fine too. If they did not go to bed on time or they got up in the night and stayed out of bed then an alarm was triggered with a call centre. The problem was that it was not 100% reliable and would give false positives meaning the call centre would call the house in the night only to wake up the occupant. Getting to 100% reliability with elderly care is very nearly impossible but false positive (and indeed worse false negatives) are a nightmare and we gave up on that system. I'm more tempted by the millimeter wave presence sensors that Aqara makes but even those cannot be 100% accurate so then it might need to be a combination of sensors, pressure, millimeter wave, and possibly something that could go under the bed legs to weigh the bed.
I think a combination of sensors would work ideally here. You could also use BLE presence to track what room someone is in if they have a fitbit or smart watch or similar
Ventil aktuator er nok det mest korrekte navn. Jeg har haft en siddende i 6-7 år, fungere perfekt, og har massere af kræfter. Det er så udgaven uden nogen kontroller (styres bare med 12v direkte, men har microswitches til endestop). Det var den eneste jeg kunne få for under 80kr fra Kina, den gang det var beløbs grænsen 😆
Firstly, I wanted to use it as an excuse to learn about ESPHome, and secondly I actually built it in the days before the MMWaves were as affordable as they are today. mmWave is a good option though if all you care about is occupied or not.
The outcome would be the same, but it means you need to crack open the contact sensor and do some soldering. The leak sensor terminals are really convenient
I used the Aqara contact sensors for this, didn't even occur to me to try the leak detectors, once all wired up the input is inverted, so "clear" means someone is in the bed, easy enough to use a template binary sensor to invert, but a little annoying, so would definitely recommend the leak sensor over contact sensor
@@taavi470 can you invert the contact sensor in the ui or is it just a template using Yaml? I think I’ll use a contact sensor because I want to get back into soldering again
@@michaelthompson657 I didn't find a way to do it in the UI, not sure did I miss something, I'm using a template binary sensor in yaml with a state like {{ is_state('binary_sensor.bed_occupancy', 'off') }}
Great video. Love the idea of repurposing Aqara leak sensors for this! Does anyone know where to source the mat in Canada without overpaying? Not available on Amazon here and Google searches result in webstores with zero stock or eBay listings with 1000% markups lol. Direct purchase from the manufacturer (Switch Electronics, linked in article) is a great price, but the shipping costs are way too high for a single unit.
Yep - that's very true. Then you can use a combination of Conditions or Wait For Trigger in your automations to customise them to your own habits and environment. For example, you could not run the night time routine if the reading light is on - or better yet use the Wait For Trigger action in your automation actions to wait until the reading light gets turned off for 10 mins before it does the rest of the routine. There are a lot of flexible options for this type of automation - I just tried to show a generic starting point automation that people can use to build on top of.
I use the FormatBLE HACS integration, and now I can track my BLE presence using the same ESPHome devices around my house. My bed sensor, and my Everything Presence One devices all track the BLE beacons. It works great! github.com/formatBCE/Format-BLE-Tracker
As a alarm engineer of 35 years , I would not trust the pressure mats to be reliable over a period of time., The industry does not allow them, All they are are 2 layers of foil seperated by a thin layer of foam with holes in, that allow the 2 foil layers to connect together. The life time will be severly reduced with them draped over the bed latts as the foil will be folded at that point. Great use case though, I use water leak sensors too, to get the lock / unlock status of our cars
@@invinciblemode I would imagine the correct title would be an electronic security engineer, and I started work as one with a national company when I was 16 years old so that's how.
would it work with a diy pressure pad :0 , these ones are really hard to find here soo i was wondering if i made a simple one like ua-cam.com/video/c6RXu0pYUVI/v-deo.html
Any decent mattress makes this useless as the pressure is never enough to close the circuit. If the circuit closes, your mattress is shit mate and it will hurt your back sooner or later ;)
Depends on what's underneath. If a fully flat surface, then you're right, the pressure won't be high enough. But most bed bases have few cms wide slats, and those provide higher pressure there, so the mat is triggered without being uncomfortable.
May I suggest that you also include the buymeacoffee method of supporting you? I'd like to give you a little gesture of appreciation, but the superthanks stuff is too complicated.
Thanks for the great video!
I have build it myself with ESPHome and I found that the "delayed_on_off" filter works much better than "delayed_on" and "delayed_off" because "delayed_on_off" is intended to debounce binary switches, while the others are intended to debounce push buttons.
Great tip! I didn't know about that one. I'll switch my code now and see how it goes.
Thanks for sharing! 🙏
Just stopping by to say your videos rock, I've watched them all and they've helped me improve my HA setup. Super easy to follow, always pretty witty and just a good ol time. Thank you for taking the time to make these videos and educate some of us on how to improve our automations and homes!
Thanks so much for the comment! It's comments like this that make me keep going and continue to put the effort in
@@HomeAutomationGuy Hi Alan, I opted for a pair of DIY pressure mats, filters lines made a huge improvement to my automations, but I have a very tight threshold setup on ESPHome due to mattress, duvet and my wife's countless pillows. How is sensitivity on this pressure mats you used?
FWIW the mat you chose was an alarm mat. That means the other 2 wires you could not figure out what they were, were the break-detect lines. All alarm equipment have them, from door switches to PIR sensors. It basically ensures the integrity of the alarm state should someone tamper with the sensor.
Cool vid and yes ESP devices can be a very easy and low power way to set up smart sensors.
Makes sense! Thanks for the info, there was 0 documentation with the mat itself so I had no idea 😃
Great video. I saw another video doing similar thing, using Aqara water leak sensor, so I got the same pressure mat he did and the Aqara leak sensor. It worked, but an issue I had was the time it took to show clear was taking to long for my application. So I tried the ESP32 method, using your code, but I removed the delayed on and reduced the delay off to 3 seconds. We will see how that works. But first thing I noticed is it was precise to show clear on occupancy at the 3 seconds.
The other 2 wires are for a security loop, when used in alarm systems. They are powered from the alarm system and will 'always' be live unless the wires to the mat are cut, alerting the alarm system to a problem with that sensor.
Well that's good to know. Thank you!
If you look carefully you can see, and feel through the plastic coating, the two wires that are just a loop
I just wanted to mention that the version of this same sensor mat that they sell on Amazon in US only has two wires. The wires terminate in a plug that connects to a small alarm/chime box. I cut the wires a few feet from the female plug connected to the alarm box so I can disconnect it in the future and then connected those to my ESP32 and it worked great
Just wanted to say thanks for putting this video together. I had an ESP32 laying around so I went the ESPHome route with the config from your site and I just got it working!
Amazing! Congratulations!
Your esphome tutorial made me confident to move into the esphome. Somehow being quite bothered by lots of sensor need to be integrated via so many different platform
It's fun to start playing with, and you can slowly use it more and more in your house
Excellent works! I learned so much from you in the past week looking into Home Assistant. Thank you!
Sounds like a great use for a mm wave sensor.
Yep, you could use a mmWave sensor here too instead of the pressure mat.
First when i started with ESPHome, I thought it was really hard to understand. But once i got into it, it was easier than i expected. 😀 Thank you for a great video as always!
I felt the same way - I thought it was really daunting and avoided it. As usual, once I discovered a project like this that I could use to test it out with that actually added value to my home, it became easier to understand and use!
Now i can finally make a "Whoopie cushion" for HA .... lol
🤣🤣🤣
Yes! I love this! Pressure pad so when somebody sits on a seat Alexa will make a fart noise! Using this at my next party!
I followed your recommendations and it works perfectly. Thanks!
I'm so glad it was helpful! Thanks for sharing!
@@HomeAutomationGuy How do you work around the weight of the mattress from triggering the sensor?
@@ronsissons8994 I luckily didn't need to. My particular mattress doesn't seem to be heavy enough to trigger it without also me lying on top of it.
That a good alternative use for the leak detector, I've used one like this as a rain detector connected to a rain sensor board. You can of course also use a lower cost window/door sensor just by by-passing the reed switch. I use such a device to detect when my front door is locked (not closed ... . actually locked).
I used very inexpensive pressure sensors designed to be used in cars for presence detection/seatbelt sensor.
Oh wow. That's really clever! I'm going to have to look those up
Love this. would never had thought of using the leak sensor!
I use ESPHome for almost everything. I now use about 130 different ones, ranging from controlling an LED strip to ESPs that have different sensors attached to them, but now also several with a Tuya chipset that I have flashed to get them from the cloud. .
I have several ESPHome devices. One is a small relay based on a Sonoff SV that unlocks the main security door with a toggle that keeps it powered for 5 seconds then releases. This door would normally be controlled via a push button on the intercom system, but I use it as a remote control so I don't need to worry about finding my key all the time for the common area doors. I also have several LED Strips, analogue and digital, that are controlled via ESPHome. I originally was using Tasmota on the door relay, but found ESPHome to be an easier option to maintain within Home Assistant.
Cool use of ESPHome for the door lock! I love it!
I am using an Esphome device with an infrared receiver and an emitter to control the Air Conditioned with the "climate" module. It even detects when I control the Ac via the remote control and the settings are sent to HomeAssistant!
Nice video. Question, if I put the pressure sensor between my mattress and box spring, won't the weight of mattress trigger the pressure sensor on all the time?
I would imagine you would be able to calibrate the pad but that will come with the intructions
I'm using ESPHome with an ultrasonic sensor in my water softener to give me the raw distance to the top of the salt pellets, then calculate the used and remaining height in cm and % of salt used vs remaining. I also used the same setup to measure the amount of water in the Christmas tree reservoir and sent alerts when it got too low.
Do you have a guide you followed for that? I have a water softener and I always forget to refill the salt blocks. The softener came with a Mobile App, but it sucks so bad and requires internet connectivity which is really annoying. I assume the softener already has ultrasonic sensors it for the inbuilt app, and I wish I could just wire into those!
Great video! Am going to try this out. The method using Aqara's water leak sensor is a good approach but I do also like the ESP32 option. The only drawback is that the ESP32 would need to be powered via USB.. unlike Aqara's water leak sensor on CR32 batt.
Yeah. That's true. But I'm on a mission to try and get rid of my battery powered devices. I'm also not sure how long a water leak sensor battery will last if it's constantly triggered via the bed sensor
You can get ESP32 modules with built-in support for connecting a LiPo battery (including a charging circuit)
Great video, by the way, Alan! 🙂
Hey, also used those mats (sensor) under our bed and they worked quite a while. But after some months the triggered fals alarms or dont go from occupied to unoccupied sometimes.
Now i am using two FSR stripes and ADC meassuring, but also have sometimes issues with fals triggers (after making bed...).
I think the holes between the wood "destroying" them over time with the person weight on top.
I think a solution would be to use some sort of thin plastic under the pressure mat to support it and not squeeze it into the holes between the wood.
Do you guy's have those issues with the mat?
What do you think about the idea?
thx
I made an accent/night light in my bathroom which turns on via motion sensor and adjust brightness based on time of day. I also made an IR receiver which listens for specific buttons on my TV remote which the TV doesn't actually respond to. My TV remote has a numpad and so far as I can tell it is not used at all by the TV. I programmed HA to do various things like turn on or off lights in the area of that box, convenient diy universal remote for when you just sat down and forgot to turn the light off and you have the remote in your hand
I'm using an Aqara door sensor with a (much smaller) pressure mat. My goal was to have the nightstand light on when I wake up at night, but there are too much false positives and the light will turn on randomly during my sleep. Of course for this purpose I cannot use long delays, in fact in my automation the light will turn on after 2 seconds of "bed not occupied", otherwise I should stand still to wait for the light to turn on before moving away from the bed. So I use the sensor for the mornin wake up routine: if I'm not out of the bed after 10 minutes from the routine start, my bedroom light will turn on and the echo dot clock (playing my favorite radio station) volume will go up.
Here's an idea for your next project: try using 60GHz mmwave sensor to monitor your breathing/heartbeat while asleep, since you already have the contraption under your bed ;-)
I plan to use ESPHome for multiple different things like:
- Water leak detection
- CO2 fill grade and leakage detection for the water dispencer
- Bed occupancy
- Irrigation/Sprinkler system
- Parcel and Letter box
- Weather station (with multiple sensors including lightning detection, rain, wind, temp, uv etc)
- Air quality (Airrohr, Sensor Community)
- Air freshener
- BT proxy for radoneye
and for sure more upcomming.
ESPHome is a great system with a huge amount of possibilities. Sometimes at smart homes you have to think about possible data and how to interpretate them like my temperature sensors at water pipes to detect if somebody uses the shower or bathtube.
What a great list of future projects I can try! Thanks for sharing!
This was great - I got set up in an afternoon following your guide and now have the alarm automatically arm and lights shut off for these. Still trying to figure out the right positioning for the pads. Has anyone done any adjustment to sensitivity for heavier mattresses? If not may build a container around the mat to alleviate some pressure
Haha. I'll take this video off my list that I was going to do shortly 😅
Great video.
It's a fun project!
Honestly have just started with esphome, about to reconfigure 3 devices I built and one Tuya device I rechipped to esp yet programmed all to Tasmota. Then learned Tasmota needed MQTT... then learned I was running Container HA.... Then pulled a Nuk off the shelf, fought the HA OS install to get on the M2 with live disk.. Now just starting on ESPHOME or any other plugins. Want cloud free as much as I can, but it's a learning curve for someone with "Basic" skills... No I really mean the last programming language I learned played the theme to MASH over the PC speaker in DOS..
30 years of catching up.
I love when a simple Home Project like this turns into a massive rabbit hole of "yak shaving". And kudos to the Basic skills, this is exactly where I started a few decades ago - re-writing parts of the Gorilla QBasic game to make the banana explosions have a massive radius. Keep it up Hawkeye 😉
@@HomeAutomationGuy Geeze talk of Qbasic and such... Sorry I got kicked out for rigging all the lab computers to play different parts of AxelF when the tardy bell rang... Entire 8 minutes. that was my best back then... go away from it all... OK kicked from class.. Now realizing I need to learn some code. Been fun learning for sure.
Using the leak sensors as the trigger is genious.
I'd be tempted to set this up except worried that on a date night, if the dog walked into the room, it'd have a seizure with the lights strobing off and on
(/j)
🍆👉👌
I went the half load cell method, turns the bed into a massive weighing scale so you can work out if it's just you, the wife or both in bed and run different automations
I agree that this is a much more accurate method. But it's a lot more work to set up.
On the plus side, you can then use your bed to weigh your suitcase before you go on a trip!
@@HomeAutomationGuy or yourself - esp after a big dinner.
Love this leak sensor idea to make it zigbee compatible. I actually already had a very cheap zigbee leak sensor I wasn't using that had two contact prongs on the end. I cut that off to expose the wires and they can then be connected to the pressure pad. Benefit of this is that the prong was on a long wire so it's more flexible where I place the zigbee transmitter.
Great stuff! Good re-using of unused smart home tech!
Question: if you place the pressure mat underneath a mattress, won't the weight of the mattress trigger the pressure mat sensor mistakenly sending a message that someone is on bed?
I think you can change the pressure level to some extent allowing you to "Tare" the mattress pressure. My issue was with using a temperpedic which doesnt nessarly translate all the weight directly enough, which equated to needing a much higher sensitive device.
I was worried about that too, but my mattress doesn't trigger it on its own
@@Vanka473We have a Tempur-Pedic and what I used was an esp wired to 2 load cell modules wired with a 4 cell H bridge configuration. I put three of the cells from each module on the side rails under the box spring and the 4th cell under the middle support about a 1/3 of the way in (basically where each person roughly lays). using ESPhome, I found the base signal (i.e. the matress/box spring weight), set this to equal 0 as a tare weight, the added 50lbs to 1 side to calibrate that side, the the other. It's not 100% accurate, but it works well enough that it knows who is in bed based off the weight. My only 2 complaints with the system is that the wires on the load cell are incredibly thin so they are fragile and difficult to work with. the other complaint is that box spring slides since the frame is metal and the load cell is metal.
I have a pressure mat under a foam mattress, which is much heavier than a conventional spring mattress, and it still doesn't register as occupied with the weight of the mattress alone.
@ebenezervalvi1009 thanks I have a temperpidic and this is what I was worried about. Did you find a sensor pad that works?
I have the even more expensive sensor option. We own a Select Comfort SleepNumber bed and HA has an integration for their SleepIQ app. I do find that due to movements I can't rely on the occupancy state. Just thinking out loud, but in order to 'filter' the state (like you demo with the esphome sensor), I need to increase the "Duration" in the Automation for both both state changes.
Oooh. Smart bed! A whole device I'd never even considered before!
@@HomeAutomationGuycheckout eightsleep
@@HomeAutomationGuy This is my second Select Comfort bed. The first was bought over twenty years ago before home automation's current push into all facets of our homes. When we needed to replace the aging bed 5 years ago, I was excited to find out they moved away from RF bed controls to a phone app. Only after getting into Home Assistant did I find out that there was an integration for HA to control the bed -- under-bed light, bed firmness, head/foot position, and I am guessing bed temperature. We don't have that feature, but in the winter I dream of how nice it would be to crawl into a toasty warm automation-controlled bed.
How does this work with a heavy mattress? Would it constantly be on?
No, rather the opposite. This sensor is for alarm system, so tuned to sense when someone steps on it, therefore the it is not too sensitive, the specification is 25 kgs / 5 cm2. So if it is a flat surface under the mattress, it is likely this won't even be triggered by your weight, as the mattress distributes it evenly on a large surface. If there are few cm wide boards under the mattress (like in this video) then the pressure is high enough to trigger the sensor. The problem is, how long this type of simple sensor will last, as it was not designed for constant loads, so in the long run it might produce false triggers.
Which power cable do you recommend for the ESP32?
you could do the same thing with a load cell .... with a added bonus it weigh you at the same tiem
Can’t wait to try this!
Have fun with it!
How you close your curtain?
I have one of the manual models, but mine is covering the entire window, instead of installed on the window space.
... Oh man ... yet another sensor that I have to buy :D Thanks for the video! However, I am curious about the sensitivity of the sensor. Is it a simple binary switch or is it possible to set a threshold? I am wondering about the weight of whatever you put on top. What if you have a very heavy mattress?
This is a simple binary switch. It seems to work fine for me with the weight of my mattress and bedding on top and detects us when we get into bed.
I never thought that flood sensors could be used like that. in the end it's just a capacitive sensor actually.
I clicked on the link to pressure sensor in your blog article and it's already listed as unavailable on Amazon. What other sensors would work?
I’ve been using it for approximately a month now and it’s been awesome so far! I’m using the Aqara method and using the sensor to only trigger the waking up automations like turning on the lights and blasting the alarm and lifting the shades only when I am already in bed.. and it doesn’t turn off the lights and keeps annoying me with the alarm until I get out of bed (eliminating the spaming snooze dilemma 😅)
But lately I’ve been facing an issue where it stays on occupied even when I get up, and then I’ll have to hit the mat multiple times until it gets fixed.. it’s like the mat gets bent down and the circuit stays closed for some reason.. any ideas how I might fix it?
Trying to find an answer to a question on here what happens when you put the bed on top of the mat how does it know that it’s just the bed and not somebody occupying the bed? Is there a way to set a home position and then the occupy
This is very interesting and I've been wanting a bed sensor. The part i wished you covered was why this method over a load cell? For example how does this work eith say a heavy bed?
I've not tried the load cell method. It's a lot of effort and the pressure mat method works perfectly well for my use case
@@HomeAutomationGuy Hmm. I ended up watching Lewis's video on it and got some clarification where he was talking about the best slats distributing the load and such. I went ahead and ordered the pressure pad as I really want this solution to work for me. I did like how easy you made it. I didn't realize using the ESP32 GPIO was this easy.
Great video. I started with door sensor but the batter didn’t last long. Am no using your ESPHome method which is working great. Does any one knows a way to turn off the power LED?
The other two wires are used to form a tamper loop for a wired intruder mode.
I ordered 2 defender doormats to pair with the aqara sensors, but they only trigger when I'm standing on them.. A slight push or laying on my bed with the sensors underneath doesnt do anything. Any ideas?
Great writeup / video! Just having a play with one and find that it works when I get into bed but then thinks I get out when I lay down. I am guessing positioning is important - it looks like you have yours folded over -0 is that the key? Cheers!
I had to fold/move/adjust mine a few times to get it working accurately. I found placing it at "butt level" in a folded way worked best for me and my mattress
@@HomeAutomationGuy Thanks will try with me tonight before the wife!
If you run your HA on a pi, you could also hardwire it using the raspberry pi's GPIO pins and make a binary sensor. That way you could make one dirt cheap
Good suggestion! Thank you!
I've got a 4 switch box near my keyboard with an ESP8266 running ESPHome. One switch is set to toggle both of my Pi-Hole instances on or off (some website comments sections are blocked by Pi-Hole). The other switches control my WLED lights through Home Assistant.
Home made smart switch - I like it!
At the moment i use ESP for a M5 stack with voice assist a bluetooth proxy & everything presence one.
Use velostat (Linqstat) more cheaper, more accurate and more flexible and finally you have choice to measure how much pressure as well!! (with ESPhome project)
Hi, link for pressure mat please... Thanks!
It's in the article that's linked in the video description
I am wondering if it is somehow possible to tell which person is on which side based on weight difference? Are there alternatives to these pressure mats that can actually differentiate by weight rather than just on or off?
A force sensitive resistor might be able to, I'm not sure
3:00 the other two wires are there for the tamper alarm
Thanks for letting me know!
Didn't know this was even possible!
Hi Mate, great vid! I have a question though :) bed is not only for sleeping right? So how those sensors react when there are 2 person on one side of the bed in jumping motion? :>
And how sensitive is it, I have 2 cats and I'm curious if they would trigger it.
I have an automation that detects if two people are on one side of the bed in jumping motion, to automatically dim the lights and start playing Barry White on the Sonos.
In my experience you need to put at least 8-10kg of weight on it to trigger the sensor, so it depends how heavy the cat is.
@@HomeAutomationGuy Thanks Alan, Barry White is fine choice :D
@@HomeAutomationGuy Actually, how do you detect that two people are on one side of the bed, let alone in a jumping motion?I thought it's a "on" "off" trigger?
@@bevanting I don't, I was being facetious. 😅
hope the future sensor comes discounted with a factor for humper bed 😉
Question! Using the Aqara sensor, could you wire up two pads to the terminals and have the same effect? I know it would only see it as one sensor, but for the function I am thinking of that's all that would matter. I just want to know if one of either two beds, that are next to each other, is occupied.
Yep. That would work perfectly!
I’ll give it a go!
I'm confused, wont the weight of the bed itself will trigger the pressure mats?
can I control the sensitivity?
Mine isn't triggered by the mattress weight if I spread the mat out under the mattress. Mine only triggers when a lump like myself gets on top of the bed too. There's no way to control the sensitivity of it, but I was able to get it working consistently by fiddling around with the placement of the mat under the mattress over the course of a few nights
I really enjoy your content. Also it comes in the perfect moment for me, as I bought a bunch of ESP8266 D1 mini for a BME280 and stuff. How would you take care of the power for the ESP? Usually I'd love to rebuild the ESP version but having several cables under my bed sounds a bit unsafe to me.
I just plugged it into a USB power adapter. I've got loads of cables under my bed already for charging my phone, and other devices. So I personally wasn't worried about adding one more
When you place the mattress on the sensor, doesn't it just trigger anyway? Or is there a way of fine tuning how much pressure is required?
Mine isn't triggered by the mattress weight if I spread the mat out under the mattress. Mine only triggers when a lump like myself gets on top of the bed too. There's no way to control the sensitivity of it, but I was able to get it working consistently by fiddling around with the placement of the mat under the mattress over the course of a few nights
Does the sensor not trigger when a heavy mattress is placed upon it?
Nope
@@HomeAutomationGuy gr8, I’m going to give this a try. Thanks for the tutorial.
How sensitive are these? I have a dog and a cat. Dog weighs about 45lbs and they both sleep on my bed so I expect I would get a lot of false triggers
I have had plans to create such a sensor. for a long time. I just don't know how I'm going to integrate it into smartthings. There does seem to be a way to put an ESP 32 into the smart home platform, but I have. not had time to try it out. It seems kind of confusing. If you have any ideas, I'd be happy to hear.
The Aqara water leak sensor should be easy to link to SmartThings
Brilliant mate !!
Thank you!
I am having and issue with the yaml file being installed . Entered just like shown . Didnt know how to copy and paste but entered it manually. Any help would be greatly appreciated.
What's the issue?
@@HomeAutomationGuy Could not change the yaml file in the Esp Home web. Had to use file editor in HA to update the yaml file and then install.
anyone have a good cheapish source of these pressure mats for the US? best I have been able to find on amazon is like 60 bucks per mat
Really useful thanks
You are most welcome!
I use ESPHOME to get the water levels of my swimming pond and water tank using pressure sensors. Also outdoor and pond water temperatures. I get co2 values around the house to determine how hard my ventilation system should work. I have light sensors, buttons, humidity sensors, the built in Bluetooth captures the i go from my xiaomi scale... Esphome can do it all!
How do you power your esp32 bed sensor? Usb power plug or battery?
Those are cool ESPHome Projects!
I use a USB Power Plug to power it - have you had much luck getting the devices to work on batteries?
@@HomeAutomationGuy I have not tried using battery power 😉 all are USB powered.
My immediate thought when I saw this was about a system we tried to use for an elderly relative that lives on their own. To be clear, it is not Aqara based an had very few settings and none that we could tweak ourselves. It only allowed us to specify when the person should be in bed and when they should be getting out of bed. If they went to bed earlier that was fine and if they got up in the night and returned within an acceptable window of time then that was fine too. If they did not go to bed on time or they got up in the night and stayed out of bed then an alarm was triggered with a call centre. The problem was that it was not 100% reliable and would give false positives meaning the call centre would call the house in the night only to wake up the occupant. Getting to 100% reliability with elderly care is very nearly impossible but false positive (and indeed worse false negatives) are a nightmare and we gave up on that system.
I'm more tempted by the millimeter wave presence sensors that Aqara makes but even those cannot be 100% accurate so then it might need to be a combination of sensors, pressure, millimeter wave, and possibly something that could go under the bed legs to weigh the bed.
I think a combination of sensors would work ideally here. You could also use BLE presence to track what room someone is in if they have a fitbit or smart watch or similar
Ventil aktuator er nok det mest korrekte navn.
Jeg har haft en siddende i 6-7 år, fungere perfekt, og har massere af kræfter.
Det er så udgaven uden nogen kontroller (styres bare med 12v direkte, men har microswitches til endestop).
Det var den eneste jeg kunne få for under 80kr fra Kina, den gang det var beløbs grænsen 😆
Maybe add a moisture sensor too.
In case I wet the bed?
Why expensive pressure pad and not MM wave ESP32?
Firstly, I wanted to use it as an excuse to learn about ESPHome, and secondly I actually built it in the days before the MMWaves were as affordable as they are today. mmWave is a good option though if all you care about is occupied or not.
Is it better to use an Aqara contact sensor rather than a leak detector?
The outcome would be the same, but it means you need to crack open the contact sensor and do some soldering. The leak sensor terminals are really convenient
@@HomeAutomationGuy ah yeah, great point! I never thought of it that way 👍🏻
I used the Aqara contact sensors for this, didn't even occur to me to try the leak detectors, once all wired up the input is inverted, so "clear" means someone is in the bed, easy enough to use a template binary sensor to invert, but a little annoying, so would definitely recommend the leak sensor over contact sensor
@@taavi470 can you invert the contact sensor in the ui or is it just a template using Yaml? I think I’ll use a contact sensor because I want to get back into soldering again
@@michaelthompson657 I didn't find a way to do it in the UI, not sure did I miss something, I'm using a template binary sensor in yaml with a state like {{ is_state('binary_sensor.bed_occupancy', 'off') }}
Great video. Love the idea of repurposing Aqara leak sensors for this!
Does anyone know where to source the mat in Canada without overpaying? Not available on Amazon here and Google searches result in webstores with zero stock or eBay listings with 1000% markups lol. Direct purchase from the manufacturer (Switch Electronics, linked in article) is a great price, but the shipping costs are way too high for a single unit.
Oh bummer. Maybe check out some alarm stores or those targeted towards home care?
I got mine from Walmart. I'm in the US.
What if my purpose in bed is not sleeping?
Then adjust your automations accordingly
I'm using ESPHome to convert a dumb doorbell into a smart doorbell
That's really clever! Thanks for sharing!
Nice video
Can it detect an unknown person in a bed? 😀
Yep, I call it Goldilocks detection
But sometimes you go to bed but still need light to read for exemple ...
Yep - that's very true. Then you can use a combination of Conditions or Wait For Trigger in your automations to customise them to your own habits and environment. For example, you could not run the night time routine if the reading light is on - or better yet use the Wait For Trigger action in your automation actions to wait until the reading light gets turned off for 10 mins before it does the rest of the routine. There are a lot of flexible options for this type of automation - I just tried to show a generic starting point automation that people can use to build on top of.
@@HomeAutomationGuy ok, I get the point, thx !
I wish esp home and esp presence could be merged 😊
I use the FormatBLE HACS integration, and now I can track my BLE presence using the same ESPHome devices around my house. My bed sensor, and my Everything Presence One devices all track the BLE beacons. It works great!
github.com/formatBCE/Format-BLE-Tracker
@@HomeAutomationGuy never heard of this before. New video idea? 😉
A sonoff SN-ZB04 would probably also do the job for way cheaper
What's that?
@@HomeAutomationGuy My bad, mistyped the model number, it's a really cheap door/window sensor
I think its none of HomeAssistants business if you are love making so i would go with mmWave 😂
As a alarm engineer of 35 years , I would not trust the pressure mats to be reliable over a period of time., The industry does not allow them, All they are are 2 layers of foil seperated by a thin layer of foam with holes in, that allow the 2 foil layers to connect together. The life time will be severly reduced with them draped over the bed latts as the foil will be folded at that point. Great use case though, I use water leak sensors too, to get the lock / unlock status of our cars
What is a more reliable solution?
I'd try using strain gauges under each foot. Basically make the bed into a giant scale.
Car seat sensors, Thin Film Pressure Sensor, SF15-600, or a whetstone pressure bridge under the bed legs.
What’s an alarm engineer, and how could you be one for THIRTY FIVE years!!!?
@@invinciblemode I would imagine the correct title would be an electronic security engineer, and I started work as one with a national company when I was 16 years old so that's how.
Sweet 👏
Does someone found this ? I cant found it anywhere on internet. large pressure mat alarm switch pad 720x390
Yeah, I clicked on product link in article and product is listed as unavailable on Amazon UK
Please teach us how to make the in bed helper for 30 minutes. This is something what isn't well documented.
Is there anything I can add to the explainer at the end of the video to make it more clear?
Of course you make a bed sensor self-powered by er, "movements".
I read "bad" sensor 😂
Pressure mats are not good. They eventually compress and give false positives. Use an FSR instead.
first
would it work with a diy pressure pad :0 , these ones are really hard to find here soo i was wondering if i made a simple one like ua-cam.com/video/c6RXu0pYUVI/v-deo.html
That mat has questionable reviews
It's been fine for my use case, and I've been using it for three or four months
Any decent mattress makes this useless as the pressure is never enough to close the circuit. If the circuit closes, your mattress is shit mate and it will hurt your back sooner or later ;)
Depends on what's underneath. If a fully flat surface, then you're right, the pressure won't be high enough. But most bed bases have few cms wide slats, and those provide higher pressure there, so the mat is triggered without being uncomfortable.
May I suggest that you also include the buymeacoffee method of supporting you? I'd like to give you a little gesture of appreciation, but the superthanks stuff is too complicated.
Thanks for the suggestion, that's a great idea
Systematic experimentation is pretty scientific 🤔 Not very professional though [/youtube_wanker_mode] Very interesting video and one on the todo list!
🤣 fair play!