How to create a binary and time-based dashboard card?

Have a look here, it does not come easy but likely a lot faster than creating different sql sensors

Best way to get Grafana chart into Lovelace card - Share your Projects! / Dashboards & Frontend - Home Assistant Community (home-assistant.io)