In this short tutorial, we are going to talk about how you can make your own ZigBee pressure contact sensor, using cheap AliExpress components. This kind of device can be placed under your favorite chair, sofa, recliner, bed or under the carpet and be triggered when pressure is applied which in turn will activate a desired automation within Home Assistant.
To create a sensor of this kind, you will need a couple of things:
- Basic soldering skills
- Basic gadget disassembling and assembling skills
- Up and running Home Assistant server
- Car Seat Pressure Sensor (any kind, from AliExpress)
- Door and Window Contact Sensor (any kind, from AliExpress)
Soldering skills required are minimal, as you need to connect only two wires from the car seat pressure sensor to the door sensor. We listed basic gadget disassembling skills as a requirement, because you would need to open up the door sensor, drill a small hole for the two wires from the pressure sensor to fit inside and assemble it all again.
For the purpose of this tutorial, we are going to be using an extremely cheap Car Seat Pressure sensor from AliExpress and the cheapest ZigBee door sensor you can buy for your Smart Home, the Tuya TS0203 ZigBee Contact Sensor. You can use ANY magnet based contact sensor you have lying around, such as an Aqara, Sonoff, Tuya etc.
And finally, to make the most use of this device, bring it into Home Assistant and create your desired automations based around it as a trigger.
Explaining the hardware
For this tutorial, we are using a contact sensor we recently reviewed, the Tuya TS0203 ZigBee Contact Sensor. Because 99% of door and window contact sensors are triggered with a magnet and a reed switch, you can use any extra contact sensor you have lying around. All of them are suitable for this DIY project. If you do not have a contact sensor, we suggest the following:
The car seat pressure sensor can be purchased dirt cheap from AliExpress. Its a thin-film contact sensor, which triggers when a certain amount of pressure is applied. If you want to support this blog, consider using our affiliate links bellow:
Note: Because the pressure sensor is meant to be mounted under a car seat, a fair amount of pressure is needed to trigger it. This is a good thing, because it will avoid false positives. Each of the round contacts close the circuit independently to trigger the sensor.
Making the DIY sensor
First, we need to disassemble the Tuya TS0203 contact sensor. This particular gadget can be opened with nothing but a small screw driver, for prying the parts apart. Be gentle, to avoid damaging any inside components. You can check out the full review and disassembly of this device HERE.
Next, we need to drill a small hole which would be the size of the two wires coming from the pressure sensor and going inside the ZigBee door sensor. Figure out on which side of the shell lies the reed switch when assembled, and make your hole there.
Tip: You do not need to use a drill bit for this, you can simply melt it with your soldering iron and remove any excess with a scalpel.
Inside the door sensor, carefully solder the two wires from the car seat pressure sensor to the ends of the reed switch. Because this is a fairly small device, you need to be careful with the soldering iron. You do not want to melt or desolder anything else on the main PCB.
Once the two are connected, carefully assemble the contact sensor again. Because you now have two extra wires you need to fit inside the shell, be careful and try not to break the solder when bending them in position. Once done, your device is ready to be paired to your ZigBee coordinator.
Adding the sensor to Home Assistant
To add our DIY sensor in Home Assistant, you follow the pairing procedure as you normally would with your contact sensor. It will be discovered normally as the type of device it is and its appropriate model.
As a test, we will create a simple automation based on the state of our new DIY sensor:
alias: Living Room Recliner Occupied
description: 'Activate Movie Mode Scene When Someone is Seated in the Living Room Recliner'
- platform: state
- condition: time
- service: scene.turn_on
Code language: YAML (yaml)
Usage Examples & Ideas
After you’ve added your new DIY sensor to your Home Assistant server, you can create any automation based around it as a trigger. Some examples and use cases:
- Installed under your living room recliner
Example: Turn on the TV and dim the lights when seated
- Installed under your main bed
Example: Trigged a good night routine
- Installed under your bedroom carpet
Example: Trigger a morning routine when you wake up
- Installed under you baby mattress
Example: Trigger a ‘baby sleeping’ automation
These are some ideas for the usage of this sensor, in reality you can install it anywhere you can trigger it by applying pressure. Once added in Home Assistant, you can go crazy with automations, scenes and routines.
SmartHomeScene.com is a participant in the Amazon Services LLC Associates Program & AliExpress Portals Affiliate Program.
We may earn a small commission on qualifying purchases from these websites, which incurs no additional cost to you.
SmartHomeScene © 2023 All rights reserved