How to create a publically available Node-Red https endpoint

Hello :upside_down_face:

I'm a complete novice when it comes to node-red, so please be patient.

I'm trying the following, I'm using home-assistant with the node-red addon, a guide on how to connect my alexa skill to a Node-Red endpoint says I should create a "publically available Node-Red https endpoint". and then specify this endpoint URL in my skill so that Home Assistant can communicate with the skill in connection with Node-red.

Now my question how do I create the "publically available Node-Red https endpoint" in node-red?

Maybe someone can help me there?
Thanks very much

There are a few topics on this subject on the forum. here is one Node-red server with nginx reverse proxy howto guide

I would ask what skill? There are alexa nodes you can install on node red to access routines and skills directly without opening up you node-red to the internet. node-red-contrib-alexa-remote2-applestrudel (node) - Node-RED

1 Like

okay the method with the nginx proxy is too much for my usecase.

the skill is very easy it makes this , it takes the spoken (media_name) to a integration in homeassistant where the play command is triggered, and sends a answer to the skill if its usefull or not, that the alexa can answer.

here is the interaction model for the skill

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "plex to",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.NavigateHomeIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.FallbackIntent",
                    "samples": []
                },
                {
                    "name": "play",
                    "slots": [
                        {
                            "name": "Slot",
                            "type": "Plex"
                        }
                    ],
                    "samples": [
                        "play {Slot}"
                    ]
                }
            ],
            "types": [
                {
                    "name": "Plex",
                    "values": [
                        {
                            "name": {
                                "value": "test"
                            }
                        }
                    ]
                }
            ]
        }
    }
}

i try to explain.

Command thats triggered

{ "action": "call_service", "service": "plex_assistant.command", "command": "play {{{payload}}}" }

Alexa, play (media_name)
or
Alexa, play (media_name) on (media_device)

the flow from another user looks like this


here is the code

[
    {
        "id": "2d93f2f4.c80aae",
        "type": "tab",
        "label": "Plex Assistant",
        "disabled": false,
        "info": ""
    },
    {
        "id": "b9e6afa4.e2156",
        "type": "http in",
        "z": "2d93f2f4.c80aae",
        "name": "Alexa",
        "url": "Alexa",
        "method": "post",
        "upload": true,
        "swaggerDoc": "",
        "x": 130,
        "y": 220,
        "wires": [
            [
                "4ac2af84.ed71e",
                "ff5c7185.eed27",
                "b8d847c2.e9e2c8"
            ]
        ]
    },
    {
        "id": "dac66814.75d678",
        "type": "http response",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "statusCode": "200",
        "headers": {},
        "x": 580,
        "y": 380,
        "wires": []
    },
    {
        "id": "7ad3cb5c.be9554",
        "type": "http request",
        "z": "2d93f2f4.c80aae",
        "name": "To Plex assistant",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "PUT WEB HOOK HERE",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 890,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "2e6626a3.1e315a",
        "type": "change",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.request.intent.slots.Slot.value",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 520,
        "y": 200,
        "wires": [
            [
                "c170bcb3.f7c22"
            ]
        ]
    },
    {
        "id": "ff5c7185.eed27",
        "type": "debug",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 750,
        "y": 80,
        "wires": []
    },
    {
        "id": "c170bcb3.f7c22",
        "type": "template",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{ \"action\": \"call_service\", \"service\": \"plex_assistant.command\", \"command\": \"play {{{payload}}}\" }",
        "output": "json",
        "x": 700,
        "y": 200,
        "wires": [
            [
                "ff5c7185.eed27",
                "7ad3cb5c.be9554"
            ]
        ]
    },
    {
        "id": "4ac2af84.ed71e",
        "type": "switch",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "property": "payload.request.intent.name",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "play",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 350,
        "y": 200,
        "wires": [
            [
                "2e6626a3.1e315a"
            ]
        ]
    },
    {
        "id": "b8d847c2.e9e2c8",
        "type": "template",
        "z": "2d93f2f4.c80aae",
        "name": "Amazon response",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\n  \"version\": \"string\",\n  \"sessionAttributes\": {\n    \"key\": \"{{payload.session.sessionId}}\"\n  },\n  \"response\": {\n    \"outputSpeech\": {\n      \"type\": \"PlainText\",\n      \"text\": \"Trying to play your media\",\n      \"playBehavior\": \"REPLACE_ENQUEUED\"      \n    },\n    \"shouldEndSession\": true\n  }\n}",
        "output": "json",
        "x": 340,
        "y": 320,
        "wires": [
            [
                "80832d4a.20b4b",
                "dac66814.75d678"
            ]
        ]
    },
    {
        "id": "80832d4a.20b4b",
        "type": "debug",
        "z": "2d93f2f4.c80aae",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 620,
        "y": 320,
        "wires": []
    }
]

is it possible to use the alexa-remote2-applestrudel node?

i hope i explaint it right, this are my first steps with node red.

The remote2 nodes should be able to send text commands to alexa, so you should be able to send alexa play <media name> or any variant of any command you would normally say to alexa. You can also make alexa say anything you wish. Install it and have a look at the routine node.

hello,

i installed it, and configured it how the wiki says, but i want not to send any text to alexa, i want to say to alexa

Alexa, play (media_name) and grap the spoken (media_name) and send it to my "plex_assistant.command".

is this still possible?

Should be possible, but why not install plex skill on alexa and then send text commands direct to the skill. plex skill commands Alexa Voice Commands | Plex Support

can you help me by creating this? with node red?

I tried the original skill, unfortunately there are several reasons why I can't use it, but the main reason is the following, the original plex skill has a huge bug and if you start something via the original skill, it won't appear in the Plex Dashboard (server ) registered.
That means plex or the server does not notice that something is running, which leads to various problems, on the one hand I have my home assistant running, which monitors the plex player status and reacts to it.
so all my automations no longer work.

For example light on, or when there is no more movement everything off, etc etc

You would use the text commands to instruct plex at that time you would store plex state and light states You have to create the automations you wish.

Once you have constructed something I and others would help as best we can with issues you find along the way. I do not use plex or HA so I can only offer advise on logic, you would need to provide input and output messages or small test flows as I and others will not have access to your info.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.