@mfalkvidd Thank you for your valuable suggestions - they all look very relevant.
Perhaps I am overlooking something in the documentation, but I wonder if any existing controllers out there will get the node's relay outputs in the right state again after a node restart, if it always starts up in off state.
Besides that, how can I reliably detect communication in the node, such as I_HEARTBEAT/I_HEARTBEAT_RESPONSE? As far as I know, such internal messages do not arrive through the recieve(...) API function. I will need to see some incoming messages (also from existing controller implementations) - otherwise I would get timeouts.