Can't configure history_stats sensor

Hi guys,

I can’t get my history_stats sensor working. Don’t understand the error message either.

sensor:

appears only once in the file.

my code:

template:
  - sensor:
      - name: workingSensor1
        config...

      - name: workingSensor2
        config

      - platform: history_stats
        name: WaMa_curr_month
        entity_id: input_select.status_waschmaschine
        state: "Waschen"
        type: count
        start: "{{ now().replace(day=1, hour=0, minute=0, second=0 }}"
        end: "{{ now() }}"

Error Message:

Invalid config for ‘template’ at configuration.yaml, line 37: ‘platform’ is an invalid option for ‘template’, check: sensor->2->platform

Thanks in advance…

Best, Thim

it doesn’t go in the template:sensor section, it goes in the sensor section.

template:
  - sensor:
      - name: workingSensor1
        config...

      - name: workingSensor2
        config

sensor:
  - platform: history_stats
    name: WaMa_curr_month
    entity_id: input_select.status_waschmaschine
    state: "Waschen"
    type: count
    start: "{{ now().replace(day=1, hour=0, minute=0, second=0 }}"
    end: "{{ now() }}"
1 Like