- platform: template
  sensors:
    dishwasher_remaining_minutes:
      friendly_name: "Opvask tid tilbage"
      unit_of_measurement: "min"
      value_template: >
        {% set val = states('sensor.dishwasher_remaining_time_2') %}

        {% if val in ['unknown','unavailable',''] %}
          0

        {% elif ':' in val %}
          {% set parts = val.split(':') %}
          {{ (parts[0] | int * 60) + (parts[1] | int) }}

        {% elif 'min' in val %}
          {{ val.replace('min','') | int }}

        {% else %}
          {{ val | int(0) }}
        {% endif %}
