History over 7 days can't get my head round it

I have this

Happy camper
so i added
MIN MAX

#=======================================================================
#
#=======================================================================
- platform: min_max
  name: tank temperature max
  type: max
  entity_ids:
    - sensor.feeder_ds18b20_temperature
    - sensor.tank_temperature_max
#=======================================================================
#
#=======================================================================

- platform: min_max
  name: tank temperature min
  type: min
  entity_ids:
    - sensor.feeder_ds18b20_temperature
    - sensor.tank_temperature_min
#=======================================================================
#
#=======================================================================

image

Now I want the MIN/MAX for the last 7 days

so I thought this would work

- platform: history_stats
  name: feeder max last 7
  entity_id: sensor.tank_temperature_max
  type: time
  state: '°C'
  start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  end: "{{ now() }}"
  duration:
    days: 7

- platform: history_stats
  name: feeder min last 7
  entity_id: sensor.tank_temperature_min
  state: '°C'
  type: time
  start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  end: "{{ now() }}"
  duration:
    days: 7

BUT I GETTING THIS ERROR

Invalid config for [sensor.history_stats]: You must provide exactly 2 of the following: start, end, duration. Got OrderedDict([('platform', 'history_stats'), ('name', 'feeder max last 7'), ('entity_id', 'sensor.tank_temperature_max'), ('type', 'time'), ('state', '°C'), ('start', '{{ now().replace(hour=0, minute=0, second=0) }}'), ('end', '{{ now() }}'), ('duration', OrderedDict([('days', 7)]))]). (See ?, line ?).
Invalid config for [sensor.history_stats]: You must provide exactly 2 of the following: start, end, duration. Got OrderedDict([('platform', 'history_stats'), ('name', 'feeder min last 7'), ('entity_id', 'sensor.tank_temperature_min'), ('state', '°C'), ('type', 'time'), ('start', '{{ now().replace(hour=0, minute=0, second=0) }}'), ('end', '{{ now() }}'), ('duration', OrderedDict([('days', 7)]))]). (See ?, line ?).

what am i missing :frowning:

think it something to do with the state but I dont know what to put there.

The error says: You must provide exactly 2 of the following: start, end, duration

You have provided all three. This is not “exactly 2”. You must delete one of them.

For the last 7 days all you need is this (delete the start:)

end: "{{ now() }}"
duration:
  days: 7

see what a other pair of eyes do

thanks bro