Avarage sensor Now (). month

Hi, I want to have a average sensor from the last month temperature.

For example, today it is 2 oktober. i want the average of temperature the last 2 days
On the 29st of oktober I want the average of the last 29 days.

I have this for now:

- platform: average
  name: 'Buiten temperatuur gemiddeld afgelopen maand V3'
  start: '{{ now().month }}'
  duration:
    days: 30
  entities:
    - sensor.buiten_temperatuur

My result: the average temp. between :
start: 1970-01-01T01:00:10+01:00
end: 1970-01-03T01:00:10+01:00
:slight_smile:

  start: '{{ today_at().replace(day=1) }}'

If you want the average of the last 30 days of recorded data for sensor.buiten_temperatuur you must ensure Home Assistant’s recorder is configured to store at least thirty days of data. By default, it only stores ten days of data.

Be advised that if you increase it to 30 days, it will store thirty days worth of data for all entities in your system unless you include/exclude entities using recorder’s options.

Thanks, this works for me.

1 Like