I wrote an API for the app that runs in the Homey app process/container itself.
And there are already options for the process itself (such as uncaughtException), but I didn’t pursue this because I didn’t think Athom would be very happy about it and I wanted my app to be published.