☔ DIY Zigbee rain gauge

Thanks to all especially @parrel for keeping this active. I am having issues and very confused with the new template configuration vs the legacy. I had it working previously but mistakenly deleted that portion yaml.

My configuration.yaml has the file split as follows
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
binary_sensor: !include binary_sensor.yaml
sensor: !include sensor.yaml
camera: !include cameras.yaml

Does anyone have @parrel configuration.yaml broken into the sensor.yaml?

1 Like

You would need to add template: !include template.yaml to configuration.yaml and create a file named template.yaml where you add it.

Can the yaml files ie sensors.yaml contain the legacy and new template scripts or need to be all changed to new?

You can use both the old and the new, but they can’t be in the same yaml file with your configuration.

Read this to better understand what’s actually happening when splitting up the configuration

I used a different rain gauge.

The TFA 30.3161 is good available in the Netherlands for about 20 euros including shipping costs.

The advantage of this rain gauge is that there is more space for the Aqara sensor. I temporarily glued a magnet on the buckets. There is still room for a magnet on the side. I have ordered these small magnets. The magnet on the tray shows no measurable differences in the measurements.
I slid the sensor into the waterproof housing with some packing foam.

If you have found the right position, the sensor does not affect the operation of the buckets and indicates 100% reliable ticks!

IMG_20220803_091330912|375x500





6 Likes

Thanks for sharing! What is the surface area of this gauge (to calculate the rainfall)

How do you calibrate the rainfall?

There’s instructions in the first post where they already figured out the surface area and the math.

Then I just created a helper and set the step size to that value. So every tip, it increments by that amount.

But I figure if you are using a different style device with a different surface area a round about way to do it if you’re not a surface area physicist.

  1. setup the smart device next to an old school rain gauge
  2. Reset # of tips to 0
  3. Wait for rain
  4. Check old school rain gauge. Lets say it shows .1" of rain
  5. Look at # of tips, lets say its 25
  6. .1" of rain divided by 25 tips = .004"
  7. Set the helper to increment by .004 for every tip

Thats kinda what I did to tweak my number. You can see the gauge showed more rain that what the sensor counted, so I just needed to tweak by number it increments by slightly. Now I am pretty much right on everytime (or close enough for my purposes)

2 Likes

To calibrate I worked out the surface area in mm2. this will give you milliliters per 1mm rain. Then worked out how many of those 1mm of rain were in 200 ml of water. Poured 200 ml of water through and counted the tips, repeated this 4 times and averaged the result.

X x Y = Z (1 mm rain)

200 / z = A (1mm’s of rain in 200ML)

tips / A = mm per tip.

If I remember correctly :grinning:

2 Likes

For folks that have to suffer with imperial measurements, how do you handle this section of the template sensor?

- sensor:
    - name: Rainfall today
      unit_of_measurement: mm
      state_class: total_increasing
      unique_id: rainfall_today
      state: >-
        {% set count = states('sensor.rainsensor_flips') | int(0) %}
        {% set mm = count * 0.30303 %}
        {% if count >= 0 %}
          {{ mm|round(1, 'floor') }}
        {% endif %}
        # If you have issues with the history sensor doubling after restarting HA, add the line below (@BigG)
        availability: "{{ (states('sensor.rainsensor_flips') not in ('unknown', 'unavailable')) }}"

Doh - missed this:

I also got 6 tips per 10ml so I used 0.30303mm per tip. If you use inches, it’s 0.01193 inch per tip. We can use that in a sensor to calculate the rainfall today, or in a week, or month, etcetera.

@parrel ,

It’s a nice project. I want integrate my rain (simular like your’s descrbibed in this topic)
gauge into homeassistant. Is it possible to receive all yaml files of this project?
=> or an whole example? (here in the topic is missing: ESP32 / ESP2866 / nodemcu platform, config for wifi etc.)

Thanks,

The YAML Files in the original post are for Home Assistant when you go the Aqara way.

See Palito’s post, he has done it the ESPHome way

1 Like

Many thanks for sharing this post. :pray:
I’ve looked over this post :see_no_evil:
I will try this. And also many thanks to @palito for the ESPhome way “ESPxx” boards.

2 Likes

Can you share more infos about how u did?
Thanks!

any way to implement the other sensors as well on esp to build the station?

can u clarify what is this “tip”?
i did not understand it right

also how do you calculed the 0.303??

o boy,o boy, o boy. We are having a typhoon today.

same day

1 Like

This rain gauge calculates the rainfall by filling a small bucket, and record it when that tips (the tip)

this sensor is a utility meter?

im little lost here about the rain sensor, since it does not decrease, is like an acumulated rain, does that make sense or im confusing here?
XD

I guess im confusing with the wind sensor, this one does not make sense to acumulate but shows the increase/decrease wind speed based on the rotation…