Template to convert Dynamic Price to All-in price

I have a dynamic gas/energy provider in the Netherlands. The energy zero integration only shows the supplier purchase rate, but on top of this I pay 21% VAT and a fixed amount environmental tax.

I want the energy dashboard to show my all-in costs, so I think of creating a entity with my all-in price by a template.

I used this code, but I get a error, does someone know what I’ve been doing wrong?

sensor:
  - platform: template
    sensors:
      gasprijs_totaal:
        friendly_name: "Gasprijs leverancier (totaal)"
        unit_of_measurement: "€/m³"
        value_template: >-
          {% set inkoop = states('sensor.energyzero_today_gas_next_hour_price') | float %}
          {{ (((inkoop + 0,08275) * 1,21) + 0,593) }}

The error I get is:

Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token ')', got 'integer') for dictionary value @ data['sensors']['gasprijs_totaal']['value_template']. Got "{% set inkoop = states('sensor.energyzero_today_gas_next_hour_price') | float %} {{ (((inkoop + 0,08275) * 1.21) + 0,593) }}". (See ?, line ?).

Have you tried it with . instead of , for your decimal seperator?

Great, it’s working. Thanks for your answer!