Stove working time showed in a card

Hello everyone, I am looking to track my pellet consumption for my stove and I would like to be able to display the cumulative heating time over a 24-hour period in a card.

The entity in question is called

sensor.nobis_status

with Raw Values ​​varying from 1 to 8 knowing that 3 corresponds to WORK.

Can you help me get the result I’m looking for? thanks in advance

Hi @Daarz,

you can create a template sensor, that calculates, if your stove is on or off.

Go to Settings → Devices → Helpers → create a new template sensor.

You could use something like this:

{% if states('sensor.nobis_status') | float = 3}
          on
        {% else %}
          off
        {% endif %} 

Go to Developer Tools → Template to test the code, before you create your template sensor.

Chris

That template can be simplified to:

{{ is_state('sensor.nobis_status', '3')  }}

However it is not needed you can use the history stats integration with your sensor directly

sensor:
  - platform: history_stats
    name: Stove on today
    entity_id: sensor.nobis_status
    state: "3"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"
1 Like