Announcement

Collapse
No announcement yet.

Pioneer Receiver RS-232 control via HomeSeer?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Hi Kenm,

    I have an open ticket with Global Cache, but in the mean time I thought I would try and talk to the Pioneer via a simple terminal connection. I have COM7 redirection working now, I connect to the Pioneer, but whatever I type i get back a response E04 - which looking at the PDF means 'Inapropriate Command Line Detected'

    Do I need to type anything prior to sending commands?

    Also, I tried creating an event using the script you sent me - but I get an error which is

    Running script: File not found: "OpenComPort"
    Running script: File not found: hs.RunEx "Pioneer.txt"
    Running script: File not found: ""

    I am wondering if I added the script properly. It is in the Scripts folder inside the HSPRO folder, and i added the script and then added arguments, so my events page looks the same as yours.

    I feel I am almost there, but just missing the last bit...

    Jon

    Comment


      #17
      Some progress....

      I turned the receiver off and on again, and now it will talk to me - ONCE.

      I can send one command - i.e. ?V and get a response VOL53

      If I send the command again I get E04 unless I switch the receiver off and on again.

      I am guessing that I need some other characters with my command, but not sure what those would be

      Jon

      Comment


        #18
        Even more progress....

        I've worked out how to type the script into the event, so now I can run the OpenCOM, ?P and CloseCOM command - and when I do this the ?P gets a response PWR0

        So I think I am there.

        My next question would be what do I do with the data now - how do I turn PWR0 into a device status....

        Jon

        Comment


          #19
          Wow - and when i press the front panel controls, HS gets the code for the status change - very nice - can't wait for my next lesson now...

          Jon

          Comment


            #20
            Hi Jon,

            Looks like you've made some solid progress. Good Job!

            Now on to your next assignment...

            1. Create 2 devices (one to hold Power Status and one to hold Volume Value). If you look at the top of the attached script you will see that you need to tell the script what housecode (hc) and what device codes you are using for your devices. The script is setup to use "y1" and "y2" right now but you can easily change those. These devices should be of type "Status Only" and can be in any location you want.

            2. Run the "OpenComPort" event and power on your receiver. If everything is setup correctly your Power Status device should now show "ON".

            3. Spin the volume knob on your receiver and your volume value device should change to show the current volume of the receiver.

            Have a look at the code in "ProcessResponse" so you can start to understand how the script updates the status of the devices.

            Let me know how it goes,
            Ken
            Attached Files
            "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

            Comment


              #21
              Jon,

              I just noticed that I forgot to set the "port" constant in the script back to "7". I have a device on com7 so I test my script changes on com8.

              Make that change at the top of the script before you start testing.

              Ken
              "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

              Comment


                #22
                Kenm

                Great - this worked, i now have Volume and Power Status and then I figured out Mute Status and Function (interestingly, the response for function is different to what the protocol says, but i've adapted) I can now go on and add all the other status's.

                I guess the next step is to change status on the receiver from events in HS?

                Thanks again for your support - it is very much appreciated

                Jon
                Attached Files

                Comment


                  #23
                  Hi Jon,

                  Looks like you're well on your way.

                  You can now safely put the call to OpenComPort in startup.txt and CloseComPort in shutdown.txt so that you open the comport when HS starts and close the comport when HS exits.

                  A couple of things I noticed in the protocol document:

                  1. Take a look at Notice1 which talks about sending commands when in standby. We may need to come up with a modification to the SendCommand to determine if the unit is in standby and then sending the commands twice.

                  2. I noticed an inconsistency with the "Function" Answers. One part of the document talks about FNxx and another talks about FUNxx. I see you found that one while adding support for the Function response.

                  3. Watch out for the "SR" command and response. In the protocol doc is shows "XXX(X)SR" with an answer of "SRXXX(X)" which looks to me like they're allowing for more than 3 chars for that command. When you process the SR response I'd add a length check on it before just grabbing that last 3 chars as the mode may actually be the last 4 chars.

                  Let me know if you need a hand with anything and hope you're having fun!
                  Ken
                  Last edited by kenm; January 16, 2009, 06:31 PM.
                  "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                  Comment


                    #24
                    Thanks Kenm - yes definitely having fun with this - looking forward to getting it working in HSTouch.

                    I think my only remaining question would be what do I need to do in the script to change the status - i.e. if I want to change device status 'Pioneer Receiver Volume' to 50, or to change device status Pioneer Receiver Power Status to Off?

                    Jon

                    Comment


                      #25
                      Hi Jon,

                      Changing the status is the easy part...You don't change the status of the device, instead, you send a command to your receiver using SendCommand and then the ProcessResponse function updates the status when it gets a response.

                      For example, to change the volume you would do this:

                      &hs.RunEx "Pioneer.txt", "SendCommand", "50VL"

                      and the response will be "VOL50"

                      To put the receiver in Standby you would do this:

                      &hs.RunEx "Pioneer.txt", "SendCommand", "PF"

                      and the response will be "PWR0"

                      Look at the table in the protocol doc called "Operation Commands" and you will see "Command" on the left and "Answer" on the right. Look at the subnotes for each command to see the format of the data and the format of the response.

                      I've thought about tightening up the SendCommand/ProcessResponse code so you can actually figure out from a script that you never got a response but for what I've been doing with my Denon so far I haven't had a problem figuring out when the SendCommand didn't work because the remote zone doesn't do what I want it to.

                      Let me know if you have any more questions and keep having fun!
                      Ken
                      Last edited by kenm; January 16, 2009, 06:32 PM.
                      "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                      Comment


                        #26
                        Kenm - again - thankyou - that works - so now I can complete the script and I think I'm pretty much there. I might need some help on the standby power delay thing, but I will attack that later once the script is filled with all the codes for the device. I will send you back the final script incase anyone you know needs it. Is there a place on this community where it can be shared?

                        One question I have now is - if I want to have a button to increase and decrease the volume, i.e. rather than 50VL I want to send existingVL+1 - is this relatively simple or is it opening a whole new problem? What I am trying to do is have a Volume Up and Volume Down button on a controller that I have by my chair, in case the remote has grown legs.

                        This has been a very interesting thread for me - and I really appreciate you taking the time to help me understand - already it is opening up greater understanding of other areas of HS - and the way devices and events interact. Wife is not in the best of moods however....

                        Jon

                        (By the way , I think you said your a mac guy - same here - although gaining respect for Windows too - let me know if you ever have any mac related issues I might be able to help with - thats my job)

                        Comment


                          #27
                          Hi Jon,

                          Let me think a little about the standby power delay and how to handle that and I'll get back to you on it.

                          If you just attach your final script here those that need it should be able to search and find this thread.

                          I was going to torture you with a long and complicated method for getting the current volume, incrementing or decrementing, and sending it back to the receiver but...

                          Look for the VU and VD commands (or ZU and ZD) in the Operation Commands table in the protocol doc.

                          I'm a Windows, Mac, and Linux/Unix user but I prefer a Mac as my "personal" computer. I work for a network equipment company so most of my work is using Unix tools that "just work" on the Mac.

                          Finally, It's always important to keep a good balance between work, hobby, and personal life and above all, keep the wife happy. Sounds like you need to go out for a nice dinner this weekend.

                          Take Care,
                          Ken
                          "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                          Comment


                            #28
                            Ken,

                            I have added all the listening modes now so the device status in HS always reflects the listening mode on the Pioneer.

                            I am wondering if it is feasible to send the SR commands from a pop up next to the device - i.e. where I have a relay device I get a pop up for Open and Closed - is it possible in the script to list all the SR commands in the popup and have HS send the appropriate SR command when one is selected?

                            The only other way I can think to do it is to have many events - one for each SR command.

                            How do you manage this for your receiver?

                            Jon

                            PS Latest script attached
                            Attached Files

                            Comment


                              #29
                              Hey guys,

                              Just a quick word of thanks to Jon for letting me know this thread 'came back to life', and to Ken for his great suggestions and guidance. After 1 1/2 years of trying to sort this out, I spent a couple hours today and got everything working - awesome.

                              Thanks again,

                              -Michael
                              ---

                              Comment


                                #30
                                Originally posted by Bestgear View Post

                                Its not a big job... (famous last words... )

                                David

                                Ehhh...

                                After the amount of hours we spent on the Adams modules ....


                                Andy

                                Comment

                                Working...
                                X