A list of door sensor / reed sensor hacks! (Aqara, Xiaomi, others)

I have the same issue. Only just discovered this thread. Bridged the terminals on the hall sensor and it’s drained the battery overnight. Did you find a solution?

Did you have any luck with this, I basically bridged the two terminals you’ve pointed out in red and it works perfectly, but has a cheeky little 50mah draw like @mistraller had so flattens a battery in about 24hrs.

I did only measure what’s wrong, but no time to try the solution…
I measured the hall sensor will put a HIGH signal to the chip when magnet is not near. The wire we soldered to it, will connect the gnd to the output as well. So signal goes low and chip will detect that, but we are also creating a loop through the hall sensor. The sensor can deliver 50mA so battery will drain. I think hall sensor must be removed; connect sensor between vcc and the sensor output which goes to the chip. Invert your signal in HA. Only thing I’m not sure about is if the chip will detect the difference between vcc and “open contact”. If that does not work we should add a pull down resistor. (Or a pull up to get HIGH in rest) and pull the signal up (or down) with our sensor. I’m not sure which value to choose for a pullup resistor but the higher the better as that will limit the current.

See Pull-up resistor - Wikipedia

Really cool. I’ll do some experimenting. Thank you

I have managed to get it working with one of the door sensors that uses a hall effect sensor, without overnight battery drain. I did basically as @mistraller explained, it’s pretty easy to do, just requires a small amount of careful soldering.

First, I would recommend testing that the switch works in the first place, as one of mine didn’t.

Using a multimeter, identify the pinout connections on the hall effect sensor. In my case, the pinout was as follows:

Next, remove the hall sensor, I just carefully desoldered it, but you could also cut the pins if that’s a bit difficult.

We then want to solder a pullup resistor between VCC and Dat, to ensure the Dat pin is high when the switch is ‘open’. I used a 100k resistor which worked well for me. If you struggle with accuracy of the results (which you shouldn’t), you could try go down to 47k or even 10k, but this is likely to increase battery drain.

Next, solder the two wires from your switch. Attach one wire to the GND pin and the other to the Dat pin. I used Dupont cables to ensure the sensor isn’t permanently attached to the switch, making it easier to move the setup if needed.

Then you can reconnect the sensor to HA, and test that the modifications work, just touch the two ends of the wires connected to VCC and Dat (or flip your switch, whatever is easier), you should see the state change from closed-open.

I then added a template sensor in HA to invert the state of the sensor so that it reads correctly.

3 Likes

You absolute legend. Thanks so much for taking the time to share.

That is great news :slight_smile: I had so much other projects that I still didn’t find time do test this. I have 10k, 47k and 100k in smd size (very cheap on aliexpress) and i think there’s a free spot in my sensor to place it. dupont wires is also a smart idea, I damaged one of my sensors because a wire ripped off a soldering pad.

Hi, I just used this one for a rain gauge meter and got it working by soldering wires of an external reed switch (in the rain meter) to the tiny black sensor that you see right from the middle on your picture. That is the magnetic sensor that is used to detect ‘magnetism’ from the magnet.

BUTBUT After 3 weeks the whole set-up stopped working and effectively the sensor is ‘dead’. It still detects via Zigbee, I can still find battery voltage, but it does no longer detect ‘magnetism’. My guess is that the sensor cannot withstand soldering and being connected to an outside reed contact.

I will retry using the Aqara sensor, that is natively fitted with a reed switch therefore better equipped for tampering and soldering.

Cheers Kees

1 Like

I use an Aqara door contact modded with a microswitch on the end as well as the factory reed switch so i could detect if my window was unlocked or open, as a closed window that is not locked is open in my eyes. I did this to all my windows in the house.

I have the same problem and I kill a button cell in 4 hours!
I soldered a 100K.
I start the stopwatch :wink:

it won’t be enough!!!

outside 10°C
I’m thinking of soldering a 18650 battery instead of a button cell?
my sensor look link @Perchy

This is not what I would expect. Are you sure you have the connections wired correctly? You can sometimes still get the trigger working even if the resistor isn’t correctly pulling up the dat line (and this continues to drain the battery at a high rate).

You could do an 18650 but you’re still going to be draining at a relatively high rate. If you get this working correctly then you should drain next to nothing.

Mine is currently 5 months on the same battery with no noticeable drop in voltage.

Can someone please explain how this sensor works battery wise?
Am I right saying that when magnetized so in ‘close’ state it doesn’t drain any battery?

Only when in ‘open’ state drains battery due to the listening mode waiting to be magnetized again. Right?

I’d like to use wire it to my burglar alarm to monitor when it goes on. And leave the sensor dormant when no siren is fired.

Thanks

@antani As far as I know these sensors consume next to no battery in either state. It is only when they ‘pulse’ and change state that there is any significant battery usage.

The sensors should last years in both the mostly ‘open’ or ‘closed’ states, provided they’re not receiving extremely frequent updates.

1 Like

Thats why ive bewn using the leak sensors with long leads, easier to modify too but thats great information to know.

Just got one of those and run some tests. I can confirm that very low to no battery seems to be drained when in idle state.
It only turns on when pulsing for a state change.

This is how I modified it to get notifications when my burglar alarm goes off.
I have a cheap Tuya door sensor and I couldn’t find a proper magnetizable bar like the sonoff sensor but shortcircuiting the pins below does the job.

You seem to have a low-side drive and pulling it high to get default state you want. So it’s constantly draining through the resistor (even 100k can be too much). Better to pull down (or whatever is reversed logic) so the voltage pulls to the natural value without much of any resistor (it’s different for every device design). I know this sounds cryptic, but you just have poke around the terminals and trial and error for a while.

I just did a write up on another thread for these hall effect sensors… or similar ones anyway… and I have already spent waaaay too much time on this today so I am going to shamelessly quote myself:

Been alive for at least 6hrs so far and still at 100%, most of that was without magnet present but it is now functioning as my water meter sensor with a ~66% magnet present duty cycle, so will be a good test, if I remember I will update at some stage on the battery situation.

1 Like

I purchased 2 different door/window sensors cause I read this thread first and people were having issues modding them… so I mapped out the other one, though it has been successfully modded above, I can see a neater way of doing it:

Board: ZD08Y-ZTU_V1.1 dated 2024-02-29

P1 is the wire attachment point, one is grounded, the other is mapped above.
both the external points and the hall effect sensor are connected to the same pin of the controller, so this is unfortunately not the second opening sensor being reported for this device (I was unable to find it at all, which I think has been mentioned above… it may just be a ghost… or lazy implementation)
The P1 part of the board (mapped above) is also unpopulated on my one.

Unlike my other door sensor, this one doesn’t have a stupid drain when open as its connected directly to the pin, but this also means that you need a pull up or down resistor instead of using existing.

I would suggest anyone looking to mod this one do the following (after you have confirmed that it is the same board by beeping it out):

  • Attach wire for external sensor to P1, this is in a good place to feed out the hole in the back panel, is easy to solder and will be stronger.
  • Bridge R10 (solder bridge or cut off resistor wire… or a 0ohm resistor if you are feeling fancy)
  • Bridge Q1 between the R10 input and D7 output (careful not to bridge to VCC)
  • Put a big resistor (1M would be my pick, but I haven’t tested this) in the R4 spot or in Q1 (between R10 and VCC)
    If you are half decent at soldering, you could use the resistor leg to bridge the Q1 pins by adding a sharp fold the right length, then put the other side to VCC

I am going to use this one as is, so please try at your own risk, trust but verify, if in doubt beep it out… other generic or humorous caveats…

Quick update on this as I am here: been running for around 20hrs, still at 100% battery