The logic in that yearly chart was needed because HA only keeps montly statistics, so I needed to retrieve the highest value from the 12 months in a year, because that would be yearly total.
Here is a monthly chart which is much more simple
type: custom:plotly-graph
title: Rain per month
hours_to_show: 6y
entities:
- entity: sensor.rain_month
name: Rain (month)
period: month
statistic: state
type: bar
layout:
yaxis:
title: Rain (mm)
Thanks @parrel and apologies for the delayed reply…life gets in the way sometimes!
I’ve checked the raw data (binary flips) and you are correct - at the points of interest there are two flips recorded in the same second. I’ve marked 09:49:18AM as the first point of 2 flips in a second, this corresponds with the first spike (RHS).
I’ll have to test out my bucket sensor further for a mechanical/electrical issue, as rain would never be heavy enough to trigger 2 flips per second. I don’t think you could pour water fast enough through the small drip hole to achieve this anyway!
My sensor is a hall-effect type (not reed switch) with a small rectangular magnet attached to the bucket…unsure how I could get a double hit.
Wie kan mij helpen? Ik kom er niet uit. Wat ik ook probeer het werkt niet.
Zit het in de yaml code? Waar plaats ik deze?
Ik snap het echt niet meer, tuimel ik de tuimelaar dan gaat deze wel van Open naar Gesloten en weer naar Open. Dus de sensor werkt wel.
Hi Parrel,
I will do it in English.
But can you tell me where to put it? I’ve already done this, but it doesn’t work. Yaml isn’t really my thing yet.
Thanks.
Hi Arh,
I understand that. I’m putting the code in the config.yaml.
But then it doesn’t work at all, and I don’t understand that. Meanwhile, the flip count works, but I don’t see a rain sensor. Strange, right?
So what am I doing wrong?
I don’t quite understand it, but the code I had turned out to be incorrect. The code for this project is correct, and everything works now. Thanks anyway.
I just got my “hardware device” from AliExpress and I only did some indoor tests (Works fine with a 3D printed holder for the Aqara sensor!), and I was wondering if the sound of the tipping is an issue out in the wild? It seems quite loud inside… Did a neighbour or so ever complain?
But I cannot relate to the loud sound, I mean, you can hear the click, but only when outside, and it does not tip a lot, during light rain maybe 4 times an hour. During heavy rain it wouldn’t be hearable outside as well. Let alone inside.
Hi, I never got around to thanking you for this thread. I replicated your setup about a year ago and have been tweaking it occasionally since then.
I’m using a Tuya Zigbee door sensor from Aliexpress and it works OK. I recently connected it to my ZHA network instead of the Tuya integration so it keeps working when there’s no internet available. This required a ZHA quirk to get the battery voltage coming though correctly.
Some features I’ve used or added:
15 minute rainfall intensity
Instantaneous rainfall intensity, calculated using the time between bucket tips. I have this automatically resetting to zero after 30 minutes of no rain.
A rainfall event total. This resets automatically after 6 hours of no rainfall.
A manually resettable rainfall total.
Statistics sensors for the maximum rainfall intensities in the last 12 hours.
A switch to disable the rain gauge and prevent any rainfall being recorded when setting up/testing the tipping bucket.