fixer
June 19, 2020, 11:05am
1
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?
mirekmal
(Mirek Malinowski)
June 19, 2020, 4:47pm
2
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.
cgtobi
(Tobi)
June 20, 2020, 5:47am
3
fixer
June 20, 2020, 7:03am
4
What should I write as a state variable? For this sensor state is number of mm of rain.
cgtobi
(Tobi)
June 20, 2020, 7:23am
5
True. Sorry that was misleading.
fixer
June 20, 2020, 8:37am
6
I ended up creating 2 input_number and made this automation. It’s working
##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
cgtobi
(Tobi)
June 20, 2020, 9:31am
7
What I was actually thinking of was https://www.home-assistant.io/integrations/statistics/
But your solution looks fine to me.