ndg63276 / alexa-sky-hd

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

Lambda #26

Closed darkbluedad closed 2 years ago

darkbluedad commented 3 years ago

recently got an email from Anazon regarding Lambda and I just ignored it as I didnt think it would affect my set up but I tried to change a channel for the first time in a few months yesterday and it wouldnt work - any idea if this is related?

ndg63276 commented 3 years ago

Very difficult to know what the problem is. The email might have been the end of Python 2.7 support, although I think the skill should still run. (https://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/)

First thing to test is your port forwarding, can you go to https://replit.com/@ndg63276/PortForwardingTester , and press the big play button. When it asks, put in the address of your dynamic dns, and then the port you are using. Hopefully it will say your settings are correct.

darkbluedad commented 2 years ago

Hello again - I recently upgraded to SKY Q and the channel changing is back working!
On a separate subject would it be possible possible to send a "Back" keypress using the Skill? The reason I am asking is that if the Q box is in standby and you turn it on, you can't change the channel until you get rid of the home page by pressing "Back" - I'm trying to ensure I get the channel I want when I turn on my outdoor speakers which are fed from a sonos connected to the sky box, which might be on standby, but I can't change the channel if the home page is on. Cheers

ndg63276 commented 2 years ago

Yes, the "Back up" button on SkyHD boxes is supported, and I imagine it's the same as the "back" button on SkyQ. If you are comfortable editing the python file, you could try adding a couple of lines after line 333, like this:

    if request_namespace == "Alexa.PowerController":
        response_name = "powerState"
        if request_name == "TurnOn":
            commands.append('sky')
            commands.append('sleep')
            commands.append('backup')
            value = "ON"

That will send the "back" button 1s after turning the box on, so it might be a bit quick. Give it a try and see how you get on.

darkbluedad commented 2 years ago

Many thanks - I guess if it is too quick I can add another 'sleep' Cheers

ndg63276 commented 2 years ago

Yes, absolutely. Each one is 1 second.

darkbluedad commented 2 years ago

Thanks again! Will give it a go

darkbluedad commented 2 years ago

It works! Thank you very much. I guess in theory I could insert a line to set the channel in there as well? I noticed the lines

request_name == "Stop": commands.append("backup")

Does that mean if i say "Select Stop on QTV" then it should send a back command?

I have called my sky box "QTV" to try and stop Alexa getting confused.
Alexa "Turn on SKY" seems to get interpreted as Alexa "What's on SKY"

Thanks again for the skill

ndg63276 commented 2 years ago

Yep, that's what should happen.

darkbluedad commented 2 years ago

Thanks very much