Any tips for integrating OctoPrint with custom IoT sensors on my printer?

Has anyone here tried hooking up external sensors (for example a motion, temperature, or vibration sensor) to trigger notifications or actions within OctoPrint while printing? I came across this article https://www.theengineeringprojects.com/2024/08/which-is-better-3d-printing-or-cnc-machining.html which discusses 3D-printing and CNC workflows, and it made me think how I might extend my printer’s monitoring using an ESP32 or Raspberry Pi and integrate that with OctoPrint. I’ve also seen Arduino forum threads where users connect temperature sensors to trigger fans mid-print, and Raspberry Pi projects streaming print-camera data with MQTT for alerts — but I haven’t found many examples that tie sensors directly into OctoPrint’s control logic. Anyone done this and willing to share what worked (or didn’t) with sensor wiring, plugin usage, or notification setup?

I have a couple of MQTT based plugins that proxy commands to OctoPrint's API, and also a Tasmota plugin that can handle graphing sensor data and handle simple on/off type stuff. I think there's an SIO control plugin and it's reaction companion plugin.