☔ DIY Zigbee rain gauge

Hi,

The problem is most likely that the state of the sensor changes when HA is restarted.

I use ZHA and don’t have this problem. I suspect it may have something to do with z2m.

What you can try is to restart HA and then look at the ‘states’ table in sql, to see which state changes take place when restarting.

Also look at the settings in z2m to see if there is some setting to retain states.

Or you could be creative and set a boolean when restarting HA, that prevents updates to the counter, and turn the boolean off again when HA is restarted.

Oh and by the way, in the start of the thread there were others with this problem, perhaps you can find a solution there

Came across this a few weeks back so ordered the stuff off Aliexpress. I didn’t want to mod the door sensor if i could help it, so I 3d printed a little carrier board for the door sensor PCB to sit in, since the reed switch is almost identical!

happy to share the STL if anyone is interested in printing it

3 Likes

how can i use the same metod for the wind speed sensor from the same brand? hardware wise works the same

It should work if the mechanism works the same.

However I think it might drain the battery quickly if it’s sending signals a lot.

Well, once again, the rain bucket was sabotaged by a spider after a longer period of no rain. Original battery still going strong.

1 Like

I’d love the stl please

You must not be on the plain - I heard the rain in Spain falls mainly on the plain.

I like it but I can imagine the wind where I’m at destroying it

This may be a weird problem since I searched the posts (for “calib” and didn’t see anything else like it. I had to reset my Aqara sensor so I brought the rain gauge inside. I tested it and it was way off - think it may have been before because i would get what I thought was a lot of rain and it barely registered. I was only getting around 5 flips per 10 ml poured in, so I poured in the 139.7 ml (close to it anyway) and it flipped 54 times (sometimes 53 or 55). I know if it had some debris buildup in the bucket it would affect how often it would tip (capacity would be less), but it is clean. I worked out a new in/pulse multiplier as (83.82/54 * 0.1193) and it is near perfect - if I pour 139.7 ml (close) I get 1 inch of rain.
I live in Arizona and the device has been outside for going on a year but shows no signs of “melting” as some things have. Has anyone else had to re-calibrate? I’m hoping it will last another monsoon season without getting out of calibration again - I will try to remember to check in August LOL

How did you pour this amount of water in the rain gauge? Drop by drop or faster? Because the faster you go, the more inaccurate it becomes, because the bucket inside will overflow.

Not drop by drop but pretty slowly. I realized after the first test that it wasn’t registering correctly when I did it faster. I haven’t put it back outside yet so maybe I’ll come up with a way to have it drip in at a steadier pace. Thanks for the great tutorial and followup.

1 Like

I am using the rain sensor as an input for my irrigation planing. Is there a way to get the value for e.g. the rain measured in the last 24 hours based on sensor.rainfall_today? I am trying to come up with a statistics or history stats sensor for this, but it seems both have issues with counters, which are reset on a daily basis.

Any suggestions?

Have you looked at sum_differences_nonnegative?

Using the rain gauge into ESPHOME using an ESP32 I have found that the pulse from the reed switch is too short to be detected by the ESP32.

I don’t believe there are interrupts available? So I just added a simple RC circuit.

The reed switch quickly discharges the 2u2 Capacitor making the input to the ESP32 low. But the cap takes a short while to charge via the weak internal pull up resistor. Thus extending the pulse. The 470R limits the current through the reed switch to a max of 7mA.

Just posting to help others

1 Like

You can use interrupts with the GPIO Binary Sensor.

1 Like

Thanks, I was misinformed on another thread, I will add that, remove the capacitor and give it a try and report back.

1 Like

This is a great project, thank you for the inspiration.

I’m using the Aqara Door Window Sensor and am quite happy with that.
Here is my take of a fixture that mates the Aqara sensor with the Misol Rain Gauge:

Rain Gauge Fixture for the Aqara Door Window Sensor

1 Like

Great lateral thinking! My version is using an old / recovered oval collector that had failed years ago. A small magnet was added to the other side of the bucket to provide better clearance for the new $5 AA-powered Zigbee sensor which then fitted without modification. [I’ll replace the Blu-tak with glue once proven reliable!]

I wasn’t happy with the resolution (one tip per mm) so I increased the collection area: wanting something UV-stable I landed on a $5 17cm glass saucepan lid, knob removed and fixed with double-sided tape. Flyscreen was added to keep the drain clear and reduce any losses from drop splatter.

3 Likes

Hello,
With this method of a door sensor is it also possible to adapt it to a wind speed sensor anemometro with an internal reed sensor by soldering the 2 cables to the electronic board of the door sensor or is the problem that the on off speed is too high?

There is only one way to find out, and that’s to try it :wink:
That’s also how I started this project.
But I wonder if the battery would last long with the constant communication.
Let us know your findings