Getting a JSON message from an external server into Node-Red

I am playing with a new approach to get Alexa devices interacting with my NR setup. Instead of using the alexa-remote2-applestrudel module I write my own Alexa skill and attach it to my endpoint. I managed to accomplish this using my Synology NAS which has a public domain user_xx/ using a LetsEncrypt certificate which is accepted by Alexa.
For now my endpoint is a simple php script at:

where I can receive JSON formatted messages triggered by my skill. However I dont want to do the processing with PHP but rather "channel" the Alexa message to my NR rapspberry installation, process the data and send back a proper Alexa response.

My question is not so much on the Alexa processing but I wonder how this "channeling" might work? Of course the NAS is the only LAN device with public access, my Raspberry is only reachable with a local 192.168.178.xx adress

Is this feasible? Using the http-request, http-in modules somehow?

A lot of people use MQTT with NR IOT flows.

You could have your NAS publish the incoming messages to an MQTT server on the Pi, and subscribe to topics to receive messages back from NR to forward back to amazon.
PHP then only needs minimal functionality.

Actually, I had the same idea 1 hour before reading your post :wink:
Working with MQTT is straightforward in NR. I already managed to send MQTT message from the PHP script. :grinning:

1 Like