Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to show Discrepancies / Unknown / Unaccounted entities #2

Closed
Madelena opened this issue May 8, 2022 · 11 comments
Closed

Ability to show Discrepancies / Unknown / Unaccounted entities #2

Madelena opened this issue May 8, 2022 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@Madelena
Copy link

Madelena commented May 8, 2022

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😁

@MindFreeze
Copy link
Owner

I have actually been thinking about this since the beginning but it is not a priority.
It would be useful to show an 'Other' branch even if it not a discrepancy but just consumption/generation which is not monitored with a sensor.
I am still not 100% confident in the size calculations in order to do this but once these are stable it would be a cool feature indeed.

@MindFreeze
Copy link
Owner

added in v0.6.0

@tomlut
Copy link

tomlut commented May 23, 2022

I don't seem to be able to get this working correctly:

type: custom:sankey-chart
show_names: true
height: 300
round: 2
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.energy_to_grid_daily
          - sensor.self_solar_consumption_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: 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
  - 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'

Screenshot 2022-05-23 at 12-36-16 Overview – Home Assistant

@MindFreeze
Copy link
Owner

Remaining is an object with name and optional color. See the energy example in the readme

@MindFreeze
Copy link
Owner

Now that I think about it, this should actually be an error or working

@MindFreeze MindFreeze reopened this May 23, 2022
@emufan
Copy link
Contributor

emufan commented May 23, 2022

Other is working here, but is displayed wrongly:

image

Or is this the planned way?

@MindFreeze
Copy link
Owner

this doesn't look planned at all :)

@MindFreeze
Copy link
Owner

@tomlut try v0.6.1 . it should work with the config you posted

@tomlut
Copy link

tomlut commented May 24, 2022

Still the same. The calculated difference is way off:

Screenshot 2022-05-24 at 11-26-24 Overview – Home Assistant

I did clear my browser cache.

I also tried with the previously specified config:

type: entities
title: Daily Energy Distribution
entities:
  - type: custom:hui-element
    card_type: custom:sankey-chart
    show_names: true
    height: 300
    round: 2
    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.energy_to_grid_daily
              - sensor.self_solar_consumption_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: Other
            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
      - 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'
    card_mod:
      class: inline-card-no-border
card_mod:
  class: top-level-card

Same result.

There are a number of entities that are 0kWh and not shown in the final section. Could that be throwing off the calculation?

MindFreeze added a commit that referenced this issue May 25, 2022
@MindFreeze
Copy link
Owner

Found the problem. It was the conversion from kWh to Wh. Fixed in v0.6.2

@tomlut
Copy link

tomlut commented May 25, 2022

Yep all good now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants