WTH is there no option to graph data that is not related to state histoy?

Certain entities give you “future data”, often inn the attributes.

This could be weather forecast, but also things like future electricity prices in the Nordpool sensor.

WTH can you not graph data from an entity attribute in a way that does not relate to state history?

The answer there is that attributes will become largely obsolete, since each would become their own entity (that sounds great for many things, but pretty awful for something like the nordpool sensor or weather forecasts. It would really clutter the states and make it difficult to find what you’re looking for with searches, since you’ll have 48 almost identical entities).

If that’s what will happen, then my WTH question would change, but still not be covered by that topic.

Instead it would be about making a graph by combining data from several (24-48 in my case) different entities into one graph, where each state represents a point on the same curve? Still not related to time/history, but where each entity should be a value/point on the X-axis, and each state should be a point on the Y-axis.

Install the Apexchart Card from HACS and then make a card with this YAML code.

type: custom:apexcharts-card
header:
  show: true
  title: Nordpool Price -> 48 hours
  show_states: false
graph_span: 2d
now:
  show: true
  color: red
span:
  start: day
series:
  - entity: sensor.nordpool_kwh_dk2_dkk_4_10_025
    name: Today
    data_generator: |
      return entity.attributes.raw_today.map((entry) => {
        return [new Date(entry.start), entry.value];
      });
    type: column
    show:
      legend_value: false
      in_header: false
  - entity: sensor.nordpool_kwh_dk2_dkk_4_10_025
    name: Tomorrow
    data_generator: |
      return entity.attributes.raw_tomorrow.map((entry) => {
        return [new Date(entry.start), entry.value];
      });
    type: column
    show:
      legend_value: false
      in_header: false
1 Like

Very nice, thanks a lot!! I’ll need to do a bit of tweaking, but it certainly looks like it can do the trick.

I’m also using Apexchart in order to plot future prices for Tibber electricity.