flixlix / power-flow-card-plus

A power distribution card inspired by the official Energy Distribution card for Home Assistant
557 stars 68 forks source link

Incorrect Example Config and Clickable Entities not working? #16

Closed sOckhamSter closed 1 year ago

sOckhamSter commented 1 year ago

H, I absolutely love the adaptations you've made to the power flow card, it really is brilliant thank you. I think I might have discovered a couple of bugs:

Incorrect example config? Your example config shows entities in list format:

  grid:
    production:
      - sensor.grid_out_power
    consumption:
      - sensor.grid_in_power
  solar:
    - sensor.solar_power
  battery_charge:
    - sensor.battery_state_of_charge
  battery:
    production:
      - sensor.battery_in_power
    consumption:
      - sensor.battery_out_power

But, I can only get the card to work in the old-style format:

  grid:
    production: sensor.grid_out_power
    consumption: sensor.grid_in_power
  solar: sensor.solar_power
  battery_charge: sensor.battery_state_of_charge
  battery:
    production: sensor.battery_in_power
    consumption: sensor.battery_out_power

Is that just a typo in the readme that needs correcting or did you intend to use a newer list-style configuration and it's a bug?

Clickable Entities not Clickable The Solar and Home bubbles don't open more-info dialogs when clicked for me. All of the other bubbles work fine, but I can't get solar and home to work. I've tried multiple different entities and browsers, is that a known bug?

Even with those issues, this is my new favourite power flow card :)

flixlix commented 1 year ago

Thank you very much for your feedback 😊, I am currently working on restructuring the code and the card config, since I also noticed a couple of bugs. Can we see if these bugs persist on your setup after I've pushed all the changes?

sOckhamSter commented 1 year ago

Not a problem at all, I'll keep me eyes on the updates and change logs :) Thank you.

xsirpreisx commented 1 year ago

It should work with the current version when set up like this:

type: custom:power-flow-card-plus
watt_threshold: 999
w_decimals: 0
clickable_entities: true
entities:
  battery:
    consumption: sensor.solar_battery_to_house_w
    production: sensor.solar_battery_in_w
  battery_charge:
    - sensor.solaredge_b1_state_of_energy
  grid: sensor.evcc_grid_power_w
  solar:
    - sensor.solar_panel_production_w
  fossil_fuel_percentage:
    entity: sensor.co2_signal_grid_fossil_fuel_percentage
    name: CO2-arm
    icon: mdi:leaf
    color: '#0f9d58'
    color_icon: false
    display_zero: true
    state_type: power
sOckhamSter commented 1 year ago

Yeah, I've just figured I have to mix and match the configuration between list and non-list depending on the item in order to get clickable to work, so home and solar must be list, grid and battery must not be list. I think best to wait until the whole configuration is standardised in an upcoming version though!

entities:
  home:
    - sensor.home_power
  grid: sensor.smart_meter_electricity_power
  solar:
    - sensor.solaredge_ac_power
  battery: sensor.givtcp_xxxxxxxxxx_battery_power
  battery_charge: sensor.givtcp_xxxxxxxxxx_soc
flixlix commented 1 year ago

@sOckhamSter can you check with the new configuration to see if the issue persists?

sOckhamSter commented 1 year ago

@flixlix Absolutely spot on perfect, thank you :) Took me a couple of minutes to reformat the configuration but your new layout makes a lot more sense and is nice and consistent throughout.