flixlix / power-flow-card-plus

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

combined entities not handling negative flows #50

Closed arrikhan closed 1 year ago

arrikhan commented 1 year ago

Combined entities when a flow is positive/negative are not treated as inward/outward flows on flow-card respectively.

Negative flow on grid should show feed in from either battery or solar but it shows as an outward flow of negative number. the same occurs for battery. (see pic)

image

Config being used for combined entities for power on Fronius Smartmeter and Telsla Powerwall.

title: Power Flow
entities:
  grid:
    entity:
      consumption: sensor.solarnet_power_grid
  solar:
    entity: sensor.solarnet_power_photovoltaics
  battery:
    entity:
      consumption: sensor.powerwall_battery_now
    state_of_charge: sensor.powerwall_charge
flixlix commented 1 year ago

Your code should look like this in your case since you are using combined entities

title: Power Flow
entities:
  grid:
    entity: sensor.solarnet_power_grid
  solar:
    entity: sensor.solarnet_power_photovoltaics
  battery:
    entity:
      consumption: sensor.powerwall_battery_now
    state_of_charge: sensor.powerwall_charge

Does the issue persist?

arrikhan commented 1 year ago

This fixed the flows. Thanks for the advice.

I changed both Grid and Battery to straight entity: values.

image

entities:
  grid:
    entity: sensor.solarnet_power_grid
  solar:
    entity: sensor.solarnet_power_photovoltaics
  battery:
    entity: sensor.powerwall_battery_now
    state_of_charge: sensor.powerwall_charge