Energy prices graph on external display

I am using and experimenting with esphome and like the endless possibilities.

In my experiments I have now succeeded in displaying some values on an external mini oled display, connected to an esp8266 wifi board.
I am using esphome for this.

My contract for energy has prices per kWh, which change every hour (“dynamic prices”).
I am using the Entso-e integration to get those prices.
This integration has an entity for the current price and an entity for the next-hour-price and I have both values displayed on the external display.

I am Thinking of building an e-ink display to show several Home Assistant values.

The Entso-e integration can also display a graph of the hourly energy prices for today and tomorrow. It is using an ApexChart graph card with these two codes:

Graph card today:

type: custom:apexcharts-card
graph_span: 24h
span:
  start: day
now:
  show: true
  label: Now
header:
  show: true
  title: Stroomprijs vandaag (€/kWh)
series:
  - entity: sensor.anwb_energietarieven_average_electricity_price_today
    stroke_width: 2
    float_precision: 3
    type: column
    opacity: 1
    color: ''
    data_generator: |
      return entity.attributes.prices.map((record, index) => {
        return [record.time, record.price];
      });
yaxis:
  - id: Prijs
    decimals: 2
    min: -0.1
    max: 0.7

Graph card tomorrow:

type: custom:apexcharts-card
graph_span: 24h
span:
  start: day
  offset: +1d
header:
  show: true
  title: Stroomprijs morgen (€/kWh)
series:
  - entity: sensor.anwb_energietarieven_average_electricity_price_today
    stroke_width: 2
    float_precision: 3
    type: column
    opacity: 1
    color: ''
    data_generator: |
      return entity.attributes.prices.map((record, index) => {
        return [record.time, record.price];
      });
yaxis:
  - id: Prijs
    decimals: 2
    min: -0.1
    max: 0.7

Is it possible to get those graphs on the external display through esphome?

Are you happy to use the sensors that already exist in HA, feed these to ESPHome then do any calculations and plot them?

If so then this is reasonably easy, although you may be disappointed with the quality of the graphs on ESPHome.

First create some sensors using the homeassistatnt platform, these can then be used in the display component as values for a graph.

Read about graphs to see what your options are - they are obviously not going to be as comprehensive as ApexCharts.

Thank you! I do understand that the quality may not be great, althouh, if creating a bar graph, this would not be too bad?

The thing is, I do not know how to get the hourly values for the hole day.

The integration has 5 entities:
.
.

anwb entities

.
.
Also, there is one price for the current hour and one for the next hour. These values I managed to show on the display.

But the graph on the lovelace card extracts in some way the price for every hour today and tomorrow, and I do not know how to get those 48 values. If I got those, I think, I will be able to transfer them to the display, using esphome. And the links you gave me will surely help me with that!

In some way, the values are extracted with this line in the lovelace:

data_generator: |
      return entity.attributes.prices.map((record, index) => {
        return [record.time, record.price];
      });

This function is from the entso-e integration I think? But can I use this?
Can you or someone else, help me how to get those values?

Edit:
I have discovered that the price sensorr has the hourly prices withinit (attributes or something??)
So, I presume, I have to get those values from there in some way:

Hi! Were you able to find a solution for this?