Netatmo rain gauge - get yesterday / day before vaule

Netatmo rain gauge resets it’s value at midnight. Do you have any solution how to get the yesterday or day before data?

For yesterday I am thinking about automation 23:59 log the state of sensor.netatmo_netino_raino_sum_rain_24 into input number.

Or do you know a better solution?

This is exactly what I did for my irrigation system. Just before the midnight I copy actual rain sensor values to input number and just before starting irrigation cycle I add current value to see what was accumulated rain ‘past day’. I found no better way, but this doing the job quite well…
Same approach could be applied to day before - copy last day rain value to anothe input_value just before making previous step.

Have you tried the history stats sensor? https://www.home-assistant.io/integrations/history_stats/

What should I write as a state variable? For this sensor state is number of mm of rain.

True. Sorry that was misleading.

I ended up creating 2 input_number and made this automation. It’s working :slight_smile:

##Input Number

yesterday_rain:
  name: Yesterday Rain Fall
  min: 0
  max: 200
  unit_of_measurement: "mm"
  mode: box
  icon: mdi:water
2_days_rain:
  name: 2 days Before Rain Fall
  min: 0
  max: 200
  unit_of_measurement: "mm"
  mode: box
  icon: mdi:water

##Automation

- id: '1592640784036'
  alias: Log - rainfall
  description: ''
  trigger:
  - at: '23:59'
    platform: time
  condition: []
  action:
  - data_template:
      entity_id: input_number.2_days_rain
      value: '{{states.input_number.yesterday_rain.state}}'
    service: input_number.set_value
  - delay: 00:00:01
  - data_template:
      entity_id: input_number.yesterday_rain
      value: '{{states.sensor.netatmo_netino_raino_sum_rain_24.state}}'
    service: input_number.set_value
3 Likes

What I was actually thinking of was https://www.home-assistant.io/integrations/statistics/

But your solution looks fine to me.