flixlix / power-flow-card-plus

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

[BUG] Solar Zero Tolerance Effects Battery/Home Usage and Flow #405

Open AshGSmith opened 11 months ago

AshGSmith commented 11 months ago

Describe the bug When a zero tolerance is set on the solar entity it seems to alter the power flow on the card and won't show the power going to my batteries and instead increases my home usage figures.

To Reproduce Steps to reproduce the behavior:

  1. On the solar aspect of the card, set a zero tolerance level of 15.
  2. Return to the card and ensure there is battery usage (in my case, my batteries are being charged)
  3. Note that the battery usage doesn't show a flow going to the battery and the figure for the home usage has increased (examples in screenshots)

Expected behavior Adding a zero tolerance of 15 to solar should allow me to ensure that if HA thinks I'm currently generating 10w (due to a CT clamp inaccuracy) should show the value on the card as 0w.

Screenshots IMG_0213 IMG_0214

Smartphone (please complete the following information):

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

flixlix commented 11 months ago

Hey there, which version of the card do you have? I can't replicate this issue: Screenshot 2023-10-27 at 20 29 24 Before Solar Tolerance

Screenshot 2023-10-27 at 20 30 31 After Solar Tolerance

The only difference in the home consumption is the said 10W that were removed from the solar.

Can you supply me with some code so that I can debug further?

AshGSmith commented 10 months ago

Hey,

Sorry for the delayed response, I've been away and couldn't access HA for some reason!

I'm on the most up to date versions of the card (v0.1.8.1) and Home Assistant (2023.11.3).

The yaml is:

type: custom:power-flow-card-plus
entities:
  grid:
    entity: sensor.octopus_energy_electricity_20l3257244_1415735840005_current_demand
    display_state: two_way
    color_circle: true
    display_zero_tolerance: 20
  battery:
    entity: sensor.battery_power
    state_of_charg: sensor.battery_state_of_charge
    display_state: two_way
    color_circle: true
    state_of_charge: sensor.battery_state_of_charge
    state_of_charge_unit: '%'
    invert_state: true
    use_metadata: false
  individual1:
    entity: sensor.office_aircon_usage
    icon: mdi:air-conditioner
    color: '#80b8ff'
    name: Aircon
    color_icon: false
    display_zero: false
    secondary_info:
      unit_of_measurement: '%'
      unit_white_space: false
  home:
    entity: sensor.myenergi_hunter_avenue_home_consumption
    subtract_individual: true
    override_state: false
    secondary_info:
      entity: sensor.daily_load_total
      unit_of_measurement: kWh
      decimals: 2
  solar:
    name: Solar
    display_zero_state: true
    entity: sensor.pv_power
    secondary_info:
      entity: sensor.daily_solar_generation
      icon: ''
      unit_of_measurement: kWh
      decimals: 2
    display_zero_tolerance: 15
  individual2:
    name: EQB
    icon: mdi:car-electric
    display_zero: true
    inverted_animation: false
    show_direction: false
    calculate_flow_rate: false
    entity: sensor.myenergi_hunter_avenue_power_charging
    secondary_info:
      entity: sensor.ags_7x_state_of_charge
      unit_of_measurement: '%'
      unit_white_space: false
    color:
      - 58
      - 135
      - 254
    display_zero_state: true
  fossil_fuel_percentage:
    icon: ''
w_decimals: 0
kw_decimals: 2
min_flow_rate: 0.9
max_flow_rate: 6
watt_threshold: 1000
clickable_entities: true
display_zero_lines:
  mode: transparency
  transparency: 75
  grey_color:
    - 189
    - 189
    - 189
dashboard_link: ''
use_new_flow_rate_model: true
AshGSmith commented 7 months ago

Have you had any luck on this one? Is there anything I can do to help debug etc?