Is it possible to put value in the “now lable”?
Can somebody help me with the additional costs for the Norpool intergation. I use the ENTSO-e atm and when I use the template for the extra costs from ENTSO-e in Nordpool I get a higher price. I think the integration adds te price.
My template:
{% set s = {
“bijz_accijns”: 0.50329,
“energiebijdrage”: 0.002042,
“kost_gsc”: 0.01166,
“kost_wkk”: 0.00430,
“fluvius”: 0.0459,
“btw”: 1.06,
“marge_procentueel”: 1.038,
“marge_per_kwh”: 0.0393
} %}
{{((((current_price * s.marge_procentueel) + s.marge_per_kwh) + s.bijz_accijns + s.energiebijdrage + s.kost_gsc + s.kost_wkk + s.fluvius) * s.btw) | float}}
I just wanted to share my integration with lovelace. Works also in light mode but colors need to be adjusted.
- type: "custom:apexcharts-card"
graph_span: 1d
span:
start: hour
offset: -4h
experimental:
color_threshold: true
all_series_config:
color_threshold:
- value: -1
color: "#6EFDEF"
- value: 0
color: "#6EFD99"
- value: 10
color: "#FDE86E"
- value: 20
color: "#FD6E6E"
type: column
series:
- entity: sensor.***YOUR NORDPOOL SENSOR***
data_generator: |
return entity.attributes.raw_today.map((entry) => {
return [new Date(entry.start), entry.value];
});
show:
in_header: false
- entity: sensor.***YOUR NORDPOOL SENSOR***
data_generator: |
const now = new Date();
let latestData = entity.attributes.raw_today[0];
entity.attributes.raw_today.forEach(entry => {
const entryDate = new Date(entry.start);
if (entryDate <= now && (!latestData || entryDate > new Date(latestData.start))) {
latestData = entry;
}
});
return [[new Date(latestData.start), latestData.value]];
show:
in_header: true
name_in_header: false
in_chart: false
now:
show: true
label: Now
header:
show: true
title: Electricity Price
show_states: true
This is a good color pallet. The colors are equally spread based on human perception of color differences (with the exception of the first color which was added manually to stand out).
- value: 0
color: '#2085e3'
- value: 0.05
color: '#04822e'
- value: 0.1
color: '#12A141'
- value: 0.15
color: '#79B92C'
- value: 0.2
color: '#C4D81D'
- value: 0.25
color: '#F3DC0C'
- value: 0.3
color: '#F4C616'
- value: 0.35
color: '#EFA51E'
- value: 0.4
color: '#E76821'
- value: 0.5
color: '#E33F20'
- value: 0.6
color: '#DC182F'
This may be a bit old thread but I had great help designing my chart highly customizable ApexChart and wanted to share it back with the community.
Sorry for my lack of HA knowledge here, but suppose I’m not interested in displaying the average price of next 3 hours, but rather just have it available as a numerical value (an Entity?) to be able to use the value to change the color of a light to show the wife (and me) if it’s time to do laundry and run the dishwasher. The color change depending on current price I’ve managed, but the price for next hour I can’t access with my skill-set. It’s better than nothing, but with low price now and very high price the next hour, it misses the point.
Maybe this helps: GitHub - TheFes/cheapest-energy-hours: Jinja macro to find the cheapest energy prices
I’m not using it myself but it looks useful.
I have a variable tariff for extra costs, similar to the example on Github. I am on a time-based tariff, so from April to October it uses the low fare, and on November 1st it starts to switch between the two tariffs. However, I discovered that future prices in the attributes are not calculated correctly.
From what I can tell, it’s using the actual current time when prices are calculated, instead of the time the price actually is for. Kind of hard to explain but here is my template sensor for my additional costs:
{% set s = {
"hourly_fixed_cost": 0.081,
"low_tariff": 0.096,
"high_tariff": 0.56,
"energy_tax": 0.428
}
%}
{% if (now().month >= 4 and now().month < 11) or (now().weekday() >= 5) %}
{{ s.low_tariff + s.hourly_fixed_cost + s.energy_tax | float }}
{% else %}
{% if now().hour >= 6 and now().hour < 22 %}
{{ s.high_tariff + s.hourly_fixed_cost + s.energy_tax | float }}
{% else %}
{{ s.low_tariff + s.hourly_fixed_cost + s.energy_tax | float }}
{% endif %}
{% endif %}
What happens is that if prices are calculated before 22:00, it will always use the high tariff. If I wait until after 22:00, all prices have changed and it’s now always using the low tariff.
I’ve filed a bug report on GitHub but I wanted to know if anyone else is experiencing the same thing, or if I might have missed something basic. It wouldn’t surprise me if this just happens to my install, because as the integration is completely useless without accurate future prices I’d imagine there would be more people complaining if it didn’t work as intended.
I also don’t know if this issue is new. I tried downgrading the Nordpool integration but then the sensor became unavailable and I don’t want to create a complete mess in my home assistant install. Please note that the current version of the Nordpool integration is 0.0.15 but it still says 0.0.14.
it’s using the actual current time when prices are calculated , instead of the time the price actually is for
I have been notified that this behavior is by design. If you want to use additional costs to calculate future prices correctly, it cannot be done through a template sensor, it needs to be done in the integration configuration directly.
I really wish the docs were clearer. For a lot of the integrations.
Anyone had any luck adding the Norwegian government subsidy of only paying 10% of any price above 0.73 NOK?
I’ve got this far through the help of chatGPT but doesn’t work
{% set s = {
"extra_cost": 0.0312,
"winter_night": 0.3028,
"winter_day": 0.4020,
"summer_day": 0.4740,
"summer_night": 0.3722
} %}
{% if current_price > 0.73 %}
{% set subsidy = 0.73 + (current_price - 0.73) * 0.1 %}
{% else %}
{% set subsidy = current_price %}
{% endif %}
{% if now().month >= 4 and now().month < 12 %}
{% if now().hour >= 6 and now().hour < 23 %}
{{ (subsidy + s.summer_day + s.extra_cost) | round(4) }}
{% else %}
{{ (subsidy + s.summer_night + s.extra_cost) | round(4) }}
{% endif %}
{% else %}
{% if now().hour >= 6 and now().hour < 23 %}
{{ (subsidy + s.winter_day + s.extra_cost) | round(4) }}
{% else %}
{{ (subsidy + s.winter_night + s.extra_cost) | round(4) }}
{% endif %}
{% endif %}
create a new nordpool sensor with “Add cost”
Change values in Bold with your own tarifs
{%set hour = now().hour%}
{%set extra = 0.0%}
{%if hour > 21 or hour < 6%}
{%set price = extra + 0.3593 %}
{%else%}
{%set price = extra + 0.5018 %}
{% endif %}
{%set threshold_for_subsidy = 0.9125%}
{%set subsidy = max((current_price-threshold_for_subsidy)*0.9,0)%}
{{(price - subsidy) | round(4)}}