ndg63276 / alexa-sky-hd

A smart home skill for Alexa to control a Sky+HD or SkyQ box
33 stars 15 forks source link

Struggling to detect Skybox #28

Open random-robbie opened 2 years ago

random-robbie commented 2 years ago

Hey,

I've confirmed i can see my skybox via port foward remotelty but im struggling to detect the device in alexa.

So i've tried.

{
    "directive": {
        "header": {
            "messageId": "",
            "name": "Discover",
            "namespace": "Alexa.Discovery",
            "payloadVersion": "3"
        },
        "payload": {
            "scope": {
                "token": "",
                "type": "BearerToken"
            }
        }
    }
}

got

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": "de75f6b3-835c-4dad-b666-7d0a5eb6f694"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "skybox-001",
          "manufacturerName": "Sky",
          "friendlyName": "skybox",
          "description": "Sky Digibox",
          "displayCategories": [
            "TV"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.PowerController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "powerState"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ChannelController",
              "version": "1.0",
              "properties": {
                "supported": [
                  {
                    "name": "channel"
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.PlaybackController",
              "version": "1.0",
              "properties": {},
              "supportedOperations": [
                "Play",
                "Pause",
                "Rewind",
                "FastForward",
                "Stop"
              ]
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.KeypadController",
              "version": "3",
              "keys": [
                "INFO",
                "MORE",
                "SELECT",
                "UP",
                "DOWN",
                "LEFT",
                "RIGHT",
                "PAGE_UP",
                "PAGE_DOWN",
                "PAGE_LEFT",
                "PAGE_RIGHT"
              ]
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skybox-tvguide",
          "manufacturerName": "Sky",
          "friendlyName": "TV Guide",
          "description": "Sky TV Guide scene via Sky Digibox",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skyq-netflix",
          "manufacturerName": "Sky",
          "friendlyName": "Netflix",
          "description": "Netflix scene via Sky Q",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skyq-youtube",
          "manufacturerName": "Sky",
          "friendlyName": "YouTube",
          "description": "YouTube scene via Sky Q",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skyq-spotify",
          "manufacturerName": "Sky",
          "friendlyName": "Spotify",
          "description": "Spotify scene via Sky Q",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skybox-subtitles",
          "manufacturerName": "Sky",
          "friendlyName": "Subtitles",
          "description": "Sky Subtitles scene via Sky Digibox",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skybox-audio-description",
          "manufacturerName": "Sky",
          "friendlyName": "Audio Description",
          "description": "Sky Audio Description scene via Sky Digibox",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        },
        {
          "endpointId": "skybox-info",
          "manufacturerName": "Sky",
          "friendlyName": "Info",
          "description": "Sky Info scene via Sky Digibox",
          "displayCategories": [
            "SCENE_TRIGGER"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SceneController",
              "version": "3",
              "supportsDeactivation": true,
              "proactivelyReported": false
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": false
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

so looks like lambda is working i've authed no issues

any suggestions?

ndg63276 commented 2 years ago

So what happens? Just no device discovered in the app?

random-robbie commented 2 years ago

Correct at the moment nothing detected app wise.

random-robbie commented 2 years ago

Payload is V3 and the endpoint is correct lambda from what i can see.

can see SKY 000.001 from a remote host and have no http in the env

ndg63276 commented 2 years ago

It's weird, because the discovery process doesn't actually talk to your Sky box, the code just fakes a response so that the Alexa app thinks a Sky box has responded.

If you go to Cloudwatch (https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#logsV2:log-groups) and look at the logs for the Sky box skill, and then re-run the discovery process, can you see if the lambda is doing anything? Obviously you will see logs for any time you have tested it in Lambda.

Then we probably need to look at how you have set up the skill part (https://developer.amazon.com/alexa/console/ask)

random-robbie commented 2 years ago

Ok so it looks like the lambda isn't being triggered when discovery takes place. I'll re check all settings in the app side but from my last look all should be fine.

Arn is there with no spaces from what I can see.

Is there a debug on the skills page that would show errors if unable to trigger arn

ndg63276 commented 2 years ago

Not that I know of.

In Lambda, if you go to Configuration and then Triggers, does it say Alexa Smart Home, followed by your Skill ID? eg mine says

Alexa Smart Home: 6d373399-0295-403c-9d3b-60d5453f35de
amzn1.ask.skill.6d373399-0295-403c-9d3b-60d5453f35de
random-robbie commented 2 years ago
Your Skill ID
amzn1.ask.skill.78ecaab2-fff0-40f8-b3c8-c9720aff4166

Default endpoint*
arn:aws:lambda:eu-west-1:455315562206:function:skybox

Alexa Smart Home: 78ecaab2-fff0-40f8-b3c8-c9720aff4166
amzn1.ask.skill.78ecaab2-fff0-40f8-b3c8-c9720aff4166
ndg63276 commented 2 years ago

Hmmm... not sure then.

In the Skill set up: Under "Models":

Under "Account Linking":

Have you enabled the skill in the app? Did you manage to "link" it ok?

random-robbie commented 2 years ago

Yep linking is fine it's just detecting the skybox which is weird.

all the settings look fine to me which is why i'm baffled to why it's not even trying to trigger the lambda.

i'll keep looking

BigDave70 commented 1 year ago

Can I ask a question

Is this correct, should the following entry be as shown

Scope: profile:user_id

Or should it be Scope: a specific number linked to my account

Ta

ndg63276 commented 1 year ago

The scope should literally be the text:

profile:user_id
BigDave70 commented 1 year ago

Cheers ndg for the ultra quick reply, i thought it was that but just needed to double check

I am struggling a bit with my SKY SR102 router, just trying to work out the opening / forwarding the port bit, any tips Not sure how to "Forward a random TCP port (eg 51111) to port 49160 on this IP address" on the SKY SR102

Cheers again Dave

ndg63276 commented 1 year ago

Here's a guide I found - https://openmyip.com/Sky-SR102-router-setup - it only mentions using a single port so use 49160. You can use my tester at https://replit.com/@ndg63276/PortForwardingTester to test if it has set up correctly.

edclark1994 commented 1 year ago

Hi all! Was there any solution for this? I've also just followed all the steps to the tee and also can't find my sky q box?

Appreciate your work on this though. Super cool if it works

BigDave70 commented 1 year ago

Hey ed, I did get mine to work using my SKY SR102 modem in the end, i couldnt use the port forwarding bit on the router as i couldnt get that to work, I also used NO-IP setup which seems to work well (just have to renew the free subscription every 30days)

what router you got? and did you use No-IP too