DIY Zigbee Water Level Sensor

So after reading some other users posts about Diy Zigbee sensors using the aqara door/window sensors I started thinking about what else I could do with one. Initially nothing crossed my mind until the water top of tank for my wife’s fish tank ran dry leading to the pump running dry for who knows how long. I then remembered that the cheap water level float sensors use two wires just like the diy sensors I had read about. I quickly ordered the parts on aliexpress and promptly forgot about my idea until they showed up. This weekend I got around to wiring one up and am happy to report it works exactly as I hoped. Below I will do my best to walk through how I did it. I will try and include some photos I took as well.

Parts needed:
-1 aqara door/window sensor
-1 water float switch (2PCS Tank Pool Water Level Liquid Sensor Ball Float Switch Connectors Switches | eBay) - may not be the cheapest price but any sensor with two wires should work.

Step One
Pry open the aqara sensor with tweezers or a small flathead screw driver, and pop out the chip.

Step Two
Locate the reed switch, it is the tiny glass tube.
You will notice it is soldered on both ends, our goal is to connect one wire to the pad on either end of the reed switch. Doesn’t matter which wire goes where.
It will function if you leave the reed switch in place. Before I knew it would work I soldered the wires in, leaving the switch there. But once I knew it would work I snipped it off. Once you solder the wires on it should look like this:

Notice how the wires are pointing one direction, that was intentional and will be helpful when putting the chip back in the case. Also notice that I am not all that great with a soldering iron:)

Step 3
Notch out the corner of the case to allow the wires to pass through. a sharp pair of snips did the job.

Step 4
Reassemble the sensor.
At this point you have two options. When disassembling the sensor I snapped of the interior piece that held the chip in place. This also apparently is what allowed the top portion of the case to snap shut. So now when I placed the top part on it didn’t stay put. I solved this with a piece of scotch tape. Alternatively you could try and leave that interior piece in place and see if the wires would fit inside with it there. I have not yet opened up another sensor to test if it would fit.

Here is the finished project:

At that point I simply paired it with Deconz and added it to HA. I THINK ( I am not sure) which position it reads on or off for will depend how you connected the wires. So just bench test it to see if on or off in HA corresponds to a low water level. I then set up a automation to notify me when the water in the tank got below about 1/4. I plan to add a smart outlet on the socket for the pump so I can also kill power to the pump automatically.

This is the first time I have ever tried sharing a walkthrough like this so place let me know if you I missed something or if you have questions. Also if you know of another sensor that runs on two wires let me know and possibly I will try it out.


great idea! very good write up as well. :+1:

I love seeing these kinds of DIY posts. they always provide inspiration like the ones you saw did for you.

Hi Robert!
I was searching for an easy way to manage our water well levels as you. We suffer the same issue with water pumps and water level.
Your idea could fit a lot. I was seeing the post but was not clear for me the implementation.
Where did you placed the window sensor?
I was not able to find the ebay link you provided, it does not exists anymore :frowning:

Thanks for your post and help!

Why not buy a Zigbee Water Sensor like Tuya ZigBee Smart Home Water Sensor Leak Detector Flood Water leakage Alarm Works With Tuya Zigbee Hub| | - AliExpress (AAA battery, standby time 3 years) or Tuya Zigbee Leak Sensor Water Leakage Detector Leakage Sensor Water Sensor Prevent Water Leakage For Smart Home Var Smartlife - Leakage Sensor - AliExpress (CR2032, over 1 year battery life with messages a day)?

That is the window sensor I used.
This window sensor is placed outside the water tank and the float sensor goes inside.

Those are leak sensors which are meant to detect, well a leak. So I assume they trigger when water is detected. My use case is to determine when a tank of water gets low. The leak sensor would have to be completely submerged in the tank and then I would have to set up a notification for when it turned off I assume.

It may be possible to do that with a leak sensor but I am not sure if they are meant to be completely submerged long term. I can’t imagine they are.

Both probably work on the same principle. Two ends will create a contact when submerged in water and when the leads are dry it’ll break the contact. I’ve ordered the CR2032 device I’ve mentioned and will use it in the basin of an outdoor fountain.

I think the contacts are injection molded, so I’m not worried they are going to decay when submerged or even that water can pentrate it. With the Aqara sollution you can have issues with corrosion of the stripped ends, the spacing between the two ends could be an issue also.
Source photo: Aliexpress

Thanks for the Aqara idea though, I’m going to use it on my mailbox using a microswitch.

I did the water tank level check with an aqara leak detection sensor as well.

I was thinking of DIY but this is outdoor and cheap enough.


Did you deploy the CR2032 device for checking water level purpose or for leaks? Does it send messages more frequently if there is water contact?

I’m debating what route to go for water level alerts for an outdoor water fountain. Preferably something that works with Zigbee2mqtt.

How is it performing for you? Can I ask if those are a specific type of probes you attached, I can get them online or the hardware store?

Since it’s a leak sensor and the probes are submerged, does the state report back “leak” and you treat that in your automations as “water level is good”? How often does the Aqara leak sensor update?

How is it performing for you?

It works well for me.

Can I ask if those are a specific type of probes you attached, I can get them online or the hardware store?

Those probes are just speaker wires I had laying around. Just anything conductive will work.
Get any kind of cable. Just make sure they can not touch each other and therefore fake the sensor to submit a leaking status.

Since it’s a leak sensor and the probes are submerged, does the state report back “leak” and you treat that in your automations as “water level is good”?

Yes, I just have the state as “Dry” or “Wet” I think. You could use a template sensor to change that to whatever you like but I was too lazy.
There is no water level. It is just “wet” or “dry”.

How often does the Aqara leak sensor update?

No idea

1 Like

I have written down more details in my blog just now:

1 Like

Nice, just read your blog.

Any idea how’s the battery life if used this way? From my understanding it’s meant to do a leak sensing, so if it’s in water all the time…would it be sending notifications nonstop?

I want to try something similar but even the aqara leak sensor might be expensive for this purpose, as I have over 30 pots around the house. Each sensor is almost $30 here…oof. I wonder if there’s a cheaper, more DIY option.

Regarding the battery, there should be no difference.
It will just trigger on state change as far as I know but could be wrong here.

The sensor is only sending you the state change. So you will only get notified for the state change.

What are you trying to accomplish with those 30 pods?

I have no experience with the leak sensor batter but in general the aqara batteries seem to last forever.

For reference the sensor I set up for this post is currently at 91%. In addition to the open/close functionality that is used to detect the water level my sensor is also reporting temperature into home assistant which also updates on each state change. This happens a lot more often then the water level state change.