Binary sensor summarize on state

Hi
I have used the ping feature to check if my son’s ps5 is online or not. So every 5 minutes I ping the console. and I get a history card and se the logbook and can se the durations for every state change. Is there any way to get this in to a ApexCharts-card so I can se sum av time the devices is in state on?

sensor:
  - platform: history_stats
    name: Playstation Time On Today
    entity_id: sensor.playstation_ping
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"