System Flow Card

February 22, 2023 ยท View on GitHub

hacs_badge GitHub release (latest by date) GitHub Workflow Status GitHub all releases

This card for Home Assistant Dashboards is designed to provide system distribution in an identical style to the Official Energy Distribution card included by Home Assistant.

Screenshot 2023-02-17 at 1 46 52 AM

Install

This card is available in HACS (Home Assistant Community Store). HACS is a third party community store and is not included in Home Assistant out of the box.

Manual install

  1. Download and copy system-flow-card.js from the latest release into your config/www directory.

  2. Add the resource reference as decribed below.

Add resource reference

If you configure Dashboards via YAML, add a reference to system-flow-card.js inside your configuration.yaml:

resources:
  - url: /local/system-flow-card.js
    type: module

Else, if you prefer the graphical editor, use the menu to add the resource:

  1. Make sure, advanced mode is enabled in your user profile (click on your user name to get there)
  2. Navigate to Settings -> Dashboards
  3. Click three dot icon
  4. Select Resources
  5. Hit (+ ADD RESOURCE) icon
  6. Enter URL /local/system-flow-card.js and select type "JavaScript Module". (Use /hacsfiles/system-flow-card/system-flow-card.js and select "JavaScript Module" for HACS install if HACS didn't do it already)

Using the card

I recommend looking at the Example usage section to understand the basics to configure this card. (also) pay attention to the required options mentioned below.

Options

Card options

NameTypeDefaultDescription
typestringrequiredcustom:system-flow-card.
titlestringShows a title at the top of the card.
systemobjectDefine parameters of the central System element, see system object for additional system element options.
elementsobjectrequiredOne or more sensor entities, see element object for additional entity options.
speedstring5Define the average time (s) for dots to travel.
fadeIdylElementsstringFade elements that are not currently producing or consuming.

System object

The system is essentially an element object. The value is calculated from the difference in providers and consumers in the system (a positive value shows net unaccounted for production). This element has a central position.

NameTypeDefaultDescription
unitstringentity unitDisplay unit for the element value
iconstringDisplay icon for the element
colorstringHex color for the element box
extraobjectExtra sensor values to display within the element box. See element extra object for additional extra options.

Element object

NameTypeDefaultDescription
valuestring / objectrequiredEntity ID of a sensor providing a state value, (positive values for element consumption) (unless the inverted option is set to true) or a split value object. See element value object for split value options.
unitstringentity.unitDisplay unit for the element value
positionstringrequiredPlacement of entity box. Must be either top left bottom or right
iconstringDisplay icon for the element
colorstringHex color for the element box
fillstringEntity ID of a sensor providing a state of 0 - 100 (%) fill of the element box
invertbooleanfalseInvert element value for the system flow calculation
excludebooleanfalseExclude element value from the system flow calculation
extraobjectExtra sensor values to display within the element box. See element extra object for additional extra options.

Element value object

NameTypeDescription
fromSystemstringEntity ID of a sensor providing a state value for consumption
toSystemstringEntity ID of a sensor providing a state value for production

Element extra object

NameTypeDescription
mainstringEntity ID of a sensor providing a state value to display. The sensors entity.unit will be displayed.
leftstringEntity ID of a sensor providing a state value to display. The sensors entity.unit will be displayed.
rightstringEntity ID of a sensor providing a state value to display. The sensors entity.unit will be displayed.

Example usage

My Latest Example

For those testing, here is my current config:

type: custom:system-flow-card
speed: 3
fadeIdylElements: true
system:
  unit: W
  icon: mdi:rv-truck
  extra: sensor.indoor_govee_temperature
  color: '#0089b6'
elements:
  - value: sensor.victron_multiplus_activein_l1_power_238
    icon: mdi:power-socket-au
    position: left
    color: '#B62D00'
    extra:
      main: sensor.victron_multiplus_state_238
      left: sensor.victron_multiplus_activein_l1_voltage_238
      right: sensor.victron_multiplus_activein_l1_current_238
  - value: sensor.victron_alternator_power
    icon: mdi:engine
    position: left
    color: '#f67828'
    extra:
      left: sensor.victron_alternator_battery_voltage
      right: sensor.victron_alternator_battery_current
  - value: sensor.victron_battery_power
    invert: true
    icon: mdi:car-battery
    extra:
      main: sensor.victron_system_battery_soc
      left: sensor.victron_system_battery_voltage
      right: sensor.victron_system_battery_current
    fill: sensor.victron_system_battery_soc
    position: bottom
    color: '#3FF628'
  - value: sensor.victron_solar_pv_power
    icon: mdi:solar-power-variant
    extra:
      main: sensor.victron_solar_yield_today
      left: sensor.victron_solar_pv_voltage
      right: sensor.victron_solar_pv_current
    position: top
    color: '#F6DF28'
    fill: sensor.solar_effectiveness_today
  - value: sensor.victron_ac_consumption
    icon: mdi:power-plug
    position: right
    color: '#B62D00'
    invert: true
    extra:
      main: sensor.victron_multiplus_state_238
      left: sensor.victron_multiplus_out_l1_voltage_238
      right: sensor.victron_multiplus_out_l1_current_238
  - value: sensor.victron_dc_system_power
    invert: true
    icon: mdi:lightning-bolt-circle
    position: right
    color: '#0089b6'

Credits