MindFreeze / ha-sankey-chart

A Home Assistant lovelace card to display a sankey chart. For example for power consumption
MIT License
348 stars 15 forks source link

Columns missing using autoconfig #162

Open rmu1987 opened 5 months ago

rmu1987 commented 5 months ago

Checklist:

Release with the issue: I currently run: Home assistant version: 2024.1.6 Sankey Chart version: 1.20.0

Last working release (if known): Unknown, but it is doing strange since 9 december 2023 (found it using the date picker)

Browser and Operating System: Firefox, Safari and Chrome on 2 different Macbooks HA app on iOS

Description of problem: I'm using the autoconfig option, it worked as expected and was showing like this: Screenshot 2024-02-02 at 13 38 46 So:

On 9 december (and later dates) it started looking like: Screenshot 2024-02-02 at 13 38 54 So:

I don't know why this is happening and the two columns are missing, as far i'm aware of i did not change something in the Energy Dashboard.

Card configuration: Screenshot 2024-02-02 at 13 43 22

MindFreeze commented 4 months ago

@rmu1987 There was a change in how HA manages these stats. I fixed something related since then. Do you still have this issue?

rmu1987 commented 4 months ago

Hello @MindFreeze i installed the update a couple of days ago but the issue is still the same unfortunately.

MindFreeze commented 4 months ago

@rmu1987 Can you enable the "print auto generated yaml" option and see what config it prints out for Dec 8 and Dec 9?Also can you check if you still have "Energy consumption Tarif 1" in the energy dashboard please? It is behaving as if it was removed.

rmu1987 commented 4 months ago

@MindFreeze the yaml print out is the same for 7, 8 and 9 december and also the same for today. I wanted to copy it but that does not seem to be possible so here are screenshots: image image

All the mentioned entities are the same as defined in the Energy Dashboard and are all still working as expected. Also the Energy dashboard is showing data on every day.

MindFreeze commented 4 months ago

@rmu1987 This config doesn't look right. I assume sensor.energy_production_tarif_... is energy exported to the grid? Do you mind running this command in the browser console and pasting the result here JSON.stringify((await hassConnection).conn._energy.prefs.energy_sources) ?

It will be easier to fix this if I can reproduce your setup.

rmu1987 commented 4 months ago

@MindFreeze _"I assume sensor.energy_productiontarif... is energy exported to the grid?"_ That's correct! Currently i don't have the possibility to export energy to the grid but i defined it in the Energy Dashboard anyway. It is in there from way before i started using ha-sankey-chart.

_"Do you mind running this command in the browser console and pasting the result here JSON.stringify((await hassConnection).conn._energy.prefs.energysources) ?" Steps i did:

  1. Open firefox and open the page which displays the sankey-chart
  2. Start the web developer tools -> tab: Console
  3. Enter the command mentioned above - Nothing shows in the console
  4. Refreshed the page - nothing shows in the console
  5. Tried steps 3 and 5 also on the energy dashboard - Nothing shows in the console
pipetboy commented 1 month ago

I'm having a similar issue, but I'm losing the last column. I'm using the autoconfig option, and this is the autogenerated yaml is below. It started on May 25. The data on may 24 seems fine. JSON.stringify((await hassConnection).conn._energy.prefs.energy_sources) doesn't show anything.

Sankey May 24 May 25

layout: auto height: 200 unit_prefix: k round: 1 convert_units_to: '' co2_intensity_entity: sensor.co2_signal_co2_intensity gas_co2_intensity: 66.6 min_box_size: 3 min_box_distance: 5 show_states: true show_units: true energy_date_selection: true sections:

MindFreeze commented 1 month ago

Looks like the values we get from HA statistics are 0, so the entities aren't shown. If HA shows data for these days than maybe the calculations have changed again. I wish they exposed this stuff instead making me reimplement it. The JSON... command should work on the energy dashboard. Maybe try JSON.stringify((await hassConnection).conn._energy.prefs) to get the whole config