Advertisement
Skeem

sensor.yaml

May 14th, 2022
1,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.89 KB | None | 0 0
  1. -   platform: template
  2.     sensors:
  3.       elpris_tomorrow_available:
  4.         friendly_name: "Elpris tomorrow available"
  5.         #AGR - Indsæt din nordpool sensor her for at vide om morgendagens priser er tilgængelige
  6.         value_template: "{{ state_attr('sensor.nordpool_kwh_dk2_dkk_3_095_025', 'tomorrow_valid') }}"
  7.  
  8.  
  9. -   platform: nordpool
  10.  
  11.     # Should the prices include vat? Default True
  12.     VAT: True
  13.  
  14.     # What currency the api fetches the prices in
  15.     # this is only need if you want a sensor in a non local currecy
  16.     currency: "DKK"
  17.  
  18.     # Helper so you can set your "low" price
  19.     # low_price = hour_price < average * low_price_cutoff
  20.     low_price_cutoff: 0.95
  21.  
  22.     # What power regions your are interested in.
  23.     # Possible values: "DK1", "DK2", "FI", "LT", "LV", "Oslo", "Kr.sand", "Bergen", "Molde", "Tr.heim", "Tromsø", "SE1", "SE2", "SE3","SE4", "SYS", "EE"
  24.     region: "DK2"
  25.  
  26.     # How many decimals to use in the display of the price
  27.     precision: 3
  28.  
  29.     # What the price should be displayed in default
  30.     # Possible values: MWh, kWh and Wh
  31.     # default: kWh
  32.     price_type: kWh
  33.  
  34.     # This option allows the usage of a template to add a tariff.
  35.     # now() always refers start of the hour of that price.
  36.     # this way we can calculate the correct costs add that to graphs etc.
  37.     # The price result of the additional_costs template expects this additional cost to be in kWh and not cents as a float
  38.     # default {{0.0|float}}
  39.     additional_costs: '{% set s = {
  40.         "elafgift": 1.125,
  41.         "transport_lavlast": 0.2954,
  42.         "transport_spidslast": 0.7884,
  43.         "abonnement": 0.14
  44.         } %}
  45.         {% if now().month >= 10 or now().month <4 %}
  46.           {% if now().hour >=17 and now().hour <21 %}
  47.             {{s.elafgift+s.transport_spidslast+s.abonnement}}
  48.           {% else %}
  49.             {{s.elafgift+s.transport_lavlast+s.abonnement}}
  50.           {% endif %}
  51.         {% else %}
  52.           {{s.elafgift+s.transport_lavlast+s.abonnement}}
  53.         {% endif %}'
  54.  
  55. - platform: template
  56.   sensors:
  57.     powerprice_rt:
  58.       friendly_name: Strøm realtid
  59.       icon_template: mdi:home-lightning-bolt
  60.       value_template: >-
  61.         {% set pris = states['sensor.nordpool_kwh_dk2_dkk_3_095_025'].attributes.current_price %}
  62.         {% set kwh = states.sensor.electricity_meter.state | float %}
  63.         {{((pris*kwh*100) | int)/100}}
  64.  
  65.  
  66. - platform: template
  67.   sensors:
  68.     powerprice_hourly:
  69.       friendly_name: 'Strømudgift, time'
  70.       device_class: energy
  71.       unit_of_measurement: Kr
  72.       value_template: >-
  73.         {% if is_number(states('sensor.power_hourly'))  %}
  74.           {{ (states('sensor.power_hourly') | float) / 1000 * states['sensor.nordpool_kwh_dk2_dkk_3_095_025'].attributes.current_price }}
  75.         {% else %}
  76.           None
  77.         {% endif %}
  78.  
  79. - platform: template
  80.   sensors:
  81.     energy_hourly:
  82.       friendly_name: 'Strømforbrug, time'
  83.       device_class: energy
  84.       unit_of_measurement: kWh
  85.       value_template: >-
  86.         {% if is_number(states('sensor.power_hourly'))  %}
  87.           {{ (states('sensor.power_hourly') | float) / 1000 }}
  88.         {% else %}
  89.           None
  90.         {% endif %}
  91.  
  92. - platform: template
  93.   sensors:
  94.     energy_daily:
  95.       friendly_name: 'Strømforbrug, dag'
  96.       device_class: energy
  97.       unit_of_measurement: kWh
  98.       value_template: >-
  99.         {% if is_number(states('sensor.power_daily'))  %}
  100.           {{ (states('sensor.power_daily') | float) / 1000 }}
  101.         {% else %}
  102.           None
  103.         {% endif %}
  104.  
  105. - platform: template
  106.   sensors:
  107.     energy_monthly:
  108.       friendly_name: 'Strømforbrug, måned'
  109.       device_class: energy
  110.       unit_of_measurement: kWh
  111.       value_template: >-
  112.         {% if is_number(states('sensor.power_monthly'))  %}
  113.           {{ (states('sensor.power_monthly') | float) / 1000 }}
  114.         {% else %}
  115.           None
  116.         {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement