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

Passthrough and remaining_child_state #180

Closed icefest closed 3 months ago

icefest commented 3 months ago

Checklist:

Release with the issue: [v2.0.3]

Last working release (if known): N/A

Browser and Operating System: Chrome, windows11 home

Description of problem: Thanks heaps for bugfix #175,

Passthrough isn't fully working with remaining_child_state, As soon as there is a passthrough with remaining_child_state then it always as evaluating as the full 100% no matter what is actually remaining.,

image

unit_prefix: ''
round: 0
convert_units_to: ''
co2_intensity_entity: sensor.co2_signal_co2_intensity
gas_co2_intensity: 2351.6459999999997
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
sections:
  - entities:
      - type: entity
        children:
          - input_number.test_3
        entity_id: input_number.test_1
      - type: entity
        children:
          - input_number.test_3
          - remaining_parent
        entity_id: input_number.test_2
      - type: remaining_child_state
        children:
          - input_number.test_6
        entity_id: remaining_child
        name: Remaining Child
  - entities:
      - type: entity
        children:
          - input_number.test_4
        entity_id: input_number.test_3
      - type: passthrough
        entity_id: remaining_parent
        children:
          - remaining_parent
      - type: passthrough
        entity_id: input_number.test_6
        children:
          - input_number.test_6
  - entities:
      - type: entity
        children:
          - input_number.test_5
        entity_id: input_number.test_4
      - type: remaining_parent_state
        children:
          - input_number.test_6
        entity_id: remaining_parent
        name: Remaining Parent
      - type: passthrough
        entity_id: input_number.test_6
        children:
          - input_number.test_6
  - entities:
      - type: entity
        children: []
        entity_id: input_number.test_5
      - type: entity
        children: []
        entity_id: input_number.test_6
type: custom:sankey-chart
show_names: true
title: Testing Enviroment
min_state: 0

As opposed to moving the remaining_child_state to the third column:

image

height: 800
unit_prefix: ''
round: 0
convert_units_to: ''
co2_intensity_entity: sensor.co2_signal_co2_intensity
gas_co2_intensity: 2351.6459999999997
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
sections:
  - entities:
      - type: entity
        children:
          - input_number.test_3
        entity_id: input_number.test_1
      - type: entity
        children:
          - input_number.test_3
          - remaining_parent
        entity_id: input_number.test_2
  - entities:
      - type: entity
        children:
          - input_number.test_4
        entity_id: input_number.test_3
  - entities:
      - type: entity
        children:
          - input_number.test_5
        entity_id: input_number.test_4
      - type: remaining_parent_state
        children:
          - input_number.test_6
        entity_id: remaining_parent
        name: Remaining Parent
      - type: remaining_child_state
        children:
          - input_number.test_6
        entity_id: remaining_child
        name: Remaining Child
  - entities:
      - type: entity
        children: []
        entity_id: input_number.test_5
      - type: entity
        children: []
        entity_id: input_number.test_6
type: custom:sankey-chart
show_names: true
title: Testing Enviroment
min_state: 0

Javascript errors shown in the web inspector (if applicable):

Additional information:

MindFreeze commented 3 months ago

should work in the next version