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

Main Genie On/Off Functionality Not working #77

Open tmsteinhardt opened 6 years ago

tmsteinhardt commented 6 years ago

I thought the on/off functionality was supposed to work on the main genie just not the minies? I have a skill to control a mini and a skill to control the main receiver and when I run the test to power on or off "ask genie (my invocation) to turn on" on the main receiver Alexa says that she didn't understand the command. Any thoughts? Am I doing something wrong? Also, on the latest version of the developer kit is there a way to copy and paste the list of intents and slot types? I had to enter them in individually for the second skill that I just did. The first one that I did months ago I was able to copy and paste the list. Thanks in advance for any input and for creating the skill. I love the added control it gives me over what was capable with just the harmony hub.

tmsteinhardt commented 6 years ago

I did some more testing and it appears the skill is being very picky. if I ask to go to list, guide, and some channels it works but when I say to turn the volume up or to go to certain channels Alexa responds that she doesn't understand. I believe these are all commands that work in my other skill for the genie mini.

bklavet commented 6 years ago

hello tmsteinhardt, if you click on JSON Editor (under the build tab) in the alexa developer portal you can cut and paste samples. though you will have to put some quotes in. that will spare you from entering one at a time.

volume wont work since volume is not controlled by the dtv receiver. You may have to alter the custom phrases to get more precise responses. under the test tab in the alexa developer portal (if you have a mic connected) you can interface with your skill and see what alexa is hearing and what she is doing. Maybe helpful in tweaking the custom slot values to your liking.

Side note that may not apply is that the newest genies have minies on all the tv's now and need to have the macs placed.

b

tmsteinhardt commented 6 years ago

bklavet,

Thanks for the quick reply. I thought volume control was working on my other instance of the skill but that might just be the harmony hub controlling the volume and not the skill. The first instance of the skill is running on the 4k genie mini in my livingroom and I was hoping to run the second instance of the skill on the main receiver in my bedroom. I thought the skill was capable of turning the main receiver on and off. In the livingroom my harmony takes care of the on/off through an activity. I ran an IR extender to my bedroom and have another activity for that tv however you can only run one activity at a time so I was hoping I could just use this skill on the main receiver in the bedroom to control the power in the bedroom and then not have to even worry about harmony conflicts if both tv's were running since Harmony stupidly only controls one activity at a time.

bklavet commented 6 years ago

Hey for the 4k set up you may want to throw this in your browser to see what your macs are. I am guess the main and the bedroom will each have a mac. Minis/mini genies/etc.. a custom slot for mini genie has been added to the github! the voice guide skill also can support minis The custom slot skill by default will control the receiver that is hooked up to the lan network. Since minis are hooked to the main genie the index file will have to be modified so that the skill will control them. First thing to do Is find out your mini's mac address. http://[lanIP]:8080/info/getLocations

this will show the locations of the receivers on your network. Location 0 is the main Genie (before 4K). You will be able to see the Mac address of the minis on your network. The friendly name you built into the receiver such as "bed room, living room, etc" should also be displayed to help in knowing which mac is which receiver. add your mac to the custom slot mini genie index file towards the top... you will only need to enter it once mac needs to be all CAPS and no colons example mac &clientAddr=EDGC42F2YY;

to test the on/off you could bypass the skill and try this in your browser altered with your macs to see if it works. if it does you can check it against the skill http://[lanIP]:8080/remote/processKey?key=power&hold=keyPress&clientAddr=[mac]

b

tmsteinhardt commented 6 years ago

I have my 4K mini working with the mini genie code as you mentioned above with the MAC address. The main receiver (HR54) works with out a MAC address with the standard code. I tested the last line that you listed above in my browser without the MAX address portion of it and the main receiver and the TV power on. I also modified it with poweron and poweroff instead of just power and those both worked. The limitation appears to be that the TV will turn on with the command but will not turn off. Any thoughts on getting the tv to turn off? Like I mentioned previously I have a harmony that can work in that room but the limitation is when you tell harmony to turn an activity off it turns all activities off so it would turn my livingroom tv off as well if that one was on. Alexa doesn't seem to understand the power on/off command no matter what way I try to say it. Any idea of what to modify in the skill? Thanks again for all the help/input. This is a great skill. I just wish I understood the coding language.

EDIT - I see that power is in the control list. I also added power on and power off to see if that would work but neither helped.

tmsteinhardt commented 6 years ago

Ok so I've made some progress. I'm a complete noob. I figured out that I had to add the actual code into the index file as well as the control list. After adding the power on and power off lines in the index code power on and off now works and powers on both the receiver and the tv on but only powers the receiver off not the tv. Any thoughts as to whether there is just zero support for turning the tv off or if I need to code something differently?

bklavet commented 6 years ago

I am really surprised that the command to turn the receiver on is also turning on the tv. I am not sure how that is possible. :) Not being able to turn of the tv seems normal because the commands are going through the internet to the directv receiver. The handheld remotes double as a universal remote to control volume and tv power through the IR led on the remote. Don't get me wrong I am stoked the power command does the tv too, just not sure why or how. what kind of tv is it?

Good catch on the index, when you test a custom slot word in the developer portal pay close attention to how it sends it to aws lambda. "Power On" does not equal "power on".

b

weiljx commented 6 years ago

Just a guess more modern TV's have the ability to turn on when a new hdmi device is powered on. This is true for me with a Sony Google TV I bought 6 or 7 years ago. These TVs generally have the ability to set a power saving option to auto turn off after a set amount of inactivity as does your direct tv dvr. They do not support however when HDMI stops turn TV off.