E-bikers have been using a system not only to monitor everything, but interestingly enough, to limit curent to save the ESC and to propose a voltage cut-out to save the battery
There are many brands. That’s one, not tested by me
https://sdebike.com/product/cycle-analyst-dp-direct-plug-in/