☔ DIY Zigbee rain gauge

@FranziGruell not during an operation, but this spring an spider build its cocoon in the flip mechanism… just open the casing to check mechanism…

br Frank

Very nice project! I got the aqara door sensor and the rain bucket is coming today. But where to put which yaml code? The sensor code goes in the configuration.yaml? But the utility meter, template and what is the lovelace code for daily, montly and a year? Sorry for my noob questions.

You can put all code in the configuration.yaml. If you split the configuration.yaml in multiple files, you should add it into the seperated files.

1 Like

@atv Your messages helped me out to get it working. Now im struggeling with the weekly, montly and yearly rainfall. How did you fix it? With the utility meter? Where to put that yaml code? I get error when i put it in sensors.yaml.

@parrel thanks! also with the code from atv i solved it. Now i’m struggeling with the utility meter. In the sensors.yaml i get errors when i place it there.

edit: solved! just put in in automations.yaml and now it works :slightly_smiling_face:
i had also the source sensor (daily rain) wrong. After naming correctly it works.

Hi @parrel , Sorry for noob question. can you help me if I want to create another intensity with just 15/30 minute? is it just change the *3600 value in this line? become 1800 if 30min for example?

{% set rain_hour = ((state_attr('binary_sensor.rainfall_trend', 'gradient') | float(0)) * 1800) | round(1, 'floor') %}

Yes, it indicates change per second. So if you multiply it by the amount of seconds you want the measurement for (1800 seconds for 30 minutes), you should have what you want.

You can test it by creating one for 3600 seconds and one for 1800 seconds and see if the one with 1800 seconds is half of what the 3600 seconds sensor is.
10mm/h = 5mm/30min = 2.5mm/15min

1 Like

thanks for the explanation!! now just waiting some water drop incoming :smiley:

1 Like

Made some case/holder for MS-WH-SP-RG. Maybe it will be usefull for someone:

3 Likes

What’s up everyone! I’m hoping someone can help me troubleshoot. The Aqara door/window sensor works, and I’m able to connect it to HA but as soon as I solder it to the rain gauge using the red and green wires, I can’t get it to respond (even after replacing the battery). I did remove the reed switch that was already on the Aqara sensor. Maybe there’s something wrong with my rain gauge? When I remove/un-solder the rain gauge, the Aqara sensor responds again.

Any help or tips would be appreciated!

@tfc87 Is original reed switch still alive? If yes, just solder it back and check if problem persist. If not I recommand to print holder for aqara sensor already published here instead of soldering original misol reed switch.

Unfortunately I don’t have the original reed switch so I’m at a loss on what to do. I don’t have a 3D printer either.

If you short pads on aqara sensor is it still responsible? Reed switch on misol sensor is the same type as in aqara and works the same. The only thing that comes to my mind is damaging the aqara during soldering or damaged misol sensor itself.

Verify if the reed sensor on the rain gauge is still working

Apologies for the dumb question but how do I do that?

Shorting it doesn’t seem to do anything. I assume it would indicate in HA as an open or close.

Exactly, it looks like your aqara sensor somehow not working properly.

Could I have fried it somehow or something while soldering or is it more likely faulty upon arrival?

I have 20 of this sensors in my home and none of them was fault on start.
Maybe something goes wrong in Z2M itself. Did you re-pair your sensor in Z2M?

Hi @parrel It seems the 30 minute period intesity was just right, its half of the hourly intesity.

But i noticed another issue, Im using your binary_sensor trend templates for hourly intensity, but the hourly intensity value stay and didnt comeback to the 0 even after some hour. I dont know but it shouldnt be like this right? can you please kindly check my sensor value is it okay?



{% set rain_hour = ((state_attr('binary_sensor.rainfall_trend', 'gradient') | float(0)) * 3600) | round(1, 'floor') %}
{% if rain_hour >= 0 %}
  {{ rain_hour }}
{% else %}
  {{ 0 }}
{% endif %}