#Stats for month

1 messages · Page 1 of 1 (latest)

molten zodiac
#
  - platform: statistics
    name: "Outdoor Maximum Temperature over last 24 hours"
    entity_id: sensor.esps2_living_room_temperature
    state_characteristic: value_max
    max_age:
      hours: 24
  - platform: statistics
    name: "Outdoor Minimum Temperature over last 24 hours"
    entity_id: sensor.esps2_living_room_temperature
    state_characteristic: value_min
    max_age:
      hours: 24
  - platform: statistics
    name: "Outdoor Minimum Temperature over 1 month"
    entity_id: sensor.esps2_living_room_temperature
    state_characteristic: value_min
    max_age:
      month: 1
  - platform: statistics
    name: "Outdoor Maximum Temperature over 1 month"
    entity_id: sensor.esps2_living_room_temperature
    state_characteristic: value_max
    max_age:
      month: 1    
```
#

24 hour sensors are working fin 1month are showing up

#
Invalid config for 'statistics' from integration 'sensor' at configuration.yaml, line 161: 'month' is an invalid option for 'sensor.statistics', check: max_age->month```
#

now how to use month?

#

Stats for month

soft sable
#

Try converting month to hours. I was just checking if month is supported and I don't think it is.

molten zodiac
#

30days are 720 hours

soft sable
#

So, try hours: 720.

molten zodiac
#

yes it worked

soft sable
#

Ok, now, here's one wrinkle. The statistics integration doesn't use long term statistics, so you'll want to make sure your recorder integration is setup to track data for that long.

solar kelpBOT
soft sable
#

In your recorder settings.

molten zodiac
soft sable
#

Yup. But depending on how long you are storing recorder entries, that number may or may not be accurate. Recorder only keeps 10 days of data by default. So, at most, you are getting 24 hours and 240 hours, not 720.

molten zodiac
#

now need to adjust the recorder for 30days

soft sable
#

Yup

#

Excatly.

#

But, just know that will increase your database size (if you're concerned about disk space or whatnot).

molten zodiac
#

256Gb SSD should be enough for 30 days

soft sable