@@handcoding the flood sensor has two contacts on its bottom which are actually screws. These can be loosened and then put tge wires in and tighten them again. This is an alternative to the soldering done in marks video. Works great!
Incredible, I’ve been wanting to create some sort of weight based occupancy sensors for a few weeks now and you’ve made it so simple! The added bonus on using Aqara sensors is that it’s HomeKit compatible without any extra work.
11 days since my last comment and I possibly could edit the previous but I looked at the Aqara operating temperature specs and I am really impressed but I know that does mean the battery performance is included. What was interesting is I was looking at Yo-Link (Lora) mostly for the water/weather reasons not distance so much. I don’t plan on making a nice TH-cam channel like you and many others but I will probably post this Gate Sensor hack. The compactness of the sensor allows it to be slid into a very small piece of pvc tubing to protect it and connections from weather. I did put a Zigbee plug/repeater in the garage just to extend the range of my Zigbee mesh as the sensor is an endpoint device. I think it is fantastic there is a reed switch we can access. I think I will make a custom frame for a doormat and make a Zigbee doormat pressure sensor! Thanks again for this!
I just set this up using the strip sensor. Initial testing was not good as the strip was so sensitive, that masking tape holding the strip straight would trigger an event. After 10+ min of reading up on this issue, I then noticed that the strip was reporting open and I continued testing and it now would then trigger with >5lbs of pressure. Maybe there is an initial settle in period to calibrate, etc? Since I have a latex bed which is heavier than most mattresses, the mattress triggers an event. I will have to replace the Aqara door sensor with an adjustable solution if I continue using the pressure strip. With that said, I would definitely like to see ESP32 details to how you got your bed sensor to work Mark. Thanks! UPDATE: After ~2 weeks, the strip is now correctly detecting bed presence. The FSR strip is sent semi rolled up in an anti-static bag. Thus when you first install the strip under the mattress, its normal form is to coil up some. Thus, when first laying it out straight under a mattress, this natural force triggers the strip (showing a consistent closed status in HA). But after 2-3 days under a mattress, the strip will take to it being straight as a normal form and the strip will no longer consistently trigger a closed status, but correctly detects a presence or not. So far, the 600mm strip has an excellent detecting ability even when using a bit heavier latex mattress.
Update. Works perfectly with a esp 8266 board and the long fsr sensor. Heavy mattress doesn't register but easily detects a person. I'll try hooking up a second fsr on the other side to the same setup
I’ll do the same! Nice idea. In my house, I’ve already made a sensor like that, using part os zigbee one. I Use it on shower. For that, used a valve that already has a magnet inside. Just put the sensor next to the valve. And voila! You know when someone is having a shower. Usually it turns the volume of the music a little up.
For the aqara sensors, if I put these pressure sensors underneath a mattress, won't the weight of the mattress trigger the sensors and make them wrongly detected there are people on the bed?
I am going to put these under the carpet on the top and bottom of my stairs. Will be perfect for triggering lights along the side at night. already have some spare Aqara sensors.
Two additions to your guide 1. You don't need the input Boolean, just give your template sensor a delay_off value as well as changing the type to occupancy 2. No need for multiple aqara sensors for multiple pressure mats, these can be connected in parallel and applying pressure on any of the mats will trigger the aqara sensor
Thanks for sharing Philip. The idea for the two sensors was more just if you wanted to identify a set side. E.g. left side of the bed and right side of the bed.
@@MarkWattTech left and right is a perfect usecase to have individually. Although using the same aqara sensor for multiple sensors on the same side was my main advice as many seem to miss that this is simple and possible. I love your ideas on how to use these sensors for stairs, mats etc. So far I've only used them for the bed. Ideally I'd use the load cell approach but unfortunately it cannot be mounted as far as I've been able to figure on our bed which has round vase formed legs.
Awesome video. I've tried the thin film one and I find it's way too sensitive it responds at the touch of my finger. So the pressure of my mattress sets it off as well.
Thanks Mark for showing the door contact hack! I am glad I watched even though I didn’t have a use case for a bed sensor but I work with disabled and or handicapped people to make life easier. This however inspired me to use the hack to make my own outdoor Zigbee gate sensor. I am not sure it is the most elegant thing I have or will do but my cost is about $25. Just a little concerned about battery life due to the weather here. Thanks for the videos, will send real thanks too!$$
So I’m assuming with the fsr you could put 2 strips on the bed and wire them in parallel? It’s just a switch so I’m thinking of putting 2 on my side of the bed incase I move in bed , then just wire them together/the same so it would work if I was on one or both?
Ive managed to do this using the pressure mat sensore and it seems to work, staying on when i am in bed. The only issue i have is the state changes to unavalible for a split second several multiple times when the sensor is constantly triggerd through the nighy. Any suggestions on how to over cme this?
Built one with a regular cheap Zigbee leak sensor and the thin Film Pressure Sensor. The mattress is just too heavy for it, reads positive under it regardless. Not sure if I can add a resistor and what value might help. Currently its just under the top sheets. You mention changing the bed sensor names which I added to my config. Not sure how to display this. I added a mushroom button with the input boolean on the Dash which only shows me on or off.
Do you have any idea what the voltage rating is of the Car Seat Sensor is? I bought 3 of them to do a similar project but I can't find any docs on them anywhere.
My plan for a bed sensor is load cells under the corners, and Tasmota on an ESP32 having HX711 and a couple of other sensors. Such a setup gives good sensitivity and chances of detecting who's in the bed, assuming they have different weights.
While it takes some wiring, at least that can be done "invisibly" on the underside of the bed, and without interference from making the bed and so on. Whether it is a plus or minus to be able to easily collect weight stats may be a personal question 😉
The leak sensor works great but I took a "no solder" path. I used wire crimps to connect the wires to the pressure strip. It's a tight fit because the contacts are so close together but it's do-able. Then just connect the wires to the two screws on the leak sensor. Total cost about $25 USD.
I did actually do a follow up video to this where I used the leak detectors :) You can add them to the film resistors and get the same effect. Simply add the wire to each terminal. Cheers. Mark
I was thinking a generic leak sensor which comes with long cable ahould do the same job. What do you think? I ordered a few of the ones that can be stuck on the wall, supporting 2xAAA batteries and have a wire drop cable to place where you expect to have the water pool up. Even used one of them to indicate if my aquarium is overflowing, potential aquarium drain block indicator. Thinking i will try with FSR
These Contact Sensors are pretty versatile - I´m using them to smartify my current light switches :) Works great - what I don´t like is that the aqara sensors are bound to one zigbee router - if this device is not available it has to be reconnected. Don´t know if this also applies to the zigbee 3.0 versions.
I would recommend creating a more advanced bed state than just the boolean. I created a state machine in node-red (but this could be created by a few automations within home assistant) with the following states: awake, just laid down, sleeping, just got up, and back to bed (when getting up during the night) with different timers
I’m actually designing transparent/translucent epoxy pavers or “stepping stones” I’m going to house led lights in them and have them operate using pressure sensors. I feel like option 3 would be best. But I have a couple questions. How long are you thinking the battery lasts in those aquara’s and when you say possibly a 1-2 second delay for automation, I feel like that’s going to hurt my project. So provided I manage to create a working design, I should probably just do esphome and run wire to the main. What would the delay be then you think?
yeh, used the first and the second sensor. both are giving out the issues mentioned at 5:19. using the car seat sensor on my computer chair, and the long sensor on my sofa. I may try use the long sensor on my bed. but I already have buttons near my bed for turning off lights.
Great video, thanks. Does anyone know how to make the sensor less sensitive? I have been using the aqara trick for different custom sensors, such as an intercom ringing sensor and a rain sensor, and now I've been playing with pressure mats. The issue I'm having is that the sensor, when used as a sofa occupancy sensor, triggers with the weight of the sofa seats alone, so I wish I could make it less sensitive. Would a resistor do the trick?
Adding something around the sensor (I used some folded paper when using the car seat sensor) just keeps that area up enough to reduce the load on the sensor itself. Then sit and the paper compacts and pressure gets to the sensor 👍
HI, very interesting topic. I have just one doubt: the car seat sensor and the thin film pressure sensor have a resistive output i think, how can you close the circuit of the reed relay ? Thank you Claudio
Hi Mark! I’m interested in taking on this project to create a sensor for a cat litter tray. Can you elaborate on how the car seat pressure sensor detects a change in pressure applied? E.g you show it here with the mattress over the top. Does the weight of the mattress not trigger the state change? I want to place one of these under a cat litter tray which weighs about a kilo in itself. Then I want to detect when a cat is in the box, which is an additional 3kgs. Would placing the litterbox down not trigger the sensor and keep it permanently in an “on” state? (The reason I want to do this if you are curious is so I can send my Roomba to clean the floor in front of the tray after every use!)
Hey Fran. With the FSRs the mattress doesn't push down onto it enough for the sensor state to trigger (this may differ with other mattresses) The bed slats disperse the mattress weight but when someone sits or lays in bed the downward force triggers a state change. You may want to experiment with the mats and other force variable sensors :) The ESP version of the setup is the most accurate and can be finely tweaked and tuned.
I recently build myself a bed sensor with an ultra sonic distance sensor. I already use one for a water tank, but it also works extremely well as a bed occupancy sensor. Mine sits under the bed, facing the slates. So if you lay down, your body weight presses down the slates and this change can be picked up by the distance sensor.
I wonder if the fsr strip will work for thick mattress ? I’m going to mount them on the bed slats and the mattress over it but have doubts If it’s going to react?
Thanks for a great video! Very inspiring. I am fairly new to HA, so still haven't tried to build my own template sensor - and I haven't really had any luck of finding a tutorial explaining this. You mention building a template sensor for changing the "on/off" to "In bed/Out of bed" - and I managed to recreate your sensor (shown at 8:43) and validate it using Developer Tools... But now I have a few questions to help me finish this sensor, which I hope you can help answering: 1) Are you adding the code to configuration.yaml or to sensors.yaml? 2) The code you show starts with an indented "- name: Bed occupancy" - but I expect something came before the indentation? I tried adding the code below to configuration.yaml but it doesn't work (this is my first try at a template sensor): template: - sensor: - name: Bed occupancy state: > {% if is_state('input_boolean.bed_helper', 'on') %} In bed {% else %} Out of Bed {% endif %} icon: >- {% if is_state('input_boolean.bed_helper', 'off') %} mdi:bed-empty {% elif is_state('input_boolean.bed_helper', 'on') %} mdi:bed {% endif %}
Just watching this back again. It looks like you placed the sensors/resistors under the mattress, am I correct here? Also if you used these under the mattress would it not think the bed is occupied just by the weight of the mattress? I’m on about the first 3 ones btw, the easier ones
So with the mattress because the weight is so evenly distributed it doesn’t trigger enough downward pressure to activate the sensor. This may be different with your bed setup etc so some experimentation may be needed.
How good was this. Thanks heaps. The idea to pull the sensor apart is awesome, it opens up so many possibilities. For me I might try a simple pool water sensor as was planning on an ESP though power was a nuisance.
Great video - thanks Mark. I guess with the last one, you could also use it to tell you when a dog food bin is getting close to empty - and add dog food to your shopping list... so long as you remember to put it back onto the pressure mat.
Great video but you do not have to remove the read switch. Just solder as told. You can than reverse engineer back to the original aqara sensor if you just want to use it for testing.
I'm pretty sure most Xiaomi/Aqara devices also have two small holes that you can solder pins to for external triggers, on this one it's next to the reed switch at the opposite end to the pair button. you have to be pretty good at soldering though as it's easy to destroy the PCB. My device is now in the bin as a result, but I'm sure someone with better skills than me could use these.
One more thing, you could use the shorter fsr strip, place it beneath toilet seat lid and make a ‘smart toilet seat’. That got rid of the age old lights turning off when you’re in the can longer than usual.
So I made these, but the bed sensor has a problem and I’m hoping for some advice. I can’t get it to be accurate - however I position it, it’s either not detecting me, or it detects the bed, or it detects hundreds of events while I’m laying on it, draining the battery. Placing cardboard underneath it doesn’t seem to help, either.
Great Video Mark. I am a fan of either modding or making my own sensors. Also some great automation ideas. You might want to consider using the Shelly uni, a small, low cost (about £15), 12v powered wifi device which can measure 0-30vDC, can support up to 3 temperature sensors, 2 digitial inputs and 2 (100mA) output switches. I've not seen many HomeAssistant users talk about them which is quite surprising given their compatability with home automation platforms (out of the box support for REST, MQTT, Alexa, Google Home, and Samsung Smart things) and of course HomeAssistant through the Shelly Integration.
@@MarkWattTech I have the Withings sleep mats. They are terrible for me for 3 reasons: 1) I have a partner, and if she gets anywhere near my half of the bed when I'm not in it, it goes off. 2) I have cats that nap on the bed. Although the mat calibrates when plugged in, there's no way to give it a minimum trigger weight and it always picks up the cats. 3) The Home Assistant integration is very sketchy. I have to reauthenticate daily and on every restart for the sensors to communicate over the API. I'm seriously considering switching (or adding) the resistive voltage option here to set weight thresholds. Thanks!
I had the esp32 with some homemade pressure sensors out of foil and paper. It worked perfectly, the problem was that I had to have a ton of cables under my mattress and had to be close to the power plug. Also, the pressure sensors worn out pretty fast due to movement. So I'm certainly gonna try your versions
It will depend on your setup. Most mattresses (especially on slats) have the weight distributed evenly. So the sensor isn’t effected by the mattress. But your direct weight and pressure will trigger it.
I have some massive Zigbee door sensor, {its trash for windows, as the magnet block is HUGE but only half filled with a magnet} It would be great for this purpose
So I tried the thin film pressure sensor version, but I got issues with the Aqara sensor. It gets stuck on "Closed" sometimes, and doesn't return to Open by itself unless I "manipulate" it. Also my heavy bed mattress just sets it on Closed right away, no need for me to be on it too :/
Great video, I've been confused about this for ages! I already have an esp32 that I already use gpio pins 2, 4 & 5 to control 3 relays that control my tv lifting mechanism. It'll also use the 5v and gnd pins to the relay board Is there any way I could add 2 of the film sensors to the same esp32? So that I have everything in the 1 place? Thank you
You can indeed do this, you just use two of the ADC pins one wired to each FSR and then the ground wired together or to separate ground pins on the esp32 it doesn’t matter. You just need to add to the additional code in on top of what your already have and specify both ADC pins to have the second. Don’t have a pinout to hand but normally about 14 ADC pins on an esp32 or thereabouts so you should be fine
I think the Aqara Leak Sensor is a better choice because all these pressure sensors work on the principle of closing a circuit and that is what the leak sensor also uses. If you have a sensor that is too small you can just add multiple pressure sensors but connect them in parallel. If your cat triggers a snigle sensor (my use case) put multiple sensors but wire them in series. As long as the person you want to detect is large enough to cover all the sensors it should work (theoretical I haven't actually tried this)
@@MarkWattTech It isn't instant but it is no more than 10 seconds. I have mine turn on the bathroom lights when I get out of bed in the middle of the night (I am an old man :-) ) and the lights are on by the time I get to bathroom. I am sure if I ran I would get there first but 10 seconds is tolerable. I use node-red for all the control so I can delay longer if I need to. If I get out of bed (after 5 AM) I then use TTS to read my meetings for the day and give me a weather report from my weather station. The biggest issue is I have to disable it during the day because the cats will activate. I am going to try using the car pressure sensors wired in series. If I can place them far enough apart that a cat won't hit them all but close enough together that I will it should work. I will update (coming from China so will be at least a month)
@@MarkWattTech I just got the "car sensors" in yesterday. I just bobbled one together with an existing aqara water leak sensor and put the pressure sensor on my office chair. Made a simple node-red flow which turns on the mac screen saver. and turns off the office lights when I stand up. Working right now but no permanent wiring. A few seconds delay when I stand up which is actually good so lights don't turn off while I am leaving office..
I have an aqara vibration sensor attached to my bed. It is enough to detect when I get into bed or turn me around. Under my bed is a motion sensor. It can see me when I move out of my bed but not when I'm in it.
Although not relevant to the subject of the video, was interested to see the Aurora socket as have never seen this before, we use a lot of clicksmart+ double sockets and love them and note they are about half the price of the Aurora ones. But interested to see the Aurora ones have power monitoring and come with a handy 10mm faceplate spacer as fitting them in most standard 25mm boxes is an arse to say the least. Keep up the good work fella 👍🏻
Thank you. I show it a little more in my Energy Challenge video and will be featuring it in my Smart Home Wall Panel video as it’s used to automate charging :)
I have a tuya based contact sensor. I have the local key, id and the ip address for it, I am not able to add it to local tuya in homeassistant. Please guide how can I add it via .yaml configuration to local tuya. Kindly guide.
I have the same pad, the weight for activation is 25kg. I have a super king mattress which is pretty much the biggest and it doesn’t activate it. A child probably would activate it though.
Yeah like Chris said. In my tests the car seat sensor and mat wouldn’t detect a child or the dog. But the Thin film sensor detected both in the Aqara and ESP setups :)
Does anyone have the issue of excessive battery drain when using the pressure pad? I set up one of these for under my bed but the battery seems to only last about 2 weeks.
@@thebatu89 I’m away at the moment but will do a diagram when I get back next week for you. Pretty sure I made a diagram already so if I can grab it from my vpn I’ll link it before then
@@iainhay2823 btw, what’s the resistance value of occupied vs unoccupied for your bed? I’m getting 10-16kOhm for occupied but I’m only getting 1 even after i cranked up to 2M on the multimeter
@@MarkWattTech got it working with this Sensor. Used a few Jumper cable for First Test. Don't wanted to solder on the frs Side waiting for a clincher so i can Just Stick it together with the soldered cables from Sensors end.
I've had several ordered for months. Each time they get cancelled by the seller. The latest one has just been cancelled today but I've been assured a new order will be sent out. As soon as I have one I will be sure to test and share :D
Another option is to buy load cells and place one under each leg of the bed. The most common ones are 50kg each for a combined max load of 200kg. This also gives you the granularity of sensing who is in the bed based on weight.
Enjoyed the video but wanted to offer a word of caution about using the larger mats you mentioned. These can inhibit air circulation under the mattress which is part of the reason the base of the bed is slatted.
I have seen the connection diagram in the GitHub file but it does not work for me, I am using a wemos d1 mini. Can you tell me where you connect the white cables that you show in the video? If you can also tell me the other cables connection to be sure but it seems that it can be seen well in the video. Or If you know a web with the correct diagram it will be very helpful for me. I already have it under the bed and I want to make the template to known the people inside according to the weight, thank you very much for the video
I use two fsr strip one on each side which works great. One strip across the middle would let you tell the difference you would have to pick resistance with both in bed first. One person would give a lower signal so you could use that. Two strip is easier though imho. I do detect when the cats are sleeping on the bed, it is that sensitive you can actually do this
Belay that question. I hooked 2 fsr up. One on either side of the bed and linked them together in the single esp8266 setup. Works great at detecting one or both in bed
The main reason would be to trigger automations based on the occupancy. For example I have an automation that detects when I get into bed. If I’ve left downstairs windows open my speaker will tell me.
Just built this with an FSR and a Sonoff door sensor but the thing is incredibly sensitive, anyway to reduce the sensitivity? If I place a finger on it, it closes.
Either the esp variant (so you can adjust sensitivity) or try a different contact sensor. Alternatively instead of the contact sensor you could try using a leak sensor with the FSR. In my testing though leak sensors are way more sensitive- which is the opposite to what you want.
You can do this even simpler with an aqara leak sensor. It has screw where you can attach the wired of the matts and such 😁
Even easier then 😁
Was coming here to say the same thing......
I don’t doubt what you’re saying, but could you perhaps elaborate on how one needs to set this up? (I’m just not quite sure that I’m following.)
@@handcoding the flood sensor has two contacts on its bottom which are actually screws. These can be loosened and then put tge wires in and tighten them again. This is an alternative to the soldering done in marks video. Works great!
@@The64BitKid Ohhh-I gotcha. Nice!
Using your guide, I soldered something for the first time in my life and it works! Thanks a lot for this guide.
Happy to have helped :)
Your guides are by far the best for Home Assistant, because of how mindful you are of the people who are as inexperienced as you are.
Thank you for the feedback. Glad you find them helpful :)
Thanks to this video I made my dumb doorbell smart using the same technique and a sonoff contact sensor, thank you! 🎉🥳
Incredible, I’ve been wanting to create some sort of weight based occupancy sensors for a few weeks now and you’ve made it so simple!
The added bonus on using Aqara sensors is that it’s HomeKit compatible without any extra work.
Legend, I completed sensor 3 tonight and it works perfectly! Thanks Mark, I think of all the YT how to's I've used yours most frequently. Great work!
11 days since my last comment and I possibly could edit the previous but I looked at the Aqara operating temperature specs and I am really impressed but I know that does mean the battery performance is included.
What was interesting is I was looking at Yo-Link (Lora) mostly for the water/weather reasons not distance so much.
I don’t plan on making a nice TH-cam channel like you and many others but I will probably post this Gate Sensor hack.
The compactness of the sensor allows it to be slid into a very small piece of pvc tubing to protect it and connections from weather.
I did put a Zigbee plug/repeater in the garage just to extend the range of my Zigbee mesh as the sensor is an endpoint device.
I think it is fantastic there is a reed switch we can access.
I think I will make a custom frame for a doormat and make a Zigbee doormat pressure sensor!
Thanks again for this!
Mark, this is a fantastic idea! I tried out the contact sensor + thin force resistive sensor and it worked a treat. Thank you!
Thanks for putting these videos out Mark, they are very helpful.
Glad to have helped 😄
I just set this up using the strip sensor. Initial testing was not good as the strip was so sensitive, that masking tape holding the strip straight would trigger an event. After 10+ min of reading up on this issue, I then noticed that the strip was reporting open and I continued testing and it now would then trigger with >5lbs of pressure. Maybe there is an initial settle in period to calibrate, etc? Since I have a latex bed which is heavier than most mattresses, the mattress triggers an event. I will have to replace the Aqara door sensor with an adjustable solution if I continue using the pressure strip.
With that said, I would definitely like to see ESP32 details to how you got your bed sensor to work Mark. Thanks!
UPDATE: After ~2 weeks, the strip is now correctly detecting bed presence. The FSR strip is sent semi rolled up in an anti-static bag. Thus when you first install the strip under the mattress, its normal form is to coil up some. Thus, when first laying it out straight under a mattress, this natural force triggers the strip (showing a consistent closed status in HA). But after 2-3 days under a mattress, the strip will take to it being straight as a normal form and the strip will no longer consistently trigger a closed status, but correctly detects a presence or not. So far, the 600mm strip has an excellent detecting ability even when using a bit heavier latex mattress.
Thanks so much! Really love to see a more detailed on the esp with fs. Content is brilliant. Love the build your own devices thing you are doing
Update. Works perfectly with a esp 8266 board and the long fsr sensor. Heavy mattress doesn't register but easily detects a person. I'll try hooking up a second fsr on the other side to the same setup
Yup. Second fsr on the other side. Easily detects how many people in bed
I’ll do the same! Nice idea. In my house, I’ve already made a sensor like that, using part os zigbee one. I Use it on shower. For that, used a valve that already has a magnet inside. Just put the sensor next to the valve. And voila! You know when someone is having a shower. Usually it turns the volume of the music a little up.
Another option is use a liquid flood sensor. You just have to cut the wires e join with the wires of the weight sensor.
Could you please make a more detailed video on the ESP version of the bed sensor! Thank you very much!!!
For the aqara sensors, if I put these pressure sensors underneath a mattress, won't the weight of the mattress trigger the sensors and make them wrongly detected there are people on the bed?
I agree, seems that this would be a big issue as there is no tuning for the bed weight.
I am going to put these under the carpet on the top and bottom of my stairs. Will be perfect for triggering lights along the side at night. already have some spare Aqara sensors.
These are all referenced in the .tft file. I will be showing this when I eventually get that other video done.
I love that you've repurposed the Aqara sensors for these.
There's a lot of potential for other sensors too 👍🏻
This is perfect for your favorite reading chair. If pressure is detected, fire up that reading light. Turn it off again when pressure stops.
Thanks for this great video and idea's ... i managed to do Sensor 2 (Aqara Contact Sensor +Pressure Mat Sensor) working perfect!!!
Thanks Mark, for this video and the great idea. Does the weight of the mattress trigger the sensor before you get in bed?
Two additions to your guide
1. You don't need the input Boolean, just give your template sensor a delay_off value as well as changing the type to occupancy
2. No need for multiple aqara sensors for multiple pressure mats, these can be connected in parallel and applying pressure on any of the mats will trigger the aqara sensor
Or if your cat triggers the single mat wire them in series.
Thanks for sharing Philip. The idea for the two sensors was more just if you wanted to identify a set side. E.g. left side of the bed and right side of the bed.
@@MarkWattTech left and right is a perfect usecase to have individually. Although using the same aqara sensor for multiple sensors on the same side was my main advice as many seem to miss that this is simple and possible. I love your ideas on how to use these sensors for stairs, mats etc. So far I've only used them for the bed. Ideally I'd use the load cell approach but unfortunately it cannot be mounted as far as I've been able to figure on our bed which has round vase formed legs.
Oh damn! Fridge magnets!!!
Awesome video. I've tried the thin film one and I find it's way too sensitive it responds at the touch of my finger. So the pressure of my mattress sets it off as well.
Was it the same FSR that I used? Deffo checkout the ESP variant if you want to be able to tune the sensitivity of the sensor :)
Thanks Mark for showing the door contact hack! I am glad I watched even though I didn’t have a use case for a bed sensor but I work with disabled and or handicapped people to make life easier.
This however inspired me to use the hack to make my own outdoor Zigbee gate sensor.
I am not sure it is the most elegant thing I have or will do but my cost is about $25.
Just a little concerned about battery life due to the weather here.
Thanks for the videos, will send real thanks too!$$
Thanks for the feedback and thank you for sharing. Feel free to post your sensor on one of my social channels. Would be great to see!
So I’m assuming with the fsr you could put 2 strips on the bed and wire them in parallel? It’s just a switch so I’m thinking of putting 2 on my side of the bed incase I move in bed , then just wire them together/the same so it would work if I was on one or both?
Ive managed to do this using the pressure mat sensore and it seems to work, staying on when i am in bed. The only issue i have is the state changes to unavalible for a split second several multiple times when the sensor is constantly triggerd through the nighy. Any suggestions on how to over cme this?
Built one with a regular cheap Zigbee leak sensor and the thin Film Pressure Sensor. The mattress is just too heavy for it, reads positive under it regardless. Not sure if I can add a resistor and what value might help. Currently its just under the top sheets.
You mention changing the bed sensor names which I added to my config. Not sure how to display this. I added a mushroom button with the input boolean on the Dash which only shows me on or off.
Do you have any idea what the voltage rating is of the Car Seat Sensor is? I bought 3 of them to do a similar project but I can't find any docs on them anywhere.
Followed this and now Home Assistant records several hours of OFF-ON-OFF-ON-OFF-ON-OFF-ON-OFF-ON... sequences nearly every night. 😉
My plan for a bed sensor is load cells under the corners, and Tasmota on an ESP32 having HX711 and a couple of other sensors. Such a setup gives good sensitivity and chances of detecting who's in the bed, assuming they have different weights.
A lot more accuracy for a little extra work 👌🏻
While it takes some wiring, at least that can be done "invisibly" on the underside of the bed, and without interference from making the bed and so on. Whether it is a plus or minus to be able to easily collect weight stats may be a personal question 😉
@@JohnnieHougaardNielsen 😂😂👌🏻
This is brilliant. Thank you!
The leak sensor works great but I took a "no solder" path. I used wire crimps to connect the wires to the pressure strip. It's a tight fit because the contacts are so close together but it's do-able. Then just connect the wires to the two screws on the leak sensor. Total cost about $25 USD.
I did actually do a follow up video to this where I used the leak detectors :)
You can add them to the film resistors and get the same effect. Simply add the wire to each terminal.
Cheers.
Mark
I was thinking a generic leak sensor which comes with long cable ahould do the same job. What do you think? I ordered a few of the ones that can be stuck on the wall, supporting 2xAAA batteries and have a wire drop cable to place where you expect to have the water pool up. Even used one of them to indicate if my aquarium is overflowing, potential aquarium drain block indicator. Thinking i will try with FSR
These Contact Sensors are pretty versatile - I´m using them to smartify my current light switches :)
Works great - what I don´t like is that the aqara sensors are bound to one zigbee router - if this device is not available it has to be reconnected. Don´t know if this also applies to the zigbee 3.0 versions.
I would recommend creating a more advanced bed state than just the boolean.
I created a state machine in node-red (but this could be created by a few automations within home assistant) with the following states: awake, just laid down, sleeping, just got up, and back to bed (when getting up during the night) with different timers
Deffo the way to go :)
I'm looking to build also something like that, can you tell me how to do that? Or is there a video for that?
I’m actually designing transparent/translucent epoxy pavers or “stepping stones” I’m going to house led lights in them and have them operate using pressure sensors. I feel like option 3 would be best. But I have a couple questions. How long are you thinking the battery lasts in those aquara’s and when you say possibly a 1-2 second delay for automation, I feel like that’s going to hurt my project. So provided I manage to create a working design, I should probably just do esphome and run wire to the main. What would the delay be then you think?
Did you do this? sounds like a cool project
thanks, gonna use this to auto pause the tv when I get off the sofa! :D
yeh, used the first and the second sensor. both are giving out the issues mentioned at 5:19. using the car seat sensor on my computer chair, and the long sensor on my sofa. I may try use the long sensor on my bed. but I already have buttons near my bed for turning off lights.
Update, keeping the second bigger sensor folded seems to work well for seat sensing
Great video, thanks. Does anyone know how to make the sensor less sensitive? I have been using the aqara trick for different custom sensors, such as an intercom ringing sensor and a rain sensor, and now I've been playing with pressure mats. The issue I'm having is that the sensor, when used as a sofa occupancy sensor, triggers with the weight of the sofa seats alone, so I wish I could make it less sensitive. Would a resistor do the trick?
I' d like to know that too. Don't think it's possible that easily though
Adding something around the sensor (I used some folded paper when using the car seat sensor) just keeps that area up enough to reduce the load on the sensor itself. Then sit and the paper compacts and pressure gets to the sensor 👍
HI,
very interesting topic. I have just one doubt: the car seat sensor and the thin film pressure sensor have a resistive output i think, how can you close the circuit of the reed relay ?
Thank you
Claudio
Great video! You covered a lot of good possibilities for the use of a pressure sensor 👍 Keeps me thinking about other ones 😀
Hi Mark! I’m interested in taking on this project to create a sensor for a cat litter tray. Can you elaborate on how the car seat pressure sensor detects a change in pressure applied? E.g you show it here with the mattress over the top. Does the weight of the mattress not trigger the state change?
I want to place one of these under a cat litter tray which weighs about a kilo in itself. Then I want to detect when a cat is in the box, which is an additional 3kgs. Would placing the litterbox down not trigger the sensor and keep it permanently in an “on” state?
(The reason I want to do this if you are curious is so I can send my Roomba to clean the floor in front of the tray after every use!)
Hey Fran. With the FSRs the mattress doesn't push down onto it enough for the sensor state to trigger (this may differ with other mattresses) The bed slats disperse the mattress weight but when someone sits or lays in bed the downward force triggers a state change. You may want to experiment with the mats and other force variable sensors :)
The ESP version of the setup is the most accurate and can be finely tweaked and tuned.
I recently build myself a bed sensor with an ultra sonic distance sensor. I already use one for a water tank, but it also works extremely well as a bed occupancy sensor. Mine sits under the bed, facing the slates. So if you lay down, your body weight presses down the slates and this change can be picked up by the distance sensor.
Thanks for sharing. That’s a very interesting concept. Maybe one for the future haha
I wonder if the fsr strip will work for thick mattress ? I’m going to mount them on the bed slats and the mattress over it but have doubts If it’s going to react?
Amazing idea. My thought is, I have extra Sonoff W/D sensors. Could I use them instead?
Yes you can!
But in my experience the Sonoff ones aren't as good and they eat through batteries.
@@MarkWattTech thanks.
Thanks for a great video! Very inspiring.
I am fairly new to HA, so still haven't tried to build my own template sensor - and I haven't really had any luck of finding a tutorial explaining this.
You mention building a template sensor for changing the "on/off" to "In bed/Out of bed" - and I managed to recreate your sensor (shown at 8:43) and validate it using Developer Tools... But now I have a few questions to help me finish this sensor, which I hope you can help answering:
1) Are you adding the code to configuration.yaml or to sensors.yaml?
2) The code you show starts with an indented "- name: Bed occupancy" - but I expect something came before the indentation?
I tried adding the code below to configuration.yaml but it doesn't work (this is my first try at a template sensor):
template:
- sensor:
- name: Bed occupancy
state: >
{% if is_state('input_boolean.bed_helper', 'on') %}
In bed
{% else %}
Out of Bed
{% endif %}
icon: >-
{% if is_state('input_boolean.bed_helper', 'off') %}
mdi:bed-empty
{% elif is_state('input_boolean.bed_helper', 'on') %}
mdi:bed
{% endif %}
Just watching this back again. It looks like you placed the sensors/resistors under the mattress, am I correct here? Also if you used these under the mattress would it not think the bed is occupied just by the weight of the mattress? I’m on about the first 3 ones btw, the easier ones
So with the mattress because the weight is so evenly distributed it doesn’t trigger enough downward pressure to activate the sensor.
This may be different with your bed setup etc so some experimentation may be needed.
@@MarkWattTechthanks so much for this! I think I’ll give it a try at some point!
How good was this. Thanks heaps.
The idea to pull the sensor apart is awesome, it opens up so many possibilities. For me I might try a simple pool water sensor as was planning on an ESP though power was a nuisance.
The portability factor is amazing 😁
Is it possible to connect 2 thin film pressure sensors to eachother to make an extra long one
You can yes :) you can connect them up in series or parallel using wires.
Great video - thanks Mark.
I guess with the last one, you could also use it to tell you when a dog food bin is getting close to empty - and add dog food to your shopping list... so long as you remember to put it back onto the pressure mat.
Haha I guess you could. I think using the ESP variant would be best as it would be more accurate.
Great video but you do not have to remove the read switch. Just solder as told. You can than reverse engineer back to the original aqara sensor if you just want to use it for testing.
Thank you :)
In my experience I found it hard not to damage the reed switch 😂. Helping hands deffo needed on this one
I'm pretty sure most Xiaomi/Aqara devices also have two small holes that you can solder pins to for external triggers, on this one it's next to the reed switch at the opposite end to the pair button. you have to be pretty good at soldering though as it's easy to destroy the PCB. My device is now in the bin as a result, but I'm sure someone with better skills than me could use these.
Great video as usual. Would be glad if you could do a more in depth video on the esp version with the FSR sensors.
One more thing, you could use the shorter fsr strip, place it beneath toilet seat lid and make a ‘smart toilet seat’.
That got rid of the age old lights turning off when you’re in the can longer than usual.
So I made these, but the bed sensor has a problem and I’m hoping for some advice. I can’t get it to be accurate - however I position it, it’s either not detecting me, or it detects the bed, or it detects hundreds of events while I’m laying on it, draining the battery. Placing cardboard underneath it doesn’t seem to help, either.
Great Video Mark. I am a fan of either modding or making my own sensors. Also some great automation ideas. You might want to consider using the Shelly uni, a small, low cost (about £15), 12v powered wifi device which can measure 0-30vDC, can support up to 3 temperature sensors, 2 digitial inputs and 2 (100mA) output switches. I've not seen many HomeAssistant users talk about them which is quite surprising given their compatability with home automation platforms (out of the box support for REST, MQTT, Alexa, Google Home, and Samsung Smart things) and of course HomeAssistant through the Shelly Integration.
Thanks Dave 😄
You do know you can do the same with Aqara Water Leak sensor without opening it as it has two screw terminals?
The circular shaped one?
@@DarixCn yup the round one. Works great
@@The64BitKid Do you also have a delay of about 8 seconds to detect somebody is out of bed ?
Great Video Mark!
I have gone the easy route and tried to automate my existing Withings bed sleep sensors!
I am still struggling to do that however
Thank you 🙏🏻.
How do you find the Withings stuff in general? :)
@@MarkWattTech I have the Withings sleep mats. They are terrible for me for 3 reasons: 1) I have a partner, and if she gets anywhere near my half of the bed when I'm not in it, it goes off. 2) I have cats that nap on the bed. Although the mat calibrates when plugged in, there's no way to give it a minimum trigger weight and it always picks up the cats. 3) The Home Assistant integration is very sketchy. I have to reauthenticate daily and on every restart for the sensors to communicate over the API. I'm seriously considering switching (or adding) the resistive voltage option here to set weight thresholds. Thanks!
On point my bro.. wicked video 👊🏾👊🏾
Thank you mate 😁
Hi Mark, Am very new to Home Assistant. What L.E.D strip are you using on your stairs please ?
I had the esp32 with some homemade pressure sensors out of foil and paper. It worked perfectly, the problem was that I had to have a ton of cables under my mattress and had to be close to the power plug. Also, the pressure sensors worn out pretty fast due to movement. So I'm certainly gonna try your versions
But wont weight of the materace turn the sensor on? Wont it be always pressed under the matress?
It will depend on your setup. Most mattresses (especially on slats) have the weight distributed evenly. So the sensor isn’t effected by the mattress. But your direct weight and pressure will trigger it.
I have some massive Zigbee door sensor, {its trash for windows, as the magnet block is HUGE but only half filled with a magnet}
It would be great for this purpose
You should do another video about sensor #4, but with 2 fsr, one for each side of the bed 😅
I got it working for one side. About the play with a second for the other side. I'll update when I get a result
Yup. One either side of the bed into the same connection works fine
So I tried the thin film pressure sensor version, but I got issues with the Aqara sensor. It gets stuck on "Closed" sometimes, and doesn't return to Open by itself unless I "manipulate" it. Also my heavy bed mattress just sets it on Closed right away, no need for me to be on it too :/
Is the Aqara hub needed for this to work?
Just Zigbee :) you can use any coordinator you like.
Great video, I've been confused about this for ages!
I already have an esp32 that I already use gpio pins 2, 4 & 5 to control 3 relays that control my tv lifting mechanism. It'll also use the 5v and gnd pins to the relay board
Is there any way I could add 2 of the film sensors to the same esp32? So that I have everything in the 1 place?
Thank you
You can indeed do this, you just use two of the ADC pins one wired to each FSR and then the ground wired together or to separate ground pins on the esp32 it doesn’t matter. You just need to add to the additional code in on top of what your already have and specify both ADC pins to have the second. Don’t have a pinout to hand but normally about 14 ADC pins on an esp32 or thereabouts so you should be fine
@@iainhay2823 thank you 🤘
I think the Aqara Leak Sensor is a better choice because all these pressure sensors work on the principle of closing a circuit and that is what the leak sensor also uses. If you have a sensor that is too small you can just add multiple pressure sensors but connect them in parallel. If your cat triggers a snigle sensor (my use case) put multiple sensors but wire them in series. As long as the person you want to detect is large enough to cover all the sensors it should work (theoretical I haven't actually tried this)
With the leak sensors though there's a hard set time isn't there before it resets (wet to dry). You would have to work around that delay wouldn't you?
@@MarkWattTech It isn't instant but it is no more than 10 seconds. I have mine turn on the bathroom lights when I get out of bed in the middle of the night (I am an old man :-) ) and the lights are on by the time I get to bathroom. I am sure if I ran I would get there first but 10 seconds is tolerable. I use node-red for all the control so I can delay longer if I need to. If I get out of bed (after 5 AM) I then use TTS to read my meetings for the day and give me a weather report from my weather station. The biggest issue is I have to disable it during the day because the cats will activate. I am going to try using the car pressure sensors wired in series. If I can place them far enough apart that a cat won't hit them all but close enough together that I will it should work. I will update (coming from China so will be at least a month)
I had to wait forever for mine to arrive. I ordered 3 and only the one turned up so far. Thanks for sharing Don 😁
@@MarkWattTech I just got the "car sensors" in yesterday. I just bobbled one together with an existing aqara water leak sensor and put the pressure sensor on my office chair. Made a simple node-red flow which turns on the mac screen saver. and turns off the office lights when I stand up. Working right now but no permanent wiring. A few seconds delay when I stand up which is actually good so lights don't turn off while I am leaving office..
@@MarkWattTech Is there a delay with the ESP solution ?
Which sensor seems to be the most popular that works?
I have an aqara vibration sensor attached to my bed. It is enough to detect when I get into bed or turn me around.
Under my bed is a motion sensor. It can see me when I move out of my bed but not when I'm in it.
Thats a good use of the vibration sensor. Do you combine the two for in and out states?
Although not relevant to the subject of the video, was interested to see the Aurora socket as have never seen this before, we use a lot of clicksmart+ double sockets and love them and note they are about half the price of the Aurora ones. But interested to see the Aurora ones have power monitoring and come with a handy 10mm faceplate spacer as fitting them in most standard 25mm boxes is an arse to say the least. Keep up the good work fella 👍🏻
Thank you. I show it a little more in my Energy Challenge video and will be featuring it in my Smart Home Wall Panel video as it’s used to automate charging :)
I have a tuya based contact sensor. I have the local key, id and the ip address for it, I am not able to add it to local tuya in homeassistant. Please guide how can I add it via .yaml configuration to local tuya.
Kindly guide.
9:41 - How have I never realized that a breadboard case is thing until today???
What is the weight to activate the "digital" on/off sensors? Could they be activated by a too heavy mattress or not activating for a child/pet?
I have the same pad, the weight for activation is 25kg. I have a super king mattress which is pretty much the biggest and it doesn’t activate it. A child probably would activate it though.
It really depends on the mattress, if it distributes the weight too evenly.
The sensor won’t even register it
Yeah like Chris said. In my tests the car seat sensor and mat wouldn’t detect a child or the dog. But the Thin film sensor detected both in the Aqara and ESP setups :)
Does the weight of the mattress not trigger it? My mattress is quite heavy
Most mattress’s will have there weight distributed really well across the bed so the shouldn’t do.
Mine does trigger it
Does anyone have the issue of excessive battery drain when using the pressure pad? I set up one of these for under my bed but the battery seems to only last about 2 weeks.
For the weight strip, did you place at both side of the bed?
Or just 1 strip horizontally in the center of the bed?
I use two strips one on each side of the bed, works really well. Both into one esp32
@@iainhay2823 do you mind sharing some diagram how you wired both strip to the esp?
@@thebatu89 I’m away at the moment but will do a diagram when I get back next week for you. Pretty sure I made a diagram already so if I can grab it from my vpn I’ll link it before then
@@iainhay2823 btw, what’s the resistance value of occupied vs unoccupied for your bed?
I’m getting 10-16kOhm for occupied but I’m only getting 1 even after i cranked up to 2M on the multimeter
Please do an in depth on the option 4 ! or simply share your wiring diagram and code
Hopefully I will be doing a video and stream on this soon!
Can i do this with sonoffs SNZB-04
too? They seem very familiar and got one laying around
I haven't popped one open but in theory you can :)
@@MarkWattTech got it working with this Sensor. Used a few Jumper cable for First Test. Don't wanted to solder on the frs Side waiting for a clincher so i can Just Stick it together with the soldered cables from Sensors end.
Hello Mark. Is Aqara FP1 on your radar?
I've had several ordered for months. Each time they get cancelled by the seller. The latest one has just been cancelled today but I've been assured a new order will be sent out. As soon as I have one I will be sure to test and share :D
@@MarkWattTech I've sent you a link to a site i got them from on via a contact form on your website
@@michaelkurzewski2937 I’ll take a look thank you 👌🏻
@@MarkWattTech I’ve got one in transit to me, can ship it over if you want to have a play with it first?
Another option is to buy load cells and place one under each leg of the bed. The most common ones are 50kg each for a combined max load of 200kg. This also gives you the granularity of sensing who is in the bed based on weight.
Load cells are by far the most accurate. Theres just more to the setup :)
@@MarkWattTech True it is a bit more complicated
Enjoyed the video but wanted to offer a word of caution about using the larger mats you mentioned. These can inhibit air circulation under the mattress which is part of the reason the base of the bed is slatted.
Thanks for sharing Mark :)
I have seen the connection diagram in the GitHub file but it does not work for me, I am using a wemos d1 mini. Can you tell me where you connect the white cables that you show in the video? If you can also tell me the other cables connection to be sure but it seems that it can be seen well in the video. Or If you know a web with the correct diagram it will be very helpful for me. I already have it under the bed and I want to make the template to known the people inside according to the weight, thank you very much for the video
I am eagerly awaiting your response :) Thanks in advance
I do plan on creating a video on this, and also another video using a custom created PCB.
That would be great. I have it stopped because the article that explains it has not been clear to me or I am very stupid :)
@@MarkWattTech I'm still waiting for the video ;)
can you make a video about the template sensor?
As in just how this one works or how to create them in general? :)
Have you tried this with 2 sensors for the same bed?, is it able to tell the difference between 1 or 2 persons in bed?
I use two fsr strip one on each side which works great. One strip across the middle would let you tell the difference you would have to pick resistance with both in bed first. One person would give a lower signal so you could use that. Two strip is easier though imho. I do detect when the cats are sleeping on the bed, it is that sensitive you can actually do this
And what about sensors #1 to #3 for 2 persons in bed?
@@iainhay2823 do you hook both sensors to the same input and just calculate voltage?
Belay that question. I hooked 2 fsr up. One on either side of the bed and linked them together in the single esp8266 setup. Works great at detecting one or both in bed
You don't really need to cut the reed switch, I did this 2 years ago, there are 2 holes on the PCB to solder the wires.
I did make a short follow up to this a few weeks explaining this but it never released 😬. Thanks for sharing though 👌🏻
Hi. Does anyone knows if this only works with Aqara or can I use a Yolink door sensor?
I’ve only done this with Aqara sensors but I imagine most sensors of this type will be constructed in a very similar manner.
@@MarkWattTech Thank you. Great video
Has someone tried this with a shorter /cheaper Thin Film Pressure Sensor? like 10mm?
I'm curious if anyone has done this with memory foam mattresses. It seems like it would be hard to trigger it?
The FSD strip works well for me with a NASA foam mattress. Though it might depend on what you have under the mattress (so type of bed).
Too bad if you have a waterbed that has about 1 ton pressure in all + occupants :-D Btw. you can just change the sensor type to an occupancy sensor...
why should I need an bed occupancy sensor???
The main reason would be to trigger automations based on the occupancy. For example I have an automation that detects when I get into bed. If I’ve left downstairs windows open my speaker will tell me.
Thanks!
Appreciate it thank you!
12:36
😆
Can anyone see any reason for this not to work with other sensors from other brands, namely a Sonoff wifi door sensor that I have laying around?
no, it will work with any contact sensor
Just built this with an FSR and a Sonoff door sensor but the thing is incredibly sensitive, anyway to reduce the sensitivity? If I place a finger on it, it closes.
A few comments down, Mark states to use the ESP version. Looks interesting.
@@wwolfram33 yah this is what I was trying to avoid good thing I didn't clip the reed switch
Either the esp variant (so you can adjust sensitivity) or try a different contact sensor.
Alternatively instead of the contact sensor you could try using a leak sensor with the FSR. In my testing though leak sensors are way more sensitive- which is the opposite to what you want.