Closed MindFreeze closed 11 months ago
Hi,
I'm getting an error when building a chart with autoconfig:
Is it helpful to share the generated yaml and error? This is a great project and I know it's in beta still.
Yes, please share. a picture of you energy-distribution card would also be very useful
Could somebody share the lovelace YAML that works. I have tried everything but get the result:
I have the same output (2022.12.x and 2023.1.x) , should we open an dedicated issue?
No need for a dedicated issue but I do need the outputof this command in the browser's dev console (F12) JSON.stringify((await hassConnection).conn._energy.prefs.energy_sources)
and/or a picture of the energy-distribution card in your energy dashboard
"[{\"type\":\"grid\",\"flow_from\":[{\"stat_energy_from\":\"sensor.home_energy_meter_gen5_electric_consumed_kwh\",\"stat_cost\":null,\"entity_energy_price\":\"sensor.electricity_cost\",\"number_energy_price\":null}],\"flow_to\":[],\"cost_adjustment_day\":0},{\"type\":\"gas\",\"stat_energy_from\":\"sensor.gaz_consumption_in_kwh\",\"stat_cost\":null,\"entity_energy_price\":null,\"number_energy_price\":0.1563},{\"type\":\"water\",\"stat_energy_from\":\"sensor.water_total\",\"stat_cost\":null,\"entity_energy_price\":null,\"number_energy_price\":null}]"
I can't reproduce this. Added some debug logs in v1.7.0 , so post back if you get something in the console with that version
Thanks for your reply.
I still get the "not found" message (present in previous version as well) and a new debug object:
Same problem here, just cleanly installed Sankey Chart, never used it before.
I currently do have 1 entity in the Energy Dashboard which is currently unavailable/missing, might that have something to do with this issue occuring? It is the dryer which I'm currently replacing, should be delivered today so can check if this fixes it by the end of the day. Might be good for Sankey to just ignore missing entities if this really is the case.
Running: Home Assistant 2023.1.5 Supervisor 2022.12.1 Operating System 9.4 Frontend-version: 20230110.0 - latest HA-Sankey-Chart: v1.8.0
Card config:
- type: custom:sankey-chart
autoconfig:
print_yaml: false
Error on dashboard:
Error: Something went wrong. No energy data received.
height: 200
unit_prefix: k
round: 1
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
energy_date_selection: true
sections: []
type: custom:sankey-chart
autoconfig:
print_yaml: false
Error in console log:
ha-sankey-chart.js:1 sankey-chart Version 1.8.0
0:1 Uncaught (in promise) Objectcode: "not_found"message: "Entity not found"[[Prototype]]: Objectconstructor: ƒ Object()assign: ƒ assign()create: ƒ create()defineProperties: ƒ defineProperties()defineProperty: ƒ defineProperty()entries: ƒ entries()freeze: ƒ freeze()fromEntries: ƒ fromEntries()getOwnPropertyDescriptor: ƒ getOwnPropertyDescriptor()getOwnPropertyDescriptors: ƒ getOwnPropertyDescriptors()getOwnPropertyNames: ƒ getOwnPropertyNames()getOwnPropertySymbols: ƒ getOwnPropertySymbols()getPrototypeOf: ƒ getPrototypeOf()hasOwn: ƒ hasOwn()is: ƒ is()isExtensible: ƒ isExtensible()isFrozen: ƒ isFrozen()isSealed: ƒ isSealed()keys: ƒ keys()length: 1name: "Object"preventExtensions: ƒ preventExtensions()prototype: {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …}seal: ƒ seal()setPrototypeOf: ƒ setPrototypeOf()values: ƒ values()arguments: (...)caller: (...)[[Prototype]]: ƒ ()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()__proto__: (...)get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
That could be it. I'll try to reproduce with a missing entity.
I have some missing entities as well, but I don't want to delete them, because when it will delete history as well from energy dashboard. For example, my PV entity changed, because I changed the integration
Maybe it's possible to just skip unavailable entities?
1.8.2 will ignore missing entities
1.8.2 will ignore missing entities
Now a new kind of error
type: custom:sankey-chart autoconfig: print_yaml: false
Autoconfig error
@martinarva try v1.9.0 . I was only checking the consumers before. Now it checks producers as well
It is working for me on v1.8.0 now, since I connected my dryer again.
Updated to v1.9.0 and it's still working, only it doesn't seem to populate the lines/stripes and names of consumers automatically, is this expected behaviour?
Not expected. You are the second person to report this. Mind posting a pic of your energy distribution card?
Not expected. You are the second person to report this. Mind posting a pic of your energy distribution card?
Already did this, but strangely enough my screenshot did not go through, hopefully now it works:
I mean the card that is called Energy Distribution, in the Energy dashboard. On the right in desktop mode
I mean the card that is called Energy Distribution, in the Energy dashboard. On the right in desktop mode
Looks quite similar to the other report. Maybe grid export is causing this. I'll try to reproduce this tomorrow
Now a new error in every sankey chart
Same issue, even after going back to 1.8.2
Reboot and stays the same, v1. 9
I think I fixed the export problem. Please let me know
I think I fixed the export problem. Please let me know
Yes, graph in general works now, but autoconfig still dont:
Where can i see the logs for that?
Just like the rest, I get the following error now:
Custom element doesn't exist: sankey-chart.
type: custom:sankey-chart
autoconfig:
print_yaml: false
Using v1.9.2 and already cleared my cache a couple of times.
Going from v1. 9 to 1.9.2 solved that for me somehow.
@Xitro01 HA cached the bad version somewhere else and not only the normal browser cache. WebWorkers or something similar, haven't investigated. You have to clear all application data and unregister wokers, or just wait for it to expire. Took a couple of hours for me.
@Xitro01 HA cached the bad version somewhere else and not only the normal browser cache. WebWorkers or something similar, haven't investigated. You have to clear all application data and unregister wokers, or just wait for it to expire. Took a couple of hours for me.
The HA update this morning finally fixed it. Washer and dryer are not connected anymore, getting new ones this morning. So the missing entities issue is resolved.
But still missing labels and I expect the highest consumers on top, now it seems a bit random (unsorted):
Also it doesn't really seem to take into account that some solar power might not be used yourself, that it's delivered back. Should actually say: 58,2 from net, 9,4 used in solar (and 6,6 delivered back to the grid)
P.S. Awesome work for developing this chart and creating a feature like this, therefore I'm happy to help as much as I can to make it near perfect. It is much appreciated, I think I can speak for all of us.
Fixed with v1.9.2 👍🏻
Another update from me, I found out that I could just use "show_names: true".
Also as mentioned in my post before: It doesn't really seem to take into account that some solar power might not be used yourself, that it's delivered back.
You can setup yourself
You can setup yourself
Beats the purpose of 'autoconfig', the information is already there, ready to be used.
It's used but configured differently. Autoconfig is just a basic to get started imo.
I still don't understand how to configure the autoconfig. I am just curious what it will come up with but I can't get it to work...don't know where to put the " type: energy-date-selection" No matter where I put this it comes up with error messages. Anyone has a clue?
this doesn't work:
I had the same problem but the Readme makes it look wrong.
You need 2 cards
Card 1 Custom card type: energy-data-selection
Card 2 Sankey card type: custom:sankey-chart energy_date_selection: true autoconfig: print_yaml: true
Thanks a lot, it works now:
Yep, the README assumes a yaml mode dashboard. I hadn't used UI mode until recently and am just now seeing the differences. Working on improving this in #77
@Xitro01 autoconfig is indeed just a starting point. This is the point of the print_yaml
option. show_names
should be turned on by default, I guess, but you other expectations are very subjective.
In my case it's still not working:
It worked all right but now it doesn't any more...same error message as above..I haven't changed anything apart from the update tot the latest version
In theory the card can be auto configured for energy with the data from the energy dashboard.
The most basic resulting config would be
${energy sources} -> ${individual consumers}
with probably a sum in the middle.An even better config would group the consumers by area as well. So:
${energy sources} -> ${total consumed} -> ${areas from HA} -> ${individual consumers}