Advertisement
yurghie

Untitled

Apr 18th, 2024 (edited)
959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.59 KB | None | 0 0
  1. sensor:
  2.   - platform: nordpool
  3.     VAT: true
  4.     currency: "NOK"
  5.     price_in_cents: false
  6.     low_price_cutoff: 0.95
  7.     region: "Kr.sand"
  8.     precision: 4
  9.     price_type: kWh
  10.     additional_costs: >-
  11.       {% set s = {
  12.         "paaslag": 0.00,
  13.         "nettleie_natt": 0.38,
  14.         "nettleie_dag": 0.50
  15.       }%}
  16.       {% set add_cost = 0.9 * (current_price - 0.9125) * -1 if current_price > 0.9125 else 0 %}
  17.       {% set add_cost = s.paaslag + add_cost + s.nettleie_dag if now().hour >=6 and now().hour < 22 else s.paaslag + add_cost + s.nettleie_natt %}
  18.       {{add_cost | float(3) }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement