Energy Dashboard: Realtime Energy Distribution

Hey there’s a lot that goes in to building the entities for this dashboard. Since posting this I’ve changed it a fair bit - partly due to performance issues with my then setup (pi 3B+) and also to simplify the view a little. I’ve now changed to a HA yellow and I’ve been redo-ing this dashboard so I don’t really have working code for the full view to share right now until I fix it up how I like it. Is there a particular part you’re looking for?

The two main charts code is here:

    cards:
      - type: vertical-stack
        cards:
          - type: custom:apexcharts-card
            graph_span: 24h
            stacked: true
            update_interval: 30s
            all_series_config:
              stroke_width: 1
              unit: kW
              curve: smooth
              opacity: 1
              group_by:
                func: avg
                duration: 30s
                fill: zero
              type: area
              invert: true
              fill_raw: zero
              extend_to: now
              transform: return x / 1000;
              show:
                legend_value: false
            color_list:
              - '#7bc043'
              - '#0392cf'
              - '#1a936f'
              - '#c6dabf'
              - '#4071ed'
              - purple
              - orange
              - brown
              - pink
              - cyan
              - blue
              - '#6F4E37'
              - '#71797E'
            apex_config:
              chart:
                height: 175%
            span:
              start: day
            header:
              show: true
              title: Power Today
            series:
              - entity: sensor.solar_power_corrected_1m
                name: Generation
                type: line
                invert: false
                fill_raw: 'null'
                group_by:
                  func: raw
              - entity: sensor.grid_export_power_1m
                name: Export
                invert: false
                type: line
                fill_raw: 'null'
                group_by:
                  func: raw
              - entity: sensor.twc_charger_load_always_w
                name: EV Charger
              - entity: sensor.hot_water_system_supply_switch_0_power
                name: Hot Water
              - entity: sensor.fridge_current_consumption
                name: Fridge
              - entity: sensor.arlec_sw_washer_power
                name: Washer
              - entity: sensor.arlec_sw_dryer_power
                name: Dryer
              - entity: sensor.sw2_tvmedia_power
                name: Media
              - entity: sensor.eko_sw_dishwasher_power
                name: Dishwasher
              - entity: sensor.eko_sw_study_power
                name: Study
              - entity: sensor.ac_power_total_corrected
                name: Air Con
              - entity: sensor.arlec_sw_coffee_power
                name: Coffee Machine
              - entity: sensor.unmonitored_power
                name: Other
            yaxis:
              - id: first
                decimals: 0
                show: true
                apex_config:
                  forceNiceScale: true
                  title:
                    text: kW
          - type: custom:apexcharts-card
            apex_config:
              chart:
                height: 175%
            graph_span: 24h
            update_interval: 30s
            all_series_config:
              curve: smooth
            span:
              start: day
            header:
              show: true
              title: Cost Today
              show_states: false
              colorize_states: true
            yaxis:
              - id: first
                decimals: 0
                apex_config:
                  title:
                    text: $
                  forceNiceScale: true
            series:
              - entity: sensor.instant_cost_per_hour_1m
                name: Instant Cost Per Hour
                stroke_width: 1
                unit: $/h
                extend_to: now
                fill_raw: zero
                show:
                  legend_value: false
              - entity: sensor.today_energy_total_cost
                name: Daily Cost Accumulated
                type: area
                fill_raw: last
                show:
                  legend_value: false
                stroke_width: 1
                unit: $
                extend_to: now
                float_precision: 2

Take a look at this thread: Using Home Assistant to calculate my energy bill using data from my Solar Inverter
It goes in to the detail of how many of those entities are built. Obviously you’ll need to change a lot of this to suit your entities.

2 Likes