How should I graph a driveway monitor

I’m currently designing a driveway monitor that will be able to interface via ESPHome in one of several different ways - that part hasn’t been finalized yet. I can do it digitally via 4 GPIO pins or I can send the result via RS232. The output of the driveway monitor will be one of 4 states, VehicleEntered, VehicleExited, VehicleDetectedButDirectionUnknown, SensorAlive. I’m hoping the 3rd state doesn’t occur very often. The 4th state will occur every minute or so, to show that the sensor is still operational. I was thinking of of using MQTT to populate a database of some sort.

The question I have is how can I view the data within Home Assistant? I’d like to be able to look at something, preferably a graph, and see the history of when (date & time) a vehicle has enterer or exited. Does anyone have any suggestions?

If you’re curious about the sensor, I’m using a sensitive (MMC5983MA) magnetometer that’s mounted on a sturdy post next to the driveway. The sensor is rotated 45 degrees, so the vehicles end up passing through both the X and Y axis, that’s how I come up with the direction of travel depending on which axis is triggered first. It uses LoRa to transmit the trigger back to a base station which will probably connect to HA via a microcontroller programmed with ESPHome.

Any help is appreciated.

To answer my own post, in case someone else had a similar question… the easiest way was to use 4 digital inputs on an ESPHome board and label them each as a binary sensor, device class: motion. After that, I created a history stats in the configuration-yaml for each input so I’d know how many triggers there were in a day. Because it’s a motion class, HA creates a bit of a graph of when it’s triggered. The trigger count history just allows me to quickly look to see if any triggers have happened today.