mindfreeze / ha-sankey-chart Goto Github PK
View Code? Open in Web Editor NEWA Home Assistant lovelace card to display a sankey chart. For example for power consumption
License: MIT License
A Home Assistant lovelace card to display a sankey chart. For example for power consumption
License: MIT License
Is your feature request related to a problem? Please describe.
I managed energy consumption with different sensors which value is increasing, no daily reset. This works fine with Energy dashboard but not with the card.
Describe the solution you'd like
By able to manage delta of the value between to time that could be defined. Remaining could highlight rest of energy not identified (I don't have smartplug everywhere)
Describe alternatives you've considered
Create for each sensor a related utiliy_meter sensor but it's like duplicate data, which I don't like
Is your feature request related to a problem? Please describe.
I was playing around with this card and it took me some time before I got the configuration right.
Describe the solution you'd like
I think it would have helped there was an example to reference. For example the configuration of the card used to get the image in the readme. That way I could see the configuration and relate to how it looks in the picture.
Describe alternatives you've considered
I just kept trying and it worked out in the end
Additional context
Nothing else to add.
Thanks for the great work on this card, found it today and it can really provide some cool insights.
Is your feature request related to a problem? Please describe.
I put together a chart with it as a mock, and there's a couple of enchancements I'd like to see:
Ability to autosort entities based on value(say, highest to lowest) instead of the current discrete order, for a given level. Say, if I have a chart with Grid/Power source -> Rooms -> categories -> individual items, I might want to keep the sources and rooms in the same order, but i might want the categories or individual items to be sorted by value instead.
Have the abiliy to display an entity on a lower level, if that makes sense?
Going with the previous example:
Grid/Power source -> Rooms -> categories -> individual items
Within a room I have categories "Electronics" , and then have 2 individual devices, "steambox" and "light". "steambox" is a child of "electronics", but "light" is orphan within Rooms.
I would like to have the option to display the "light" entity at the same level as "steambox", without having to create an additional sensor for the category.
Describe the solution you'd like
It could be a good idea to have the option to autosort the entities by their value within a specific level of the chart.
Additional context
screenshot example for point 2.
https://i.imgur.com/WUwhICp.png
Thanks!
Spin off from #2
Similar to remaining/unaccounted state in children, it would be useful to see unaccounted parent state.
Hey,
first of all - awesome card! Just found it yesterday and already in love with it!
One little thing would make it perfect for me - could you add a space between the numbers and the units? Would be cleaner to read for me, e.g. "1287 kWh" instead of "1287kWh".
Kind regards,
Klaus
Is your feature request related to a problem? Please describe.
I don't believe this is currently supported. It would be awesome if you could chose to supress the display of the unit of measurement label.
Currently....
[value] [unit of measurement] [entity name] e.g. 10W Light
becomes...
[value] [entity name] e.g. 10 Light
My rationale for this is two fold:
Describe the solution you'd like
A new option in the configuration of:
Name hide_unit
Type boolean
Requirement Optional
Default false
Description Hide the units of measurements
Describe alternatives you've considered
I could create template sensors to replicate those I wish to display without a unit of measurement. This obviously increases the maintenance and number of sensors etc. etc.
Additional context
Add any other context or screenshots about the feature request here.
Checklist:
Release with the issue:
0.6.4
Last working release (if known):
Browser and Operating System:
Firefox 93.0 Windows 10
Safari (HA Companion App), iOS 15.5
Description of problem:
I can no longer click on entity names in the Sankey graph to get the more info pop-up for the entity.
Javascript errors shown in the web inspector (if applicable):
Additional information:
Specify entities for size of connectors. This would allow a lot more flexibility
Would be great to set a real prefix in front of the unit. I would like to set a blank, because for me it is hard to read, if the unit is directly after the number.
And it would be great if I can set the font size of the descriptions as well. Same for font-color and font-decoration. I would like to unset italic, but have it e.g. in grey and smaller. ๐
Checklist:
Release with the issue:
0.6.3
Last working release (if known):
Browser and Operating System:
Chrome 101.0.4951.67 on Windows 10
Description of problem:
Not all branch connectors get rendered.
The config does not show branch connector between RF433 and Wemo1:
- type: custom:sankey-chart
show_names: true
show_icons: true
min_box_height: 40
wide: true
height: 300
sections:
- entities:
- entity_id: sensor.mqtt
children:
- sensor.dep_wemo_d1_1
- sensor.dep_nodemcu
- entity_id: sensor.dep_sonoff_rf433
children:
- sensor.dep_wemo_d1_1
- entities:
- entity_id: sensor.dep_nodemcu
children:
- sensor.dep_garage_door
- sensor.dep_sonoff_zigbee
- entity_id: sensor.dep_wemo_d1_1
children:
- sensor.dep_lifting_pump
- sensor.dep_irrigation_control
- entities:
- sensor.dep_garage_door
- sensor.dep_sonoff_zigbee
- sensor.dep_lifting_pump
- sensor.dep_irrigation_control
Javascript errors shown in the web inspector (if applicable):
Additional information:
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}
Is your feature request related to a problem? Please describe.
Hi, it's possible to set the minimal font size?
I love your Sankey Graph, but i can't read everything
Describe the solution you'd like
Set minimal font size or a custom parameter in each entity
Additional context
Add any other context or screenshots about the feature request here.
Release with the issue: 0.11.0
Browser and Operating System: Windows 11, Chrome and Edge
This could be my configuration but I am unable to figure out why the connecting lines of the children of lounge power jump above items in the 4th column when their entries are after and only present in the 5th column.
The 4 children (AV Left, AV Right, Rear Sonos, Sub) of Lounge power are the last entities in the 5th column and thier parent is the last in the 2nd column.
II also note that the Remaining Switches amount has duplicated it's self magically to the 5th column, which is actually awesome but for some reason The Remaining Misc does not. Perhaps the Switches behavior is a bug, but it would be great to configure this.
Here is my configuration:
`type: custom:sankey-chart
show_names: true
round: 1
height: 400
wide: true
sections:
Checklist:
Release with the issue:
Last working release (if known):
Browser and Operating System:
Description of problem:
The component overwrites global hass object state cause wrong values to be displayed in all dialogs.
I think this lone is the (or one of) culprit.
ha-sankey-chart/src/ha-sankey-chart.ts
Line 77 in 5e64f26
Javascript errors shown in the web inspector (if applicable):
Additional information:
When I mouseover an entity, it will be nice to see the paths connected to its parent and children in a brighter color. This will be useful for charts with lots of entities with low values, which make it hard to see what its parents and children are.
A second iteration of this feature would be the ability to highlight not just the parent and children, but also its grandparents and grandchildren, so that we can trace what affects the entity and what the entity affects all the way down the line.
For example, mouseover on my Fridge entity will highlight the following:
I've had to revert to the last version as I have no idea how this (3rd section) should now be configured. Not for the lack of trying.
type: entities
title: Daily Energy Distribution
entities:
- type: custom:hui-element
card_type: custom:sankey-chart
show_names: true
height: 300
round: 2
unit_prefix: k
wide: true
sections:
- entities:
- entity_id: sensor.energy_from_grid_daily_peak
name: Grid Peak Energy Used
color: '#488fc2'
children:
- sensor.energy_imported_daily_total
- entity_id: sensor.energy_from_grid_daily_offpeak
name: Grid Offpeak Energy Used
color: '#2f5f82'
children:
- sensor.energy_imported_daily_total
- entity_id: sensor.energy_inverter_daily
name: Solar Energy Produced
color: '#ff9800'
children:
- sensor.self_solar_consumption_daily
- sensor.energy_to_grid_daily
- entities:
- entity_id: sensor.energy_imported_daily_total
name: Daily Imported Total
children:
- sensor.energy_consumed_daily_total
- entity_id: sensor.self_solar_consumption_daily
name: Self Consumed Solar
color: '#ff9800'
children:
- sensor.energy_consumed_daily_total
- entity_id: sensor.energy_to_grid_daily
name: Solar Energy Exported
color: '#8353d1'
- entities:
- entity_id: sensor.energy_consumed_daily_total
name: Total Energy Used
color: '#488FC2'
remaining:
name: Unmonitored
children:
- sensor.bar_fridge_daily_energy
- sensor.cinema_av_daily_energy
- sensor.comms_rack_daily_energy
- sensor.dishwasher_daily_energy
- sensor.electronics_bench_daily_energy
- sensor.fridge_daily_energy
- sensor.energy_downstairs_heat_pump_daily
- sensor.energy_hot_water_daily_peak
- sensor.energy_hot_water_daily_offpeak
- sensor.led_table_daily_energy
- sensor.lounge_av_daily_energy
- sensor.lounge_dehumidifier_daily_energy
- sensor.electric_blanket_daily_energy
- sensor.mechanical_bench_daily_energy
- sensor.pc_monitor_daily_energy
- sensor.rack_fan_daily_energy
- sensor.rumpus_dehumidifier_daily_energy
- sensor.spb_electric_blanket_daily_energy
- sensor.cinema_subwoofer_daily_energy
- sensor.energy_upstairs_heat_pump_daily_peak
- sensor.energy_upstairs_heat_pump_daily_offpeak
- sensor.washing_machine_daily_energy
- sensor.workshop_chargers_daily_energy
- entities:
- entity_id: sensor.bar_fridge_daily_energy
name: Bar Fridge
color: '#039BE5'
- entity_id: sensor.cinema_av_daily_energy
name: Cinema AV Gear
color: '#039BE5'
- entity_id: sensor.comms_rack_daily_energy
name: Comms Rack
color: '#039BE5'
- entity_id: sensor.dishwasher_daily_energy
name: Dishwasher
color: '#039BE5'
- entity_id: sensor.electronics_bench_daily_energy
name: Electronics Bench
color: '#039BE5'
- entity_id: sensor.fridge_daily_energy
name: Fridge
color: '#039BE5'
- entity_id: sensor.energy_downstairs_heat_pump_daily
name: Downstairs Heat Pump
color: '#039BE5'
- entity_id: sensor.energy_hot_water_daily_peak
name: Hot Water (Peak)
color: '#039BE5'
- entity_id: sensor.energy_hot_water_daily_offpeak
name: Hot Water (Offpeak)
color: '#039BE5'
- entity_id: sensor.led_table_daily_energy
name: LED Table
color: '#039BE5'
- entity_id: sensor.lounge_av_daily_energy
name: Lounge AV Gear
color: '#039BE5'
- entity_id: sensor.lounge_dehumidifier_daily_energy
name: Lounge Dehumidifier
color: '#039BE5'
- entity_id: sensor.electric_blanket_daily_energy
name: Master Bedroom Elect Blanket
color: '#039BE5'
- entity_id: sensor.mechanical_bench_daily_energy
name: Mechanical Bench
color: '#039BE5'
- entity_id: sensor.pc_monitor_daily_energy
name: PC Monitor
color: '#039BE5'
- entity_id: sensor.rack_fan_daily_energy
name: Rack Fan
color: '#039BE5'
- entity_id: sensor.rumpus_dehumidifier_daily_energy
name: Rumpus Dehumidifier
color: '#039BE5'
- entity_id: sensor.spb_electric_blanket_daily_energy
name: Spare Bedroom Elec Blanket
color: '#039BE5'
- entity_id: sensor.cinema_subwoofer_daily_energy
name: Subwoofer
color: '#039BE5'
- entity_id: sensor.energy_upstairs_heat_pump_daily_peak
name: Upstairs Heat Pump (Peak)
color: '#039BE5'
- entity_id: sensor.energy_upstairs_heat_pump_daily_offpeak
name: Upstairs Heat Pump (Offpeak)
color: '#039BE5'
- entity_id: sensor.washing_machine_daily_energy
name: Washing Machine
color: '#039BE5'
- entity_id: sensor.workshop_chargers_daily_energy
name: Workshop Chargers
color: '#039BE5'
card_mod:
class: inline-card-no-border
card_mod:
class: top-level-card
Hi,
I have my set up with round: 0, however I have some entities showing with a single decimal.
Some of my lights will report sometimes a residual 0.4W or 0.1W, I was hoping to dismiss them by using "round: 0", however it does not seem to be working? Ie, them keep showing on my chart despite the rounding being set to 0.
Thanks,
The sankey-chart can show icons (option "show_icons: yes"), but it uses the default ones from the entity. I'd like to use different icons with the chart, configuration could look like the following:
sections:
- entities:
- entity_id: sensor.total_dc_power
name: PV
icon: mdi:solar-power <----
color: yellow
children:
- sensor.load
Would it please be possible to integrate this?
Regards, Uli
Is your feature request related to a problem? Please describe.
There are issues using it on mobile, where the screen height is different.
Describe the solution you'd like
the diagram will scale vertically depending on the size of the screen
Describe alternatives you've considered
Instead of using absolute pixel size, it would be nice to have a percent. allow for either absolute or relative heights in the configuration.
Additional context
When there are two sets of values in two columns sourced from separate sensors, it is inevitable that there will be discrepancies.
For example, if I have my own calculations of the estimated total energy use and also have the smart meter reading from my electric company, the two values will likely not add up. It will be helpful sometimes to have the ability to show that discrepancy as a branch without the need to create another template sensor for that discrepancy.
Describe the solution you'd like
It would be probably be something along the lines of...
sections:
- entities:
- entity_id: sensor.total_energy_use_on_fossil_fuel
name: Fossil Fuel
children:
- sensor.total_energy_use
- entity_id: sensor.total_energy_use_on_renewables
name: Renewables
children:
- sensor.total_energy_use
- entities:
- entity_id: sensor.total_energy_use
name: Est. Total
children:
- sensor.a_plug_smartenergy_metering
- sensor.d_plug_smartenergy_metering
show_discrepancies: true
discrepancies_name: Unknown Appliances
- entities:
- entity_id: sensor.a_plug_smartenergy_metering
- entity_id: sensor.d_plug_smartenergy_metering
Describe alternatives you've considered
The alternative is to create template sensors of all the discrepancy values, which is a workable solution, but sometimes feel redundant. Besides, it wouldn't work if the discrepancy is sometimes a negative number.
Thank you! The chart looks awesome๐
Or ability to skip a section. Could be implemented with ghost boxes in between.
Also mentioned in #6
Is your feature request related to a problem? Please describe.
No problem
Describe the solution you'd like
Can we have a card title?
Describe alternatives you've considered
Nil.
Additional context
Please use the standard Lovelace styling for the title.
I want to change colour of entity depending on condition.
For example:
- entity_id: sensor.power_fv2grid
name: FV to Grid
color: >-
{% if (states('sensor.power_fv2grid')|float > 0) %} green
{% else %} red
{% endif %}
children:
- sensor.power_house
Tried this code, no errors, but not working.
Any suggestions?
Is your feature request related to a problem? Please describe.
Currently sections are evenly divided over the available width. This doesn't always produce the best results, because some sections need more space than others.
Describe the solution you'd like
I would like sections to get a width
property where width can be configured as a percentage.
Describe alternatives you've considered
I do not this there is another way to achieve this.
Checklist:
Release with the issue: v0.11.0
Last working release (if known):
Browser and Operating System: Chrome Version 104.0.5112.101 @win10 / HA official client @iOS 15.4.1
Description of problem:
Wide option didn't effect, empty space still in the right side (purple area).
Javascript errors shown in the web inspector (if applicable):
Additional information:
Our house is equipped with multiple (small) solar inverters as well as a central battery and I'm having trouble integrating the battery power in the chart.
When the battery is loading the entity values are positive. If it's discharging the values are negative.
Since the sun was kind enough to reveal itself for some minutes in the last days, I noticed the chart does not seem to handle negative values; and even if, I'm not sure how to integrate the battery in the chart.
Current state:
If I put the consumers as children behind the battery, it seems like the power is flowing into the battery and directly leaves it again. If the battery is discharged (negative values) it's not visible at all.
Expected state:
I put children behind the battery. If the value for battery is positive, the energy only flows into the battery pretends it has no children. If the value for the battery is negative, the children get energy from the battery, but no energy is flowing into the battery.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Support for coloring entiies based on their state. This could be set on entity object level.
Describe the solution you'd like
A clear and concise description of what you want to happen.
I was thinking of creating a dependency graph (if possible, otherwise a tree) between the different entities.
E.g. heating in a room depends on the Zigbee temperature sensor that depends on the Zigbee-wifi bridge that depends on MQTT. Other sensors also depend on the zigbe-mqtt, etc.:
mqtt - device_tracker.zigbee_bridge - sensor.zb_temp ----- climate.heat
\ \ sensor.zb_door_window /
\ sensor.zb_water_leak
So if a device/entity in this dependency graph fails this card could be used to make it visible what other entities are affected. Most visibly the color based on state could do that.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
none yet, I just found this card today.
Additional context
Add any other context or screenshots about the feature request here.
No problem.
Some time nice to have "Remaining object" located on top, not bottom.
Thank You very much.
Hi!
Thanks for da card, it's awesome! ๐
I have a suggestion, how 'bout adding the ability to overwrite the value of entities?
I mean, so that u can set a localization value, for example if W
--> but I want to set to ะั
and etc...
Something similar has already been implemented, for example, in lovelace-multiple-entity-row, u can find it here: https://github.com/benct/lovelace-multiple-entity-row#secondary-info
Thanks in advance!
Is your feature request related to a problem? Please describe.
Not a problem. It would just be nice to be able to use wildcards, similar to auto-entities.
e.g.
sensor.*_power
Describe the solution you'd like
Support for wildcards such as
entities: sensor.*_power
and filters such as
area: garden
Describe alternatives you've considered
Using auto-entities card, but not sure if that even works with Sankey card and it would be nicer to have this as an integrated feature.
Additional context
When the parent and sum of children don't match, we should be able to choose the latest, min, max or mean of the two and show that.
Checklist:
Release with the issue:
core-2022.8.0
Last working release (if known):
n/a
Browser and Operating System:
Firefox & Chrome on Windows 10, HA mobile app
Description of problem:
The remaining object does not show when one of the child entities has a value of 0. In the following example, the entity sensor.washing_machine_power_meter_meter
has a value of 0w. The remaining object does not show. If that particular entity is either commented out, or made to have a value above 0, the remaining object will appear.
type: custom:sankey-chart
title: Power
show_names: true
min_box_height: 20
sections:
- entities:
- entity_id: sensor.breaker_panel_power_meter
name: Total
remaining:
name: All Others
children:
- sensor.pool_pump_power_meter
- sensor.office_big_light_power_meter
- sensor.washing_machine_power_meter_meter
- entities:
- entity_id: sensor.washing_machine_power_meter
name: Washer
- entity_id: sensor.pool_pump_power_meter
name: Network Rack
children:
- sensor.idrac_host1_powerconsumption
- sensor.idrac_host2_powerconsumption
- sensor.idrac_host3_powerconsumption
remaining:
name: Other Network
- entity_id: sensor.office_big_light_power_meter
name: Driveway Cam
- entities:
- entity_id: sensor.idrac_host1_powerconsumption
name: Host 1
- entity_id: sensor.idrac_host2_powerconsumption
name: Host 2
- entity_id: sensor.idrac_host3_powerconsumption
name: Host 3
Screenshot of the Sankey chart with child sensor.washing_machine_power_meter_meter
having a value of 0, note the 'All Others' remaining object is missing:
Screenshot of the Saneky chart with child sensor.washing_machine_power_meter_meter
removed/commented out, note the 'All Others' remaining object is present:
Javascript errors shown in the web inspector (if applicable):
Additional information:
Checklist:
Release with the issue:
v1.5.2
Last working release (if known):
Browser and Operating System:
Latest Chrome on latest MacOS
Description of problem:
Graph is messed up. The lights part in section 3
lovelace yaml:
type: custom:sankey-chart
show_names: true
energy_date_selection: null
height: 500
unit_prefix: k
sections:
- entities:
- entity_id: sensor.total_main_energy_1
children:
- sensor.phase_1_energy
- sensor.phase_2_energy
- sensor.phase_3_energy
name: Total Grid
remaining:
name: Other
- entities:
- entity_id: sensor.phase_1_energy
name: Phase 1
children:
- sensor.heat_pump_phase_1_energy
- sensor.downstairs_wc_mirror_lights_energy
- sensor.downstairs_wc_ceiling_lights_energy
- sensor.sauna_wahing_room_lights_energy
- sensor.sauna_lights_energy
- sensor.bathroom_lights_energy
- sensor.bathroom_lights_energy_2
- sensor.matu_s_room_lights_dimmer_energy
- sensor.bedroom_lights_energy
- sensor.marlon_s_room_lights_energy
- sensor.pergola_lightning_energy
- sensor.outdoor_kitchen_lights_energy
- sensor.washing_machine_energy
- sensor.dryer_energy
- sensor.ev_charger_energy_3
- sensor.stair_hallway_ceiling_lights_energy
- sensor.2nd_floor_lobby_lights_energy
- sensor.stair_lights_energy
- sensor.wardrobe_lights_switch_0_energy
- sensor.wardrobe_lights_switch_1_energy
remaining:
name: Other
- entity_id: sensor.phase_2_energy
name: Phase 2
children:
- sensor.heat_pump_phase_2_energy
- sensor.garage_lights_energy
- sensor.front_entrance_outdoor_lights_energy
- sensor.majaesine_ouevalgus_energy
- sensor.back_yard_outdoor_lightning_energy
- sensor.balcony_lights_energy
- sensor.hw_circulation_pump_device_energy
remaining:
name: Other
- entity_id: sensor.phase_3_energy
name: Phase 3
children:
- sensor.heat_pump_phase_3_energy
- sensor.living_room_lights_energy
- sensor.kitchen_ceiling_lights_electric_consumption_kwh
- sensor.kitchen_island_lights_energy
- sensor.dining_table_lights_electric_consumption_kwh_3
- sensor.pool_pump_energy
- sensor.home_dc_energy
- sensor.hallway_lights_energy
remaining:
name: Other
- entities:
- entity_id: sensor.heat_pump_phase_1_energy
name: Heat Pump Phase 1
children:
- sensor.heat_pump_energy
- entity_id: sensor.heat_pump_phase_2_energy
name: Heat Pump Phase 2
children:
- sensor.heat_pump_energy
- entity_id: sensor.heat_pump_phase_3_energy
name: Heat Pump Phase 3
children:
- sensor.heat_pump_energy
- entities:
- entity_id: sensor.heat_pump_energy
type: passthrough
children:
- sensor.heat_pump_energy
- entity_id: sensor.heat_pump_energy
name: Heat Pump
- entity_id: sensor.downstairs_wc_mirror_lights_energy
name: WC Mirror Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.downstairs_wc_ceiling_lights_energy
name: WC Ceiling Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.sauna_wahing_room_lights_energy
name: Sauna Wahsing Room Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.sauna_lights_energy
name: Sauna Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.bathroom_lights_energy
name: Bathroom Ceiling Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.bathroom_lights_energy_2
name: Bathroom Mirror Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.matu_s_room_lights_dimmer_energy
name: Matu's Room Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.bedroom_lights_energy
name: Bedroom Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.marlon_s_room_lights_energy
name: Marlon's Room Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.pergola_lightning_energy
name: Pergola Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.outdoor_kitchen_lights_energy
name: Outdoor Kitchen Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.garage_lights_energy
name: Garage Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.front_entrance_outdoor_lights_energy
name: Outdoor Entrance Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.majaesine_ouevalgus_energy
name: Outoor Front Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.back_yard_outdoor_lightning_energy
name: Outdoor Backyard Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.balcony_lights_energy
name: Outdoor Balcony Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.living_room_lights_energy
name: Living Room Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.kitchen_ceiling_lights_electric_consumption_kwh
name: Kitchen Ceiling Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.kitchen_island_lights_energy
name: Kitchen Island Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.dining_table_lights_electric_consumption_kwh_3
name: Dining Table Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.sauna_lobby_lights_energy
name: Sauna Lobby Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.stair_hallway_ceiling_lights_energy
name: Stair Hallway Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.2nd_floor_lobby_lights_energy
name: 2nd Floor Lobby Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.stair_lights_energy
name: Stair Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.wardrobe_lights_switch_0_energy
name: Wardrobe Ceiling Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.wardrobe_lights_switch_1_energy
name: Wardrobe Cupboard Lights
children:
- sensor.total_lights_energy
- entity_id: sensor.hallway_lights_energy
name: Hallway Lights
children:
- sensor.total_lights_energy
- entities:
- entity_id: sensor.heat_pump_energy
name: Heat Pump
- entity_id: sensor.ev_charger_energy_3
name: EV Charger
- entity_id: sensor.washing_machine_energy
name: Washing Machine
- entity_id: sensor.dryer_energy
name: Dryer
- entity_id: sensor.total_lights_energy
name: Total Lights
- entity_id: sensor.hw_circulation_pump_device_energy
name: HW Pump
- entity_id: sensor.pool_pump_energy
name: Dish Washer
- entity_id: sensor.home_dc_energy
name: Home DC
-->
Javascript errors shown in the web inspector (if applicable):
Additional information:
Hi,
Thanks for an amazing card, this is really what I've been looking for! I'd love the opportunity to optionally choose an entity attribute instead of only the entity id. Forgive me if this is already a feature, if so I couldn't find it.
An example, using HA utility meter: They keep the attribute last_period
showing exactly that, the previous number. For instance having a daily, weekly, monthly or yearly energy sensor it would be nice to be able to display yesterday's energy consumption by using the attribute in addition to todays consumption by using the entity state.
Keep up the good work, loved the card!
Is your feature request related to a problem? Please describe.
I noticed that the card was not showing up anymore, just empty space. Turns out this was due to me renaming some entities, which made the configuration invalid. It is understandable that it fails to render in this case, but it would have been nice to have an error message to get an indication something is wrong in the configuration.
Describe the solution you'd like
Render an error message when failing to render the card.
Describe alternatives you've considered
Not really an alternative, but now I looked at the JS console and remembered I just changed some entity names.
Additional context
No other context.
Checklist:
Release with the issue:
0.10.0
Last working release (if known):
don't know
Browser and Operating System:
Windows 10, Chrome
Description of problem:
I had the devtools console open and noticed the version for this card does not match the version displayed in HACS.
According to HACS I have 0.10.0, but the console shows version 1.4.1
Javascript errors shown in the web inspector (if applicable):
Probably unrelated, but this warning shows for the ha-sankey-chart.js in the console
The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.
Additional information:
Release with the issue: v0.3.2
Description of problem:
When the value of a box is too low, there is not enough space to display the text, causing them to overlap with each other. Perhaps there should be an option to hide text if box height is less than a certain value?
(Thanks a lot again for the add-on! Sorry for sending so many issues in ๐ )
With mocked HA state
When using the Sankey Chart to display historic energy values which are selected by energy_date_selection, we have no easy way to display the low carbon energy part from the total energy. Since the carbon intensity varies depending on the timeframe selected, a static calculation does not help.
It would be highly appreciated if the carbon values would be extracted for the period selected and the low carbon energy would be calculated from the total.
Checklist:
Release with the issue:
latest
Last working release (if known):
Currently, the padding differs to other standard cards (see above) and as you are using standard h1, it is currently added again, which differs even more.
Of yourse, I can set this all via card_mod, but prefer to have the HA standard natvie in cards and only change it, if I want to see it different. And the standard is 16 px below header (instead of 12) and header has its own separate padding.
Hi i have found this bug if the passthrough are on top of list
Checklist:
my card code:
type: custom:sankey-chart
title: Energia mensile
show_names: true
round: 1
unit_prefix: k
wide: true
min_box_distance: 5
min_box_height: 3
sections:
- entities:
- entity_id: sensor.monthly_pvenergy
name: FV1
color: rgb(255,215,0)
children:
- sensor.monthly_inverter
- sensor.monthly_dc_energy
- sensor.monthly_battenergycharged
- entity_id: sensor.monthly_fvenergy
name: FV2
color: rgb(255,105,0)
children:
- sensor.monthly_inverter
- sensor.monthly_dc_energy
- sensor.monthly_battenergycharged
- entity_id: sensor.monthly_battenelenergycharged
name: ENEL IN
color: purple
children:
- sensor.monthly_battenergycharged
- entities:
- entity_id: sensor.monthly_inverter
type: passthrough
children:
- sensor.monthly_inverter
- entity_id: sensor.monthly_dc_energy
type: passthrough
children:
- sensor.monthly_dc_energy
- entity_id: sensor.monthly_battenergydischarged
name: OUT
color: rgb(225,25,0)
children:
- sensor.monthly_dc_energy
- sensor.monthly_inverter
- entity_id: sensor.monthly_battenergycharged
name: IN
color: rgb(155,215,0)
- entities:
- entity_id: sensor.monthly_inverter
name: INV
color: var(--success-color)
children:
- sensor.monthly_energiatot
- entity_id: sensor.monthly_dc_energy
name: DC
color: var(--warning-color)
children:
- sensor.monthly_energiatot
- entity_id: sensor.monthly_energy
color: PURPLE
name: ENEL
children:
- sensor.monthly_energiatot
- entities:
- entity_id: sensor.monthly_energiatot
name: TOT
card_mod:
style:
$: |
h1.card-header {
font-size: 18px;
font-weight: normal;
padding-bottom: 2px;
padding-top: 2px;
padding-left: 12px;
padding-right: 12px;
}
ha-card{
font-weight: 400;
font-size: 13px;
color: var(--text-color-off);
padding: 0px 0px;
margin: 0px 0px 0px 0px;
}
other exemple
type: custom:sankey-chart
title: Energia giornaliera
show_names: true
round: 1
unit_prefix: k
wide: true
min_box_distance: 2
min_box_height: 5
sections:
- entities:
- entity_id: sensor.daily_pvenergy
name: FV1
color: rgb(255,215,0)
children:
- sensor.daily_inverter
- sensor.daily_dc_energy
- sensor.daily_battenergycharged
# - sensor.daily_battenergycharged
# - sensor.daily_dc_energy
# - sensor.daily_inverter
- entity_id: sensor.daily_fvenergy
name: FV2
color: rgb(255,105,0)
children:
- sensor.daily_inverter
- sensor.daily_dc_energy
- sensor.daily_battenergycharged
- entity_id: sensor.daily_battenelenergycharged
name: ENEL IN
color: purple
children:
- sensor.daily_battenergycharged
- entities:
- entity_id: sensor.daily_inverter
type: passthrough
children:
- sensor.daily_inverter
- entity_id: sensor.daily_dc_energy
type: passthrough
children:
- sensor.daily_dc_energy
- entity_id: sensor.daily_battenergydischarged
name: OUT
color: rgb(225,25,0)
children:
- sensor.daily_dc_energy
- sensor.daily_inverter
- entity_id: sensor.daily_battenergycharged
name: IN
color: rgb(155,215,0)
- entities:
- entity_id: sensor.daily_inverter
name: INV
color: var(--success-color)
children:
- sensor.energiatot
- entity_id: sensor.daily_dc_energy
name: DC
color: var(--warning-color)
children:
- sensor.energiatot
- entity_id: sensor.daily_energy
color: PURPLE
name: ENEL
children:
- sensor.energiatot
- entities:
- entity_id: sensor.energiatot
name: TOT
if i change the orther of first child entities there aren t any graphical issue
type: custom:sankey-chart
title: Energia giornaliera
show_names: true
round: 1
unit_prefix: k
wide: true
min_box_distance: 2
min_box_height: 5
sections:
- entities:
- entity_id: sensor.daily_pvenergy
name: FV1
color: rgb(255,215,0)
children:
- sensor.daily_battenergycharged
- sensor.daily_dc_energy
- sensor.daily_inverter
- entity_id: sensor.daily_fvenergy
name: FV2
color: rgb(255,105,0)
children:
- sensor.daily_battenergycharged
- sensor.daily_dc_energy
- sensor.daily_inverter
- entity_id: sensor.daily_battenelenergycharged
name: ENEL IN
color: purple
children:
- sensor.daily_battenergycharged
- entities:
- entity_id: sensor.daily_inverter
type: passthrough
children:
- sensor.daily_inverter
- entity_id: sensor.daily_dc_energy
type: passthrough
children:
- sensor.daily_dc_energy
- entity_id: sensor.daily_battenergydischarged
name: OUT
color: rgb(225,25,0)
children:
- sensor.daily_dc_energy
- sensor.daily_inverter
- entity_id: sensor.daily_battenergycharged
name: IN
color: rgb(155,215,0)
- entities:
- entity_id: sensor.daily_inverter
name: INV
color: var(--success-color)
children:
- sensor.energiatot
- entity_id: sensor.daily_dc_energy
name: DC
color: var(--warning-color)
children:
- sensor.energiatot
- entity_id: sensor.daily_energy
color: PURPLE
name: ENEL
children:
- sensor.energiatot
- entities:
- entity_id: sensor.energiatot
name: TOT
card_mod:
style:
$: |
h1.card-header {
font-size: 18px;
font-weight: normal;
padding-bottom: 2px;
padding-top: 2px;
padding-left: 12px;
padding-right: 12px;
}
ha-card{
font-weight: 400;
font-size: 13px;
color: var(--text-color-off);
padding: 0px 0px;
margin: 0px 0px 0px 0px;
}
We need a Math.abs()
somewhere
Hello! Great card, btw! :)
SInce I can't manage to use the 'remaining' object, would it be possible to add an exemple of usage?
Thanks in advance!
Creating a detailed Sankey Chart requires making template sensors with the sum of the values of its children. It would be nice to not having such requirement, as I end up having to create a ton of templates that are only used for this chart but nowhere else.
Describe the solution you'd like
It will be nice to have the ability to point to a node without an entity_id:
sections:
- entities:
- entity_id: sensor.house_total
children:
- node.floor1
- node.floor2
- node.outdoors
- entities:
- node: floor1
children:
- sensor.airconditioner
- sensor.stove
- node: floor2
children:
- sensor.computer
- sensor.bedlight
- node: outdoors
children:
- sensor.floodlights
- entities:
- sensor.airconditioner
- sensor.stove
- sensor.computer
- sensor.bedlight
- sensor.floodlights
Describe alternatives you've considered
I created a dozen template entities that are sum of the values of various sensors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.