bklavet / Echo-skill-to-control-Directv

amazon echo skill that will control a networked Directv Receiver so that users can control Directv with their voice
18 stars 67 forks source link

DTV uses http GET, not POST #1

Closed vmweaver closed 7 years ago

vmweaver commented 8 years ago

I couldn't find a better way to comment on this. I am testing your code now, but I believe you should be using the GET method, not POST in you dtv api calls.

bklavet commented 8 years ago

Hello mawrew19, I believe at the time I tried Get as well, but did not have any luck. I was able to have the echo access the skill, and reply with the correct confirmation, but the skill would not send off the URL to the directv receiver. I was hoping for this to work without the need for a pc running as an end point. If you can figure this out, it would be a cool setup.

vmweaver commented 8 years ago

I was able to get this to work last night with my DTV box on the internet. Of course this doesn't have any type of security on it, so I will be working on some type of DMZ (RPi) system to provide a layer of security. Thanks for your work on this.

bklavet commented 8 years ago

Wow! that is exciting. All you had to do was change the POST to Get? I swear I tried that and saw no difference. I am super excited for you though! If you could do me a favor, set up a youtube video and drop me a link so I can see this happening! have a great one.

vmweaver commented 8 years ago

I will take a look at all of the files I have and compare to yours on github.

On Tue, May 17, 2016 at 11:41 AM, bklavet notifications@github.com wrote:

Wow! that is exciting. All you had to do was change the POST to Get? I swear I tried that and saw no difference. I am super excited for you though! If you could do me a favor, set up a youtube video and drop me a link so I can see this happening! have a great one.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-219778138

bklavet commented 8 years ago

Thanks mawrew19

bklavet commented 8 years ago

I think it has to be more to it than changing the POSTs to Gets. I updated my index to have GET instead of POST and uploaded to aws lambda, when I run tests on the Alexa skill simulator I don't get anything from lambda, do you get a confirmation message from lambda that alexa replies to? When your directv receiver executes a command does Alexa reply with an "okay"?

If it does perform the action with no voice response, that would be alright with me, and would help explain why I stuck to the POST and figured GET wouldn't work. If you aren't getting a reply..then things have to change a bit in the code.

vmweaver commented 8 years ago

I have mine completely working now. I have tweaked it a bit and will upload the code to github, but there were not many changes needed for functionality. I will also try to document my test case since that's something that took me some time to resolve.

Based on the the Skill, Alexa does not say okay or confirm anything (IIRC). I will also be looking to add channel selection to it.. so "Alexa, Tell TV to change to CNN" or "Alexa, Tell TV to Change to channel 230". I will put more info together and share once I tidy it up a bit.

On Wed, May 18, 2016 at 12:34 PM, bklavet notifications@github.com wrote:

I think it has to be more to it than changing the POSTs to Gets. I updated my index to have GET instead of POST and uploaded to aws lambda, when I run tests on the Alexa skill simulator I don't get anything from lambda, do you get a confirmation message from lambda that alexa replies to? When your directv receiver executes a command does Alexa reply with an "okay"?

If it does perform the action with no voice response, that would be alright with me, and would help explain why I stuck to the POST and figured GET wouldn't work. If you aren't getting a reply..then things have to change a bit in the code.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-220101411

bklavet commented 8 years ago

mawrew19! Please do put your working version to GitHub. I am really curious to see what you have going. Channel selection would be a great feature! I strayed away from this when I found the armzilla-bridge... I was able to put a handful of the url commands on a Rpi and have the echo do a few key things. The skill method is soo much more desirable do to it's expandability for voice commands, and having everything in lambda means no more resetting rpi when the power goes out. Please throw me a link here so I can try and keep up! Good Job!

vmweaver commented 8 years ago

Files updated...

bklavet commented 8 years ago

I added you as a collaborator so hopefully you will be able to make changes.

vmweaver commented 8 years ago

​updated...​

On Wed, May 18, 2016 at 9:27 PM, bklavet notifications@github.com wrote:

I added you as a collaborator so hopefully you will be able to make changes.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-220211991

bklavet commented 8 years ago

mawrew19 you are a genius! added your updated index file. Testing is working through the Alexa skill testing. Thanks for adding to the Readme file while this was all still fresh in your mind. can't wait to get home and try this out for real.

bklavet commented 8 years ago

I added some network presets to the index file A&E, AMC, Animal Planet, BET, Bravo, Comedy Central, C span, Cartoon Network, Discovery, Disney Channel, Disney Junior, Disney XD, Food Network, FOX, FX, HGTV, History, Lifetime, MSNBC, MTV, MTV2, National Geographic, Nick Jr., Spike, SyFy, TBS, TNT, truTV, VH1, ESPN, and ESPN 2. also updated the sample utterances to reflect this.

I'm going to test this out at home, and if it works I will update the existing INDEX and Sample Utterances.

vmweaver commented 8 years ago

That's great!
I am also working on a tweak to specify any channel by number. Working well for me right now, but will need to do some more testing. Will require an update to the intent, utterances, and index and is a very simple change.

bklavet commented 8 years ago

I am hit and miss with the presets.... They test fine, but the utterance need more work. My accuracy with the skill is pretty bad. Hopefully your channel number search will be a lot better, since numbers are easier for Alexa to discern.

vmweaver commented 8 years ago

Will poke at it tomorrow and push an update. Will also look at you enhancements....

vmweaver commented 8 years ago

@bklavet

Updated Index, SampleUtterance, and Intents for changing channel by number.

"Alexa, tell TV (what I call mine) channel 220"

If you use the AWS Alexa Service Simulator you could put in:

"Tell TV channel two twenty"

We can add some utterances to make it more like "change to channel 220" or something like that.

Please test it out a let me know how it goes.

bklavet commented 8 years ago

Sorry about the delay in response, was out of town. I can't wait to test this out tomorrow, will let you know. so far looks really great!

Thanks

bklavet commented 8 years ago

AMAZON.NUMBERS. I wasn't able to find the documentation for this type. Do you have a link for it. I would like to read up on it. I am really impressed that the sample utterance can be so minimal. I will be trying this out tonight. Does this type decipher numbers that use "O" instead of "0"? I am one of those people that would say "2" "O" "2", instead of "2" "0" "2".

vmweaver commented 8 years ago

It converts spoken numbers in to real numbers.: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface search on the page for Amazon.numbers. No much info there, but should require some testing.

I think it will recognize "two two oh", "two hundred twenty", "two twenty" all as 220.

ChipHappens commented 8 years ago

Numbers understands both "oh" and zero"

bklavet commented 8 years ago

Thanks!, Just looking at this quickly... looks like the Literal type has been changed to AMAZON.LITERAL. Maybe the the sample utterances could be made more simplistic as well.
Backward Compatibility

_The LITERAL slot type continues to work. To continue using the old functionality, specify AMAZON.LITERAL for the slot type in the intent schema and leave the slot values within the sample utterances.

Migrating to a custom slot type is recommended, as it is easier to define the sample utterances and achieve better accuracy._

I really like how you added the slot "channel" to the intent. I am thinking that format for a network search, would be a much cleaner solution too.

I tested out the channel search and it is testing perfectly. I will try it out at home.
Really happy with how this is going. Thanks again.

vmweaver commented 8 years ago

My ideas on doing the channel by name is to use a custom slot type. More testing to do when my wife doesn't want to watch much TV.. ;-)

bklavet commented 8 years ago

mawrew19, was looking at the custom slot and that looks like a great idea. In fact that may work better for the remote control buttons too. I am going to mess around with a couple networks aswell and see how it goes.

ufccowboyfan commented 8 years ago

Have been following along with the youtube tutorial but don't know what to do with the port forwarding or DMZ. I have an apple extreme router but not very familiar with these options that are required for Alexa to talk to the Directv receiver. Any chance you can provide more step by step instructions on how to do that DMZ or portfoward to make this work. Thanks

bklavet commented 8 years ago

Ufccowboyfan,

First thing I would try, is to make sure you can control your receiver from within your lan. Fill in your ip (the directv's ip address) and place it in a browser address bar on a computer working on the same lan as your directv receiver. http://xxx.xxx.xxx.xxx:8080/remote/processKey?key=pause&hold=keyPress

This should pause the receiver. If that works, then replace the directv's ip with your wan ip, and try the command on a pc/phone that is on a different network. If it works, you don't need to worry about it. If it don't google your router and how to port forward.

bklavet commented 8 years ago

I did a search on apple and dmz, it looks like apple calls the dmz, the Default Host. May want to search that too! Good luck maybe try this if you can get into your router. For port mapping, I would suggest the following: •Service: leave default •Public TCP Port(s): 8080 •Public UDP Port(s): (leave blank) •Private IP Address: (this will be the IP address of your Directv receiver) •Private TCP Port(s): 80 •Private UDP Port(s): (leave blank>)

any luck?

mthom16 commented 8 years ago

Does this work with the DirectTV Genie and Genie Mini? If not what equipment do you have that works?

mthom16 commented 8 years ago

Ok. It did work on the Genie, but only the main box. I don't know if you can use it on the mini boxes.

bklavet commented 8 years ago

Mthom16 you will need to add the mac of the mini to the index file. Check out the issue How to control the mini genie.

bearrowb commented 7 years ago

thank you for all the details, this has been first skill and aws lamda use, because of all the work done, learning the skills and syntax seem to make sense now (somewhat) if you have many receivers or mini's, you will want to use DMZ for the main receiver all my mini are wireless child's to the parent, so the trick will be to give unique name to each, plus we need to get a the unique WVB client name or ID# or mac address, or whatever routes from receiver though WVB to mini, then we could enter custom lines with ip;8080;WVBpath# this would let us say "alexa DirectvMain to channel 202" and "alexa DirectvBedroom to Channel 201" see i have two echo's and a Dot so having Main controlled by Echo and bedroom by Dot would be nice. ------ then plan is solid the issue i have is the client list is just txt names in the main, look like DTV is has a hiding files for the name to path rule

bklavet commented 7 years ago

Hello, I’m not following. Your wireless minis that are connected to the main Genie should be controllable by the mac address or the clientAddr=[mac]. So to see what you have connected to the main and verify the mac address you would enter into a browser http://[lan_IP]:8080/info/getLocations this will/should show all the receivers and what the macs are. The one that shows as ‘0’ is the main Genie.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: bearrowbmailto:notifications@github.com Sent: Wednesday, December 28, 2016 12:02 PM To: bklavet/Echo-skill-to-control-Directvmailto:Echo-skill-to-control-Directv@noreply.github.com Cc: B moneymailto:brianklavetter@msn.com; Mentionmailto:mention@noreply.github.com Subject: Re: [bklavet/Echo-skill-to-control-Directv] DTV uses http GET, not POST (#1)

thank you for all the details, this has been first skill and aws lamda use, because of all the work done, learning the skills and syntax seem to make sense now (somewhat) if you have many receivers or mini's, you will want to use DMZ for the main receiver all my mini are wireless child's to the parent, so the trick will be to give unique name to each, plus we need to get a the unique WVB client name or ID# or mac address, or whatever routes from receiver though WVB to mini, then we could enter custom lines with ip;8080;WVBpath# this would let us say "alexa DirectvMain to channel 202" and "alexa DirectvBedroom to Channel 201" see i have two echo's and a Dot so having Main controlled by Echo and bedroom by Dot would be nice. ------ then plan is solid the issue i have is the client list is just txt names in the main, look like DTV is has a hiding files for the name to path rule

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-269515003, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI6bKD3VLk6MHm8Bobfq8TEOGvfYyrxfks5rMqQtgaJpZM4If5z8.

bearrowb commented 7 years ago

Thank you, will try that in string to control different units via custom unit names

Sent from my iPhone

On Dec 28, 2016, at 12:55 PM, B money notifications@github.com wrote:

Hello, I’m not following. Your wireless minis that are connected to the main Genie should be controllable by the mac address or the clientAddr=[mac]. So to see what you have connected to the main and verify the mac address you would enter into a browser http://[lan_IP]:8080/info/getLocations this will/should show all the receivers and what the macs are. The one that shows as ‘0’ is the main Genie.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: bearrowbmailto:notifications@github.com Sent: Wednesday, December 28, 2016 12:02 PM To: bklavet/Echo-skill-to-control-Directvmailto:Echo-skill-to-control-Directv@noreply.github.com Cc: B moneymailto:brianklavetter@msn.com; Mentionmailto:mention@noreply.github.com Subject: Re: [bklavet/Echo-skill-to-control-Directv] DTV uses http GET, not POST (#1)

thank you for all the details, this has been first skill and aws lamda use, because of all the work done, learning the skills and syntax seem to make sense now (somewhat) if you have many receivers or mini's, you will want to use DMZ for the main receiver all my mini are wireless child's to the parent, so the trick will be to give unique name to each, plus we need to get a the unique WVB client name or ID# or mac address, or whatever routes from receiver though WVB to mini, then we could enter custom lines with ip;8080;WVBpath# this would let us say "alexa DirectvMain to channel 202" and "alexa DirectvBedroom to Channel 201" see i have two echo's and a Dot so having Main controlled by Echo and bedroom by Dot would be nice. ------ then plan is solid the issue i have is the client list is just txt names in the main, look like DTV is has a hiding files for the name to path rule

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-269515003, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI6bKD3VLk6MHm8Bobfq8TEOGvfYyrxfks5rMqQtgaJpZM4If5z8. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bklavet commented 7 years ago

Sure thing, If it was me, I would create a separate skill for each receiver you want to control. The Invocation name would be unique to each receiver. So the invocation name for the main tv, might be “TV”, and the bedroom invocation name could be “John’s TV”. Each invocation name would point to it’s own skill and go off to it’s unique lambda function.

Personally I think it would be easier to learn a separate invocation name for the receivers than having to train myself to add descriptive language to the echo on what receiver I am using, not to mention all the other sample utterances that would need to be created to get this to work.

I am currently working with another who is trying to get there mini working. If you get stuck let me know, I will do my best to help.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: bearrowbmailto:notifications@github.com Sent: Wednesday, December 28, 2016 1:18 PM To: bklavet/Echo-skill-to-control-Directvmailto:Echo-skill-to-control-Directv@noreply.github.com Cc: B moneymailto:brianklavetter@msn.com; Mentionmailto:mention@noreply.github.com Subject: Re: [bklavet/Echo-skill-to-control-Directv] DTV uses http GET, not POST (#1)

Thank you, will try that in string to control different units via custom unit names

Sent from my iPhone

On Dec 28, 2016, at 12:55 PM, B money notifications@github.com wrote:

Hello, I’m not following. Your wireless minis that are connected to the main Genie should be controllable by the mac address or the clientAddr=[mac]. So to see what you have connected to the main and verify the mac address you would enter into a browser http://[lan_IP]:8080/info/getLocations this will/should show all the receivers and what the macs are. The one that shows as ‘0’ is the main Genie.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: bearrowbmailto:notifications@github.com Sent: Wednesday, December 28, 2016 12:02 PM To: bklavet/Echo-skill-to-control-Directvmailto:Echo-skill-to-control-Directv@noreply.github.com Cc: B moneymailto:brianklavetter@msn.com; Mentionmailto:mention@noreply.github.com Subject: Re: [bklavet/Echo-skill-to-control-Directv] DTV uses http GET, not POST (#1)

thank you for all the details, this has been first skill and aws lamda use, because of all the work done, learning the skills and syntax seem to make sense now (somewhat) if you have many receivers or mini's, you will want to use DMZ for the main receiver all my mini are wireless child's to the parent, so the trick will be to give unique name to each, plus we need to get a the unique WVB client name or ID# or mac address, or whatever routes from receiver though WVB to mini, then we could enter custom lines with ip;8080;WVBpath# this would let us say "alexa DirectvMain to channel 202" and "alexa DirectvBedroom to Channel 201" see i have two echo's and a Dot so having Main controlled by Echo and bedroom by Dot would be nice. ------ then plan is solid the issue i have is the client list is just txt names in the main, look like DTV is has a hiding files for the name to path rule

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-269515003, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI6bKD3VLk6MHm8Bobfq8TEOGvfYyrxfks5rMqQtgaJpZM4If5z8. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bklavet/Echo-skill-to-control-Directv/issues/1#issuecomment-269525849, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI6bKBC5BUSi2-KPO9jfaaD5wvJfL9hfks5rMrXpgaJpZM4If5z8.