I am trying to act on events generated by another platform on the same LAN as my node red server.
I can’t access the remote data directly, but I can use an event to trigger a script over ssh.
I could write something to a directory on the node red server and check this periodically, but is there a ready-made node that can receive such data directly?
I'm using Apple's Shortcuts app to "run script over ssh". Therefore, I can within reason produce any output at the node red server side. I might struggle with passing arguments unless I have multiple scripts.
Starting with something simple, a device turns ON. The script could simply be echo "on" > ~/state and I could then periodically interrogate the contents of ~/state.
@bakman2 I'm not too worried about security as it's all contained in my secure LAN. Whilst I couldn't send mqtt from the remote, I could publish it on the NR server. Perhaps that's the way I should go?
You can in shortcuts, send a HTTP request, and include a body or even headers.
setup a HTTP IN node in Node RED and get your Shortcut to send to it via the HTTP action in Shortcuts.
You then act on that in Node RED - and Evan consume its body/headers
It's a native device. I could create a shadow device in NR and trigger state to match that of the real one, but that seems a little cumbersome.
More specifically: I have five windows that are controlled by Velux Active as native HomeKit devices. Clearly, if I have opened or closed a window myself I know what state it's in; but Active uses its own sensors to 'decide' when to operate them. I have a degree of control over what it does, but the algorithm is proprietary.
(BTW there are various attempts at integrating Velux with node red and/or homebridge using yet another piece of Velux hardware. None of these is reliable and the developers seem to have abandoned them.)
I can use the Velux window opening or closing as a trigger. However - and this is probably me being stupid - I can’t see HTTP request option in Shortcuts.
Ah! OK. ISTR something about that now. It sounds like the opposite of what I want (to me) - so that confirms it was me being stupid
So far as Discord goes, very probably. I can’t honestly say I recall speaking to you, but I tend to think up something I’d like to do and pursue as many options as necessary - until I jump to the next one.
When the window opens (from being closed) the open trigger fires and I get the POST in Node RED. The same is true for the reverse, but what I can't capture is the extent to which the window is opened once it stops moving. (Often it will do something like moving from 70% to 7% so that the room is sealed from rain, but is still being trickle ventilated. As this is moving from one open state to another, there is no trigger.)