Calculating with Entitys

Hi, i searched a lot in the forum, but didn’t find a solution for my problem, or can’t get it work.

My problem: after around 250h my heating has to be cleaned. Because the heating is in seperate building i want a gauge for showing me, when its time for cleaning.

For that i created a input_button and save the actual value of working-hours.

The next step is my problem… calculating, so that a gauge is showing me the runtime since cleaning…

My working code:

template:

  • trigger:
    • platform: state
      entity_id: input_button.reset_pelletasche
      sensor:
    • name: “letzteLeerungStunden”
      unit_of_measurement: “h”
      state: >
      {{ state_attr(‘sensor.systarest_api_states’ , ‘boilerOperationTimeHours’) }}

Maybe this can help