Hey @alex.moraru , thanks for posting!
This is a great use-case - happy to hear that you’re finding the Phidgets relay useful.
If I’m understanding right, the issue is that you would like the Andon light (from node-red) to reflect the Machine State that exists in Tulip. There are two options here that I can see:
-
Drive everything within node-red. As you correctly state, importing trigger logic to node-red is not ideal, but is possible. However, if you are changing your andon light based on logic within node-red this will be the fastest way to see a result as all logic is running locally on the Edge Device. If you only have three states, I don’t think this logic should be too difficult to re-create: I could even see it possibly done with a single
function
node. -
Drive information back from Tulip to Node-RED. In order to do this, you need something, in Tulip, to send a message back to Node-RED. This is done with a Connector (see this guide), or by writing to a Tulip Table that the Node-RED flow is checking every so often via the Tables API.
Classically, you need an app to be doing this - all logic has to live inside apps. So, you need an app somewhere that sees the state has changed, and either makes the Connector call or Tables write manually.
Does this help? If it was me, I would recommend simply doing this in node-red to save the headache. It should only take a few nodes - fork off of your existing nodes to just add another action - so now, it’s “send state to tulip” and “control andon”. Shouldn’t be that complex.