I’m in the process of moving from the custom component for Nordpool to the new core integration. Besides having issues displaying today and tomorrow’s price on a chart (see here), I’m also trying to follow the examples form the official doc.
When testing “tomorrow’s lowest price” in the template editor, I get
‘tomorrow_price’ is undefined
I used the exact same code as the Example, just changed my config_entry and SE3 to SE4.
template:
- trigger:
- trigger: time_pattern
minutes: /10
- trigger: homeassistant
event: start
action:
- action: nordpool.get_prices_for_date
data:
config_entry: 01JHZHJ9EMYV8JA28490CH5GEE
date: "{{ now().date() + timedelta(days=1) }}"
areas: SE4
currency: SEK
response_variable: tomorrow_price
sensor:
- name: Tomorrow lowest price
unique_id: se4_tomorrow_low_price
state: >
{% if not tomorrow_price %}
unavailable
{% else %}
{% set data = namespace(prices=[]) %}
{% for state in tomorrow_price['SE4'] %}
{% set data.prices = data.prices + [(state.price / 1000)] %}
{% endfor %}
{{min(data.prices)}}
{% endif %}
attributes:
data: >
{% if not tomorrow_price %}
[]
{% else %}
{% set data = namespace(prices=[]) %}
{% for state in tomorrow_price['SE4'] %}
{% set data.prices = data.prices + [{'start':state.start, 'end':state.end, 'price': state.price/1000}] %}
{% endfor %}
{{data.prices}}
{% endif %}
Anything I do wrong? Or is this a bug with the integration?
I didn’t find any information on the actions available with the integration (e.g. get_prices_for_date), where are these documented?