Hi all,
I wanted to share a Node-RED node that I finally extracted and published after years of using it inside my own home automation setup.
The broader project started during a house renovation about seven years ago, and for a long time a lot of the coordination logic lived directly in Node-RED flows.
That worked for a while, but over time the weak points became obvious: too much implicit state, too much logic spread across visual wiring, and not enough confidence when changing behavior safely.
So I gradually pulled the more stateful and fragile parts inward until they became a dedicated node, and eventually a published package:
It is also published on the official Node-RED flows catalog, so it can be installed directly from the Palette Manager or with npm:
npm install node-red-contrib-lsh-logic
What the node does:
- keeps a registry of device state
- monitors device health with a watchdog model
- handles dynamic MQTT subscription updates
- implements distributed click logic / two-phase style coordination
- generates Home Assistant discovery payloads for the underlying devices
In practice, it is aimed at MQTT-heavy, stateful automation setups where Node-RED is doing more than simple glue logic.
It is written in TypeScript, covered by tests, and came out of a real installation rather than a greenfield package design.
The installation behind it uses wired controllers, ESP32 bridges, MQTT, Homie, and Home Assistant on top, but this package is the Node-RED part I most wanted to make reusable.
The reason I finally published it is that I did not want it to remain a one-off internal component. I suspect many people eventually hit the same point: flows are still the right place for orchestration, but some categories of logic want stronger structure, explicit state, and tests.
Broader project entry point:
I am posting it here not just to show it, but because I would genuinely like other people to inspect it, try it, and possibly adopt parts of the approach if they have similar MQTT-heavy or stateful automation setups.
If you have gone through the same transition, from increasingly complex flows to custom nodes or more structured components, I would really like to hear how you approached it.
And if anyone tries this package, I would be very interested in hearing what is still unclear, missing, or awkward from the point of view of an external user rather than the original author.


