-
-
Save klaasnicolaas/ccfd1cd3da62a13b3199ff378480bdbb to your computer and use it in GitHub Desktop.
- type: custom:apexcharts-card | |
graph_span: 1d | |
header: | |
show: true | |
title: Electriciteitsprijzen Vandaag (€/kwh) | |
span: | |
start: day | |
now: | |
show: true | |
label: Now | |
yaxis: | |
- id: price | |
decimals: 2 | |
apex_config: | |
tickAmount: 5 | |
series: | |
- entity: sensor.energy_prices_today | |
name: Price this hour | |
yaxis_id: price | |
data_generator: | | |
return entity.attributes.prices.map((entry) => { | |
return [new Date(entry.timestamp).getTime(), entry.price]; | |
}); | |
type: column | |
show: | |
extremas: true | |
opacity: 0.8 | |
float_precision: 2 |
--- | |
# Today - Hourly energy prices | |
template: | |
- trigger: | |
- platform: homeassistant | |
event: start | |
- platform: time_pattern | |
hours: "*" | |
action: | |
- service: energyzero.get_energy_prices | |
response_variable: response | |
data: | |
config_entry: PUT_HERE_YOURS | |
incl_vat: True | |
sensor: | |
- name: Energy prices - Today | |
device_class: timestamp | |
state: "{{ now() }}" | |
attributes: | |
prices: '{{ response.prices }}' | |
# Tomorrow - Hourly energy prices | |
- trigger: | |
- platform: homeassistant | |
event: start | |
- platform: template | |
value_template: "{{ now() > today_at('14:00') and now().minute == 0 }}" | |
action: | |
- service: energyzero.get_energy_prices | |
response_variable: response | |
data: | |
config_entry: PUT_HERE_YOURS | |
start: "{{ now() + timedelta(days=1) }}" | |
end: "{{ now() + timedelta(days=1) }}" | |
incl_vat: True | |
sensor: | |
- name: Energy prices - Tomorrow | |
device_class: timestamp | |
state: "{{ now() + timedelta(days=1) }}" | |
attributes: | |
prices: '{{ response.prices }}' |
@klaasnicolaas can you please share where to go add that entities i have anwb for energy.
I live in holland/dutch/netherland
@GofranAy in your configuration.yaml
?
@klaasnicolaas i am sorry do you mean i need to add.
hourly_price_charts.yaml and price_template_sensors.yaml
So just copy paste in to configuration.yaml.
Only the YAML of price_template_sensors.yaml to get the 2 trigger template sensors in Home Assistant. You use the apex code snippet where you created your dashboard in YAML.
Side note: everyone uses YAML differently in their Home Assistant instance, without context (how you organize your config) it's impossible to give advice on where to put the code snippets and I assume that people know where you should place these.
Didn't work: defining the template sensor under Settings > Devices & Services > Helpers
Keep getting error "response is undefined"
What works: copy/pasting the template sensor code into configuration.yaml
@GofranAy You have only copied the apexcharts code, but without the template sensors (which retrieve the data) you will not get the correct entities.
./Klaas