This is a repo containing all the Micro Python code for the system described in this Medium.com post:
https://medium.com/@todbotts.triangles/homemade-baby-movement-monitor-our-journey-7f85db47a29
It's a crazy system, and I wouldn't necessarily recommend building one, but it works for us! You may find some of the code snippets in this repo useful (as the main class file, Operator.py, contains a function to display an html page via the ESP32 as a web server, and also update the page in realtime).
This is the code here in the repo, and (unfortunately), this is the actual very complex wiring of the ESP32 to go with the code:
I hope you can take what you need from this repo, thanks!