[ANNOUNCE] node-red-contrib-lsh-logic - a stateful orchestration node extracted from a real home automation stack

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.


Wow looks good - i am just in the process of moving some of my logic and control from Node Red into Home Assistant so this looks like it could be a good central glue !

Will give it a go and report back

Craig

Thanks, I appreciate it.

Just to clarify one important point: the node is built around the LSH ecosystem and its protocol, so it is not meant as a completely generic drop-in automation node.

That said, the hardware itself is not the important boundary. In my own installation it sits on top of Controllino + ESP32 bridges, but the Node-RED side is really built around the public LSH protocol and MQTT contract.
So if someone implements that same protocol on different hardware, the node should work there too.

If you give it a try, I would really appreciate feedback, especially on what feels too LSH-specific or unclear from the outside.

EDIT: I realized that point was not explicit enough, so I have already updated the README to clarify that the node is LSH-oriented by design, but the real dependency is the public protocol/MQTT contract rather than the original Controllino + ESP32 hardware itself.

Using this term might be confusing ---- https://investinholland.com/doing-business-here/industries/life-sciences-health/

I have no idea who was first - the hen or the egg - but it might be a good idea to clarify better

BTW is the Labo Smart Home ecosystem protocol & documentation fully open, public and free to use?

1 Like

Good catch, and yes, that is a fair point.

I had been using “LSH ecosystem” as shorthand for “Labo Smart Home”, but I can see how that acronym is ambiguous in other contexts. I will probably switch to “Labo Smart Home stack” or “LSH protocol stack” in public-facing text to make it clearer.

And yes: the public side is meant to be open, public, and free to use. The protocol, documentation, and reusable repositories are public and released under Apache 2.0.

What is still private is only the installation-specific composition and deployment side of my own house: panel mapping, naming, OTA/deployment details, and similar things.

I also realized the hardware/protocol boundary was not explicit enough, so I have already updated the README to clarify that the Node-RED side is LSH-oriented by design, but its real dependency is the public protocol/MQTT contract rather than the original Controllino + ESP32 hardware itself.

Just for extra context, this was roughly what one of the more advanced pre-package Node-RED iterations looked like before I collapsed the logic into the current TypeScript node.

This was already far from the earliest version, but it still had the same underlying problem: too much stateful logic spread across multiple flow segments, too many implicit boundaries, and too much friction when trying to evolve it safely.

That is what eventually pushed me to turn it into a single node with a clearer runtime model, config validation, file/UI configuration, and test coverage.

So the dedicated node was not about “moving away from Node-RED”, it was more about making this part of the system easier to use, easier to adopt, and easier to reason about from the outside.

1 Like