Skip to content

Instantly share code, notes, and snippets.

@JBoye
Created January 6, 2022 15:08
Show Gist options
  • Save JBoye/32739baff7807cbc8611af1ee610e468 to your computer and use it in GitHub Desktop.
Save JBoye/32739baff7807cbc8611af1ee610e468 to your computer and use it in GitHub Desktop.
Din EL/Vindstød additional_cost
{% set nettarif_c_time_lavlast = 0.1315 %}
{% set nettarif_c_time_spidslast = 0.425 %}
{% set additional_cost = {
"trans_nettarif": 0.06125,
"systemtarif": 0.07625,
"balancetarif_forbrug": 0.002875,
"pso_tarif": 0.00,
"elafgift": 1.12875,
"abonnement_net": 0.00 / 730,
"eltillaeg_ellev": 0.00,
"abonnement_ellev": 0.00 / 730
} %}
{% set ns = namespace(total = nettarif_c_time_spidslast if (now().month < 4 or now().month >= 10) and (now().hour >= 17 and now().hour < 20) else nettarif_c_time_lavlast) %}
{% for i in additional_cost %}{% set ns.total = ns.total + additional_cost[i] %}{%endfor%}
{{ ns.total }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment