ulic75 / power-flow-card

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

watt_threshold and kw_decimals don't seem to be working #142

Closed iDontWantAUsername closed 1 year ago

iDontWantAUsername commented 1 year ago

Hi, I have the latest version of power-flow-card in HACS v2.6.1 however it doesn't seem like watt_threshold or kw_decimals options seem to be working, my entities are in watts:

type: custom:power-flow-card
entities:
  grid:
    consumption: sensor.active_import_from_grid
    production: sensor.active_export_to_grid
  solar: sensor.active_generation
  kw_decimals: 2
  w_decimals: 0
  watt_threshold: 800

However with ~300w being imported the values are still showing in kw and only 2 decimal places:

image

To confirm the sensor.import_from_grid has unit_of_measurement: W:

state_class: measurement
unit_of_measurement: W
icon: mdi:home-import-outline
friendly_name: Active Import from Grid
ulic75 commented 1 year ago

It looks like your indentation is off. YAML can be a pain. kw_decimals, w_decimals and watt_threshold should be at the top level like this:

type: custom:power-flow-card
entities:
  grid:
    consumption: sensor.active_import_from_grid
    production: sensor.active_export_to_grid
  solar: sensor.active_generation
kw_decimals: 2
w_decimals: 0
watt_threshold: 800
iDontWantAUsername commented 1 year ago

That was it, thank you