since I was searching quite some time and could not find a solution, how to pipe in the data from a service (in my case the tibber price “forecast”) into the apex charts card, here is my solution, that took me around three hours to digg through (it’s what moles do) the ApexChartsCard integration and trying almost thousands of variants of JavaScript code in the browser console:
I also added the state of charge from the home battery storage and the current value of the charging threshold (if price drops below, battery will be charged).
This is just a placeholder for the tibber price sensor, that is named differently on every installation e.g., sensor.electricity_price_examplestreet_123. But this should be the similar for every dynamically priced electricity provider that has some API to get the prices from.
Since the Tibber integration sensor is in €/kWh, it is useful to convert it to ct/kWh with a template or a template helper sensor.
this is great @the78mole - thanks a lot.
I am struggeling to increase the width of the chart.
If I set:
width: 150%
it get’s cut off and doesn’t increase the size of the whole chart.
any hint would be much appriciated.
Thanks a lot Daniel for sharing this card. That helped me displaying the prices in my frontend.
But I have a question: What are the input_number entities for and how did you made them?
Hi Benny,
that is really simple. Go to Home Assistants Settings → Devices → Helper and create a new Input Number (e.g. a slider). Hope you can map it to the English version of Home Assistant, because mine is “unfortunately” in German.
Hi Daniel.
I’m German too, so I really appreciate your screenshots, because I can see directly what it is and where it is.
Thanks for the explanation. Am I understanding that correctly, that you set the entity: input_number.batterie_ladepreis as a static value to see, where it is good to load the battery by grid power?
Exactly, I define prices for charging and discharging. I only have a small battery and only a tiny solar (2 x 420W + 2 x 370 W) compared to the power the house needs. So I mostly use power from the grid, but I use the battery to take advantage on low (and high) prices. I also shut down my heat pump, when the price is very high, while I adjust the target-temperatures also to the electricity price. (15 ct / kWh → +5°C, 30 ct/kWh → -5 °C).
In my previous Home Automation (OpenHAB) I was also able to highlight the actual prices in the next 24 hours during which I could best charge my car (or battery in your case) so I could easily determine that minimum charge price to fully charge the car…
So for instance:
My car charges approx 10% in 45 minutes. If my SoC is 50% and I want to charge it to 90%, it would take 3 hours to charge the car. The system would then highlight the 3 cheapest hours in the period after now (till midnight if the next day prices were not yet available or even till midnight next day if they were). I’d either set that minimum price, or start charging at the highlighted periods… Will still need to figure out how to do that with HASS…