I've just gotten my Omega 2 board today, and I'm thinking along very similar lines — I want my Onion boards to either send MQTT messages when something happens to their connected hardware, or do something with that hardware according to MQTT messages received.

Like you (Sebastian), I see no point in running an MQTT broker on the device — the broker will be elsewhere; these are edge devices that should merely be MQTT clients.

I see you solved it by using some clever files and shell scripting. But did you consider using Python? From other threads, it looks like paho-mqtt can be installed for python, which should make it pretty easy (and possibly more efficient) to subscribe to topics and do stuff in response (or conversely, to publish MQTT messages in reaction to anything you can sense in Python).

Just wondering if I am somehow barking up the wrong tree, or whether this is a sensible way to do it.