Skip to content

Instantly share code, notes, and snippets.

@JBoye
Last active October 26, 2022 18:41
Show Gist options
  • Save JBoye/09af58dc09f9e0ffe893964ff291bfd4 to your computer and use it in GitHub Desktop.
Save JBoye/09af58dc09f9e0ffe893964ff291bfd4 to your computer and use it in GitHub Desktop.
Energi Data Service Template
{# Find lavlast, spidslast og evt. fortjeneste/tillæg på elspotpris.dk #}
{% set lavlast = 0.13976 %}
{% if (now().month < 3 or now().month >= 10) %}
{# vinter takst #}
{% set hojlast = 0.4192 %}
{% set spidslast = 1.2576 %}
{% else %}
{# sommer takst #}
{% set hojlast = 0.2096 %}
{% set spidslast = 0.54496 %}
{% endif %}
{% set tillaeg = 0 %}
{% set afgift = 0.723 if now().year == 2022 else 0.008 %}
{% set tariffer = [0.00229, 0.061, 0.049] | sum %}
{{[tariffer, tillaeg, afgift, (lavlast if now().hour <= 6 else spidslast if now().hour >= 17 and now().hour <= 20 else hojlast)] | sum}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment