Create graph using data from entity attribute that is not related to Hass time state (so not history graph)

Probably easier to show the example I want to use. I just installed the “Nordpool” HACS integration (shows electricity prices).

Since these are known for one day in advance, these are listed in the attributes, so the sensor has (among others) the attributes:

today: 1.423, 1.358, 1.345, 1.355, 1.366, 1.366, 1.363, 1.368, 1.429, 1.451, 1.479, 1.474, 1.476, 1.451, 1.452, 1.477, 1.497, 1.766, 1.587, 1.302, 0.977, 0.975, 0.974, 0.837
tomorrow: 0.791, 0.785, 0.746, 0.516, 0.458, 0.471, 0.691, 0.785, 0.904, 1.115, 1.255, 1.356, 1.461, 1.438, 1.44, 1.472, 1.733, 2.076, 2.261, 1.949, 1.442, 1.482, 1.378, 1.346

Where the today and tomorrow attributes show a list of the prices hour for hour. And these are what I’d like to have in a graph.

Well, actually, I’d probably create a new sensor so it has a list of the next 24 hours as an attribute, regardless of when you look at it, but the principle. I’d like a graph that shows the time/hour on the X-axis (but the time is of course not linked to Hass clock, just related to the position in the list in the attribute) and the price from the list of attributes on the Y-axis.

Does anyone know how to do this?

Hi,

I don´t have any answer but instead the same question. (Aso for Nordpool)

Hi, This is the exact same thing I try to achieve, but I am using ‘Frank Energie’. I have the data in a sensor like this (removed most line for readability, but there are 24 or 48 list items, 1 or 2 days with 24 hours in each day):

data:
  marketPricesElectricity:
    - till: '2022-05-18T23:00:00.000Z'
      from: '2022-05-18T22:00:00.000Z'
      marketPrice: 0.197
      priceIncludingMarkup: 0.255
    - till: '2022-05-19T00:00:00.000Z'
      from: '2022-05-18T23:00:00.000Z'
      marketPrice: 0.185
      priceIncludingMarkup: 0.241
    - till: '2022-05-19T01:00:00.000Z'
      from: '2022-05-19T00:00:00.000Z'
      marketPrice: 0.18
      priceIncludingMarkup: 0.235
...
    - till: '2022-05-20T21:00:00.000Z'
      from: '2022-05-20T20:00:00.000Z'
      marketPrice: 0.205
      priceIncludingMarkup: 0.265
    - till: '2022-05-20T22:00:00.000Z'
      from: '2022-05-20T21:00:00.000Z'
      marketPrice: 0.166
      priceIncludingMarkup: 0.218
friendly_name: Smart Electricity

I would like to have a graph with the hours on the X-axis, and the prices on the Y-axis
These hours are not measurement times, not related to the hass time, so no history !!

Is there a way to do this, natively in home assistant, or with grafana?

Any help is greatly appreciated!

Marcel

It doesn’t seem like it’s currently possible, so I’ve made a feature request thread here: Create graph using data from entity attribute that is not related to Hass time state

Please vote for this, if you would find it useful.

Some nice people have made me aware of ApexCharts in this thread. I think that would be useful for you guys as well!

This is the 48 hours of future (and past) electricity prices from the nordpool sensor:

Screenshot 2022-10-04 at 13.14.07

Using the code that @WallyR provided in here.