Skip to content

Commit

Permalink
JonasPed#51: Added VAT to template sensor example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rune A. Juel Mønnike committed Oct 10, 2022
1 parent d547fa0 commit d2e054e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ template:
{% if state_attr('sensor.eloverblik_tariff_sum', 'hourly') and state_attr('sensor.nordpool', 'today') %}
{% set ns = namespace (prices=[]) %}
{% for h in range(24) %}
{% set ns.prices = ns.prices + [(float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'today')[h])) | round(5)] %}
{% set ns.prices = ns.prices + [(1.25 * float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'today')[h])) | round(5)] %}
{% endfor %}
{{ ns.prices }}
{% endif %}
tomorrow: >
{% if state_attr('sensor.eloverblik_tariff_sum', 'hourly') and state_attr('sensor.nordpool', 'tomorrow') %}
{% set ns = namespace (prices=[]) %}
{% for h in range(24) %}
{% set ns.prices = ns.prices + [(float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'tomorrow')[h])) | round(5)] %}
{% set ns.prices = ns.prices + [(1.25 * float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'tomorrow')[h])) | round(5)] %}
{% endfor %}
{{ ns.prices }}
{% endif %}
Expand Down

0 comments on commit d2e054e

Please sign in to comment.