DIY Zigbee rain gauge

I would like to equip my OpenHab with rain measurement.
On the HomeAssistant website:
☔ DIY Zigbee rain gauge - Share your Projects! - Home Assistant Community
I found a solution to help rain sensor and ZigBee magnetic contact to make such a gauge.
Unfortunately, the tutorial is for HomeAssistat, and although very detailed, I can’t convert the configuration for HA to OpenHab.
I would need to create a configuration or a script (if at all possible) how to convert the pulses from the ZigBee magnetic contact to the amount of precipitation per hour per day and display this data in a graph.

I use the same Aqara contact sensor in my openhab installation, via Zigbee2mqtt. Works fine. You could implement the same thing in openhab, and we’ll be happy to help you if you choose this direction.

However, I would suggest just getting a weather station. I use an ECOWITT GW1101 weather station. It’s not expensive. I used NiMH batteries and it has lasted a while (At least 6-12 months). It communicates via 433MHz RF and there’s a USB dongle acting as the receiver. I get not only rainfall, but also wind speed, wind gust, wind direction, UV level, temp and humidity, and it has a cloud based graph to store my historical data.

I still have the same sensor lying here as a component, but never really managed to build a really reliable rain sensor out of it. I never really managed to de-bounce the reed switch properly (frequent double counts or phantom counts). Did you manage to solve this in hardware on your end?

I used my aqara sensors as window/door sensors. Didn’t hack it to work as a rain sensor.