Anyone using the Sankey Chart Card?

Thank you for your suggestions and explanations, now everything works with the new version and I did it now with passthrough,

Do I understand correctly I can’t use this same way as default energy dashboard for daily usage, but I would somehow need to make daily consumption entity for everything?

I guess helper - utility meter would work for the entities.

Correct. Though looking into the energy-devices-graph card’s code, it should be possible to integrate with the energy dashboard in the future

1 Like

Got excited about Energy Dashboard integration and implemented it. Just released in v1.2.0
It is a bit hacky as HA doesn’t expose these functions nicely so beware of bugs.

You still need to specify your entities and connections but now you can use the general kWh entities that you have in the energy dashboard and filter by date with the energy-date-selection card.

3 Likes

I do not understand how it should work…
This is with the helper entities:

type: custom:sankey-chart
show_names: true
round: 1
unit_prefix: k
energy-date-selection: true
sections:
  - entities:
      - entity_id: sensor.l1_daily
      - entity_id: sensor.l2_daily
      - entity_id: sensor.l3_daily
  - entities:
      - entity_id: sensor.ac_dilna_daily
      - entity_id: sensor.ac_loznice_daily
      - entity_id: sensor.ac_obyvak_daily
      - entity_id: sensor.bojler_2
      - entity_id: sensor.tv_daily
      - entity_id: sensor.xbox_daily

this one is with the entities shown in energy dashboard

type: custom:sankey-chart
show_names: true
round: 1
unit_prefix: k
energy-date-selection: true
sections:
  - entities:
      - entity_id: sensor.l1
      - entity_id: sensor.l2

Neither changes when i change the day. And clearly the L1 and L2 is not filtered by the they but it shows total measured for values.

Also noted that there is different values in energy dashboard and what heleper entities show, but probably those are calculted in some interval.

Use energy_date_selection not energy-date-selection . Guess that naming was a mistake but too late now :smiley:

3 Likes

Witchcraft, now it works, even for the entities that are NOT in energy dashboard (at least most of them). :heart:

works very good (data not real as I created new renamed entities for the energy dashboard), but it aggregates by the week, and is able to browse days without creating the helpers and even data seems to be more accurate then from the helpers.

Great work!

Cool!
Is there a way to sum using remaining_child_state and remaining_parent_state?

For the current power usage, I’m already doing this through some template sensors which I then exclude from the recorder (to keep the DB size down).
I would prefer not to keep aggregated statistics though.

I’m currently getting a “Too much recursion” error when I attempt to configure this.

Not currently. There is a feature request on GitHub about this.

1 Like

Anyone know if we can use the low carbon energy values in here as well? Are they accessible in some way to split up the total energy?
Depending on the energy_date_selection, the percentage to split can be quite different for a day, month, … and the built-in energy dashboard does show these values correctly.

I don’t see how this would be possible currently.

I see these entities sensor.co2_intensity & sensor.grid_fossil_fuel_percentage but they won’t give you kWh of low carbon energy. The energy-distribution card from the energy dashoard probably calculates the average sensor.grid_fossil_fuel_percentage for the given day/month/year and applies it to the grid total kWh. This would be way out of scope for the sankey card. Maybe if HA improves the API in the future.

For now better to just display a sensor.grid_fossil_fuel_percentage card next to the chart.

Yes, for sure, calculation is not the purpose of this card. I thought that maybe we could pull the pre-calculated data from the same source the energy values are taken from. But if I understand correctly, there is no API (yet).

Actually I could get the carbon data for the current period and do the same calculation. It is just not trivial. Feel free to add a feature request in github and I might get to it some day. No promises though.

done :slight_smile: thank you!

I’m having trouble getting this to work on my energy dashboard: I’m not sure what to do. The documentation is pretty sparse, and I don’t think I’ve seen any examples integrating into the existing energy dashboard functionality. How do I go about adding this card, and putting my total daily consumption on the left? I can’t find an entity for that number – it seems to be internal to the Energy integration.

An example would be amazing!

2 Likes

There isn’t a general Consumed Energy sensor AFAIK. Ha calculates it based on all the in/out kWh values. I can’t tell you exactly how to calculate it because it depends on what values you can monitor. Some people already have a Total Consumption sensor, others have a Current Consumption and create an integration sensor from that, or if you have Total Grid and Total Solar, then you have to combine them, etc.

Currently sankey chart just shows historical data based on a energy-date-selection card. It doesn’t know/care if your entities are in the default energy dashboard.

1 Like

I think I’ve gotten myself confused over something pretty important.

So lets say I have a power entity for my entire house, and a number of device power entities.

I can create a segement for each of these groups easily enough. However, ideally I’d like to add a middle segment to group some of those devices e.g. Lighting, Homelab etc. Each of these groups would have specific device child entities and I assumed the graph could derive the groups automatically (by totalling up the child entities), but I’m now thinking that I need to actually create additional template sensors in HA to populate this.

Can someone confirm?

If you create a Lighting entity with type: remaining_child_state and list all the lights as children, it should create a virtual group. You can put this in the middle section to achieve what you want.

Be careful however as too many virtual entities can easily lead to a circular dependency that makes it impossible to calculate everything. Try it out and if doesn’t work, submit an issue in GitHub with an example.

Thanks for clarifying. I have two separate kWh counters based on time of day. So in order to make this work with the Sankey chart I’ve created a template sensor that sums these two. I am trying to use this sensor as the leftmost item in my Sankey chart. However, it isn’t working, and I suspect that is because the HA energy integration is using the two separate kWh counters (I do this because they have different pricing, and adding the two separately allows HA to accurately calculate cost).

Am I correct in assuming that the energy data selector only works when all of the sensors referenced in the Sankey chart are also used in the energy dashboard itself?

For reference, this is my config now which isn’t working:

type: custom:sankey-chart
show_names: true
round: 1
unit_prefix: k
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.energy_consumed_grid
        children:
          - sensor.networking_plug_energy
          - sensor.fridge_energy
          - energy_other
  - entities:
      - entity_id: sensor.networking_plug_energy
      - entity_id: sensor.fridge_energy
      - entity_id: energy_other
        type: remaining_parent_state
        name: Other

As soon as I change energy date selection to false, the chart looks a lot better. But of course then the data selection does not work any more…

Am I doing anything wrong?

The entities don’t need to be in the energy dashboard at all. If you recently created the template sum sensor, then it won’t have historical data yet. This might be your problem.

For this chart however you don’t need to sum them if you don’t want to. You can just add both sensors in the first section and add all children to both of them. The chart supports multiple parents and the remaining will also work.