Closed binc0 closed 4 years ago
Haven't tested it or anything, but this commit might help. Obviously you need to add your skybox-002 in appliances again. It won't work for any 'scenes' eg netflix, spotify etc, as then the endpointId becomes the scene name. If you wanted them, you could add them in appliances as well, with a different applianceId, and different friendly name. Then you could edit the code to something like:
if endpointID == 'skybox-002' or endpointID == 'skyq-netflix-2':
Hope that helps, let me know if it works.
I tried and I got this error:
channel_request: Sky Cinema Uno +24 HD /var/runtime/botocore/vendored/requests/api.py:64: DeprecationWarning: You are using the get() function from 'botocore.vendored.requests'. This dependency was removed from Botocore and will be removed from Lambda after 2020/03/31. https://aws.amazon.com/blogs/developer/removing-the-vendored-version-of-requests-from-botocore/. Install the requests package, 'import requests' directly, and use the requests.get() function instead. DeprecationWarning [INFO] 2020-02-04T00:19:41.992Z 9408a0a3-a3ee-410e-b9a3-e3e6df21d459 Starting new HTTPS connection (1): raw.githubusercontent.com plus_one_request: False 8866 21 8865 22 340 92 310 100 [Errno 111] Connection refused: error Traceback (most recent call last): File "/var/task/lambda_function.py", line 196, in lambda_handler response = handle_non_discovery(request) File "/var/task/lambda_function.py", line 427, in handle_non_discovery send_command(command, endpointId) File "/var/task/lambda_function.py", line 474, in send_command s.connect((environ['HOST'], port)) File "/usr/lib64/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) error: [Errno 111] Connection refused
Have you set environment variables called PORT and PORT_2, that are different numbers? Have you mapped those ports, one to each Sky box, in your router? You can test them both at https://repl.it/@ndg63276/PortForwardingTester - click run at the top.
Yes, I've set them and each one works.
Do you get that error for both, or just for one?
Found a silly typo when I tried it myself, should have given a different error, but make sure you change endpointID to endpointId on line 472.
Do you get that error for both, or just for one?
For both.
Found a silly typo when I tried it myself, should have given a different error, but make sure you change endpointID to endpointId on line 472.
I have already fixed it and the lambda test results gives that error.
This is event test:
{ "directive": { "header": { "namespace": "Alexa.ChannelController", "name": "ChangeChannel", "messageId": "<message id>", "correlationToken": "<an opaque correlation token>", "payloadVersion": "3" }, "endpoint": { "scope": { "type": "BearerToken", "token": "<an OAuth2 bearer token>" }, "endpointId": "skybox-002", "cookie": {} }, "payload": { "channel": { "number": "301" }, "channelMetadata": { "name": "Sky Cinema Uno HD", "image": "<url for image>" } } } }
How odd. Did it ever work with 1 device?
The message is connection refused, which suggests a problem at your end, nothing's really changed with the code, apart from the possibility of 2 devices.
Now it works perfectly I set PORT_1 instead that PORT_2
Found a silly typo when I tried it myself, should have given a different error, but make sure you change endpointID to endpointId on line 472.
Hi Guys. Just setting this up for the first time, and got caught out by this. The zip file in the root of the repo still has this typo in it.
I was able to find the problem by looking in the logs (thanks for the Cloudwatch links in other issues!), so no worries. I thought it best to let you know, though.
Thanks for all the great work. Looking good so far!
Thanks @swythan , have fixed the typo in the zip file now (hopefully!)
Hey there would be possible to use two Sky Q devices ?
I tried to use this code but it doesn't work well as I'm new to python:
I added the second device in appliances and it works fine alone but I'm unable to control both using the up code.