How to get heating data from TADO

Hi guys,
I have some troubles to gain heating data from my Tado. I want to know how many times the Tado Heating is activated in one room and for how many minutes or hours.
I’m trying to use the history stats of one sensor (sensor.tado_bagno_heating, when the value is over 1%) but I probably lost “something”.
This is what I putted into configuration.yaml with a lot of errors

  • platform: history_stats
    name: Tado bagno durata
    entity_id: sensor.tado_bagno_heating
    value: ‘{{ states.sensor.tado_bagno_heating.attributes)| > 1 }}’
    type: time
    start: “{{ now().replace(hour=0, minute=0, second=0) }}”
    end: “{{ now() }}”
  • platform: history_stats
    name: Tado bagno numero attivazioni
    entity_id: sensor.tado_bagno_heating
    value: ‘{{ states.sensor.tado_bagno_heating.attributes)| > 1 }}’
    type: count
    start: “{{ now().replace(hour=0, minute=0, second=0) }}”
    end: “{{ now() }}”

I noticed that the value of this sensor is MEASUREMENT.
Could someone help me?

In future please format your pasted config correctly https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

There are problems with your configuration. There is no value: option listed here:

And the state: option does not support templates.

Thank you. I’m so sorry but it is the first time I used this forum.
So, should I remove the value line?

Yes. You should click the history stats integration documentation I linked to above and only use the options it specifies. You can’t just make up your own options.