Working utility meter helpers

Hello,
I have created 2 helpers that will track my electricity/ day:

  • reverse active energy (get electricity from the net)
  • forward active energy (put electricity on the net)

I know my total electricity consumption per day in a sensor
I have a 5kWh battery for which I have sensors.

However, I would like to calculate how many times a second 5kWh battery can be charged over a month.

So if forward active energy is higher than 5kWh I can charge a second battery.

But I have no idea how I could create a ApexChart for this :frowning:
I have this simple chart for the moment:

type: custom:apexcharts-card
apex_config:
  chart:
    stacked: true
graph_span: 30d
span:
  end: day
show:
  last_updated: true
header:
  show: true
  title: kWh per dag
  show_states: true
  colorize_states: true
series:
  - entity: sensor.elek_op_net_zetten_per_dag
    type: column
    color: Green
    group_by:
      func: max
      duration: 1d
  - entity: sensor.elek_van_net_halen_per_dag
    type: column
    color: Red
    group_by:
      func: max
      duration: 1d