☔ DIY Zigbee rain gauge

The water should go though, is the hole not clogged?

I put it on the side and at some point I heard the click and the water drained. Strange right?

With small amounts of water and due to the surface tension of the water, an air bubble may prevent the drainage? check whether there are any plastic burrs from the manufacturing process or any other soiling (spin weaves, fluff, etc.) on the hole? I would NOT provisionally deburr too much, as this could change the dripping inside and prevent water from landing on the flip-rocker. But if there is a clear burr, cut it off carefully with a knife. On the other hand, the whole thing should still work if more rain falls…

an air bubble can also be removed by simply “tapping” the hole with your finger to start the drain… this should work better afterwards?

1 Like

Hi everyone,
I’ve build this and is working good with moderate and heavy rain.
my problem is with that rain that falls big drops here and there and is like every single one misses the bucket, as it didnt register anything for hours despite is is raining for some.
My question is if i increase the size of the bucket, will it be ok with the measurements accuracy?

Thanks

1 Like

First make sure that the sensor is not too far from another zigbee repeater, so that does not cause that it’s missing tips.

If you are afraid that the rain splashes out of the bucket, you can create an extension with a 3d printer that only makes the bucket higher, but not wider.

You can also make it wider, but the rain will still splash out in the corners

Example: ☔ DIY Zigbee rain gauge - #490 by mauritsivs

I personally havent had problems with rain splashing out.

Ok so maybe its the connection, i checked the strength of it and its says 16 lqi but sometimes it drops to 0 for a few seconds, thanks for point this out.

1 Like

Just a quick update on my raingauge. I installed it in July 2021, and it has recorded rain since that day without any issues, well today 20/01/2021 I have just had to climb up and change the battery. Not bad for a battery in such a hostile location.

1 Like

Great to hear, I think I’m going to replace my battery soon too just to be sure.

It’s been working great. I followed the guide in the original post.

1 Like

Hi all,
I have created a funnel to increase the gauge size to 200 cm^2, as well as add a sharp edge and make the gauge opening circular. Its published on my printables here: Printables

based on the testing done by @erikg the calibration should be set to roughly 10 tips per mm of rainfall or 0.1 mm per tip.

4 Likes

You went back in time! Nice :rofl:

1 Like

Whoops might have been 20/02/2024 :rofl: :blush:

Hi Sorry but as a newbie I’m struggling to make the rain gauge switch work using the code above. I changed entity-id to the one that was added to Zigbee in Home Assistant, but the rest was left as is. I have tried to check it in “template” in developer tools but its doesn’t count. I checked that the yaml was correct in a checker. Should it work in template or do I need to add it to my config file.yaml ? If so I would really appreciate what I need to do as I am quite frankly confused! Thanks in advance

Ok, lets start from the beginning :slight_smile:
Have you checked the entity that was added by Zigbee, to see if the state changes when you flip the rain sensor?

Hi Parrel, Sorry I should have detailed my problem a bit more. I have been struggling with this for some time. Yes the entity does change state when I flip the rain gauge. I even wrote a bit of code for the entity to check it changed state and added it below your code in the template in developer tools. I assume I don’t need to add anything like template or sensor files to the config file at this stage? I am confused about naming’s and how they interact, such as when you use name: (Rainsensor flips) in your code and how that interacts with your actual aqara sensor entity_id as that I assume is not the friendly name you’ve given it? I have also amended the code to try several combinations of names and entity id’s but nothing seems to show the count increment. Thank you for your quick response

Start by adding the first piece of code (history stats) to configuration.yaml, and replace the entity id with the id from the aqara sensor.

Restart home assistant and see if there is a new entity named rainsensor_flips.

Try to see if the value of that sensor increases, when you flip the rain sensor bucket

Hi Parrel, thanks yes that worked, I added the second piece of code as well and set up a rain gauge card and it works displaying daily rainfall. Thanks very much. There were two things I was doing wrong, I thought, incorrectly that you could use the template in developer tools without doing anything else, that is what confused me, as I couldn’t understand how HA would know how to correlate with the rain sensor even when I changed the entity ID. Now I know! Second point I did try this in the config file, but only did the quick reset of the Yaml and not a full reset of HA. Thanks again, I think I now know how to proceed. Thanks again

1 Like

You’re welcome :slight_smile:

All set up in the garden and working thanks

1 Like

I was unsatisfied with trend derivative (gradient) approach to calculating rainfall intensity in post 1 as it will keep the rain intensity last measured even if rainfall stops. I saw a few people making the measurement time out and setting the value to zero if no tips occur in 10 minutes but I feel there is a better way.

I created a template that calculates the rainfall using the time between the last two tips (the same as the derivative method), but then also considers the time between the most recent tip and now. If that time is longer than the time between the past 2 tips, it takes precedence.

template:
    - sensor:
      - name: "Rain Intensity"
        unique_id: rain_intensity
        state: >
            {% set lastTip = (as_timestamp(now()) - as_timestamp(states.binary_sensor.rain_sensor.last_changed)) %}
            {% set betweenTips = states('sensor.rain_sensor_time_between_tips') | as_timedelta %}
            {% set max_time = max(lastTip, betweenTips.total_seconds()) %}
                        
            {{ (0.1 / (max_time / 3600)) | round(1, default=0) }} {#replace 0.1 with your mm of rain per tip value #}
        state_class: measurement
        device_class: precipitation_intensity
        unit_of_measurement: "mm/h"
    - trigger:
        - platform: state
          entity_id: binary_sensor.rain_sensor
      sensor:
        - name: Rain Sensor time between tips
          unique_id: rain_sensor_time_between_tips
          state: >
              {{ (now() - trigger.from_state.last_changed).total_seconds() }}
          state_class: measurement
          unit_of_measurement: "s"
4 Likes