Script for daystart value - Iungo MQTT

I am using the following to get the MQTT sensors from the EMS (Iungo) that I have. After a calculation I use the sensors in the energy dashboard. Is it possible to use a script and make this easier?

mqtt:
  sensor:
    - name: Totaal verbruik laagtarief
      unique_id: Totaal verbruik laagtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/T1
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Totaal verbruik hoogtarief
      unique_id: Totaal verbruik hoogtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/T2
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Totale teruglevering laagtarief
      unique_id: Totale teruglevering laagtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/-T1
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Totale teruglevering hoogtarief
      unique_id: Totale teruglevering hoogtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/-T2
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Dagstartwaarde laagtarief
      unique_id: Dagstartwaarde laagtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/T1_daystart
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Dagstartwaarde hoogtarief
      unique_id: Dagstartwaarde hoogtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/T2_daystart
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Dagstartwaarde teruglevering laagtarief
      unique_id: Dagstartwaarde teruglevering laagtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/-T1_daystart
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"
    - name: Dagstartwaarde teruglevering hoogtarief
      unique_id: Dagstartwaarde teruglevering hoogtarief
      state_topic: 78:DD:D6:42:64:12/energy-dsmr4/538d72d9/-T2_daystart
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      value_template: "{{ value | round(2) }}"

template:
  - sensor:
      - name: Actuele verbruik laagtarief
        unique_id: Actuele verbruik laagtarief
        state: "{{ (states('sensor.totaal_verbruik_laagtarief')|float - states('sensor.dagstartwaarde_laagtarief')|float) | round(2) }}"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
  - sensor:
      - name: Actuele verbruik hoogtarief
        unique_id: Actuele verbruik hoogtarief
        state: "{{ (states('sensor.totaal_verbruik_hoogtarief')|float - states('sensor.dagstartwaarde_hoogtarief')|float) | round(2) }}"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
  - sensor:
      - name: Actuele teruglevering laagtarief
        unique_id: Actuele teruglevering laagtarief
        state: "{{ (states('sensor.totale_teruglevering_laagtarief')|float - states('sensor.dagstartwaarde_teruglevering_laagtarief')|float) | round(2) }}"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
  - sensor:
      - name: Actuele teruglevering hoogtarief
        unique_id: Actuele teruglevering hoogtarief
        state: "{{ (states('sensor.totale_teruglevering_hoogtarief')|float - states('sensor.dagstartwaarde_teruglevering_hoogtarief')|float) | round(2) }}"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh