faspina
(Frank Spina)
April 4, 2017, 8:47pm
1
Hi,
I currently use sensor.pws_precip_today_in.
So yesterday we had 2.5 inches, today its sunny. I would like to combine a weeks *y days) worth of this sensor to one sensors that shows me the accumulated rainfall over the past 7 days and use that to control the sprinker automateion.
I currently have history turned on and utlize the MySQL for storage.
Any ideas on how to do this.
Check out the history statistics sensor. This might do what you are looking for.
faspina
(Frank Spina)
April 4, 2017, 8:56pm
3
I don’t see a sum .
type (Optional): The type of sensor: time, ratio, or count. Defaults to time
Am I missing something.
Yes, I just double checked, maybe it is the statistc sensor. This does a total. Not sure about the 7 day window.
Edit: adjusting the sampling size might give you the 7day window.
faspina
(Frank Spina)
April 5, 2017, 12:24am
5
This might work. If the Weather underground updates every 5 minutes that 288 a day. I can get the MAX for 288 updates and then another static to add the last 7 of those up. I will give it a shot.
Marius
(Marius)
June 10, 2017, 9:32am
6
Did you find a solution for this, @faspina ?
I have a tipping bucket connected to HA via ESPEasy/mqtt and want to see statistics for last day, last 7 days, last month, so far this year, etc.
1 Like
faspina
(Frank Spina)
August 16, 2017, 7:23pm
7
I have not found a solution. I am about to buy a weather kit with a rain bucket so I really would like to get a last 7 day rain fall total.
beed2112
(mike)
August 17, 2017, 5:48am
8
Here is what i found, seems to work for me - you need to have your logger purge set long enuff.
- platform: history_stats
name: BR Ceiling Fan ON **today**
entity_id: switch.br_ceiling_fan
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: BR Ceiling Fan ON **Last 7**
entity_id: switch.br_ceiling_fan
state: 'on'
type: time
end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
duration:
days: 7
- platform: history_stats
name: BR Switch ON **Last 30**
entity_id: switch.br_switch
state: 'on'
type: time
end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
duration:
days: 30
phileep
(Phil)
August 18, 2017, 12:00am
9
Have a look at how I keep 24 hour rainfall - you could extend it to keep rolling multiple days. I might even do that myself!
I have an RF weather sensor that gives me cumulative rainfall via MQTT since it was powered on.
I want to see the rainfall since midnight, so I use the following to store the rain to midnight yesterday as a reference value in mqtt (to ensure it survives any HASS restarts etc):
sensor:
# Rain is cumulative forever - collect it and subtract yesterday for todays rain
- platform: mqtt
state_topic: 'RF/DKW2012-ID=004c'
name: 'rain_cum'
icon: mdi:weather-rainy
unit_of_measureme…