flixlix / power-flow-card-plus

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

[BUG] secondary_info completely ignored #422

Closed mkanet closed 12 months ago

mkanet commented 12 months ago

Describe the bug I have enabled secondary_info as described in the readme.md, but they are being completely ignored in my card code. Please look at the items below in my card code. I am beginning to think I'm doing something fundamentally wrong. It seems only the most basic features work as expected. Even the color: #964cb5 line is ignored. In addition to display_zero_lines being ignored. I am hoping there's an easy fix to all the items that are being ignored in the card config. image

secondary_info: sensor.pge_electric_cost_to_date
secondary_info: sensor.openweathermap_cloud_coverage

I have installed the latest version from HACS. v0.1.8.1

My card code is:

type: custom:power-flow-card-plus
entities:
  grid:
    entity:
      consumption: sensor.apf_grid2house
      production: sensor.apf_batt2grid
    secondary_info: sensor.pge_electric_cost_to_date
    display_state: one_way
    color_circle: true
    color_icon: true
    display_zero_lines:
      mode: hide
  solar:
    entity: sensor.apf_solar2grid
    secondary_info: sensor.openweathermap_cloud_coverage
    color_icon: true
    display_zero_lines:
      mode: hide
  battery:
    entity:
      consumption: sensor.apf_batt2house
      production: sensor.apf_solar2batt
    state_of_charge: sensor.mka_net_charge
    display_state: one_way
    color: '#964cb5'
    color_icon: true
    color_circle: true
    display_zero_lines:
      mode: hide
  home:
    color_icon: true
    display_zero_lines:
      mode: hide
watt_threshold: 800
w_decimals: 1
min_flow_rate: 3.5
max_flow_rate: 6

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

flixlix commented 12 months ago

Your card config is incorrect, please add the entity property to secondary info:

type: custom:power-flow-card-plus
entities:
  grid:
    entity:
      consumption: sensor.apf_grid2house
      production: sensor.apf_batt2grid
    secondary_info:
      entity: sensor.pge_electric_cost_to_date
    display_state: one_way
    color_circle: true
    color_icon: true
    display_zero_lines:
      mode: hide
  solar:
    entity: sensor.apf_solar2grid
    secondary_info:
      entity: sensor.openweathermap_cloud_coverage
    color_icon: true
    display_zero_lines:
      mode: hide
  battery:
    entity:
      consumption: sensor.apf_batt2house
      production: sensor.apf_solar2batt
    state_of_charge: sensor.mka_net_charge
    display_state: one_way
    color: '#964cb5'
    color_icon: true
    color_circle: true
    display_zero_lines:
      mode: hide
  home:
    color_icon: true
    display_zero_lines:
      mode: hide
watt_threshold: 800
w_decimals: 1
min_flow_rate: 3.5
max_flow_rate: 6
mkanet commented 12 months ago

Thank you so much for showing me what I did wrong. I now know.