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.