Announcement

Collapse
No announcement yet.

Working with raw commands

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

    Working with raw commands

    Hello,

    I try to start to use Homeseer and BLDenon plugin.

    I would like to use raw commands to change the HMI out status (HDMI 1 or HDMI2)

    the example command in the avr4308CI protocol is VSMONI1<CR> and VSMONI2<CR>.

    So I create an event I call Denon Moni 1, and inout the script:

    Dim theResponse As String = ""
    theResponse = hs.Plugin("BLDenon").SendRawCommand("VSMONI1")
    hs.writelog("Info", "The response for the command is: " & theResponse)
    theResponse = Nothing
    and for moni 2
    Dim theResponse As String = ""
    theResponse = hs.Plugin("BLDenon").SendRawCommand("VSMONI2")
    hs.writelog("Info", "The response for the command is: " & theResponse)
    theResponse = Nothing
    but I have an error in homeseer log and no change on the receiver.

    Thanks for the help!!

    #2
    What is the error?
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #3
      I think homeseer doesn't like the script in the help file.

      I put:
      Sub Main()
      Dim theResponse
      theResponse = hs.Plugin("BLDenon").SendRawCommand("PWON")
      hs.writelog "Info", "The response for the command is: " & theResponse
      End Sub
      and it works.

      When I put the last example:

      Dim theResponse As String = ""
      theResponse = hs.Plugin("BLDenon").SendRawCommand("PWON")
      hs.writelog("Info", "The response for the command is: " & theResponse)
      theResponse = Nothing

      here is my error message:

      24/04/2011 19:41:11 - Error - Running script, script run or compile error in file: bldenon Moni2 test21025:Fin d'instruction attendue in line 2 More info: Fin d'instruction attendue

      I had activated the debug loggin in the BLdenon plugin options but I don't find the debug file... if you want, I can search it and send it.

      Comment


        #4
        Are you using a vb.net script?
        I would recommend you use vb.net scripts
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


          #5
          I use the script editor included in homeseer web page.
          I don't think it uses vb.net.
          What should I do to be able to create vb.net script? Only change .txt extension in .vb?

          Comment


            #6
            Yes the script needs to have a .vb extension.
            Paste in the script and I will convert it to .net for you.
            Hopefully the script is not too big
            Cheers,
            Bob
            Web site | Help Desk | Feature Requests | Message Board

            Comment


              #7
              Here is the scriptin vb, thanks.

              Sub Main()
              Dim theResponse
              theResponse = hs.Plugin("BLDenon").SendRawCommand("VSMONI1")
              hs.writelog "Info", "The response for the command is: " & theResponse
              End Sub

              Comment


                #8
                Try this:

                Code:
                Sub Main(ByVal parms As Object)
                    Dim theResponse As String = ""
                    theResponse = hs.Plugin("BLDenon").SendRawCommand("VSMONI1")
                    hs.writelog("Info", "The response for the command is: " & theResponse)
                    theResponse = Nothing
                End Sub
                Cheers,
                Bob
                Web site | Help Desk | Feature Requests | Message Board

                Comment


                  #9
                  thanks,

                  I will try this code today.

                  Comment


                    #10
                    I tried today and it worked well

                    Thanks a lot

                    Comment


                      #11
                      OK So the plugin doesn't really work well with my receiver. I have a 3312Ci. However, the raw commands do work well. So I decided to create a script that I can pass commands to my receiver using the raw feature. I also wanted to create just one script where I can pass in parameters to whatever I want to do with the receiver. This is how I wrote the code.

                      Public Sub Main(ByVal parms As Object)
                      Dim theResponse As String = ""
                      Dim DenonArray() As String = parms.ToString.Split("|")
                      Dim theComm As String = DenonArray(0)
                      Dim theStatus As String = DenonArray(1)

                      theResponse = hs.Plugin("BLDenon").SendRawCommand(theComm)
                      hs.WriteLog("Denon", "The Denon just: " & theResponse)
                      theResponse = Nothing

                      theResponse = hs.Plugin("BLDenon").SendRawCommand(theStatus)
                      hs.WriteLog("Denon", "Denon Confirmation Return: " & theResponse)
                      theResponse = Nothing
                      End Sub
                      And I pass in ("Main", "PWSTANDBY | PW?")
                      This for some odd reason doesn't work. What am I doing wrong? However, this works just fine.

                      Public Sub Main(ByVal parms As Object)
                      Dim theResponse As String = ""
                      Dim DenonArray() As String = parms.ToString.Split("|")
                      Dim theComm As String = DenonArray(0)
                      Dim theStatus As String = DenonArray(1)

                      theResponse = hs.Plugin("BLDenon").SendRawCommand("PWSTANDBY")
                      hs.WriteLog("Denon", "The Denon just: " & theResponse)
                      theResponse = Nothing

                      theResponse = hs.Plugin("BLDenon").SendRawCommand("PW?")
                      hs.WriteLog("Denon", "Denon Confirmation Return: " & theResponse)
                      theResponse = Nothing
                      End Sub

                      I also did this to troubleshoot and see what the parms actually are.

                      Public Sub Main(ByVal parms As Object)
                      Dim theResponse As String = ""
                      Dim DenonArray() As String = parms.ToString.Split("|")
                      Dim theComm As String = DenonArray(0)
                      Dim theStatus As String = DenonArray(1)

                      hs.WriteLog("Denon", "The theComm parm is: " & theComm)
                      theResponse = hs.Plugin("BLDenon").SendRawCommand(theComm)
                      hs.WriteLog("Denon", "The Denon just: " & theResponse)
                      theResponse = Nothing

                      hs.WriteLog("Denon", "The theStatus parm is: " & theStatus)
                      theResponse = hs.Plugin("BLDenon").SendRawCommand(theStatus)
                      hs.WriteLog("Denon", "Denon Confirmation Return: " & theResponse)
                      theResponse = Nothing
                      End Sub

                      And I see that I am passing the right parms into the correct area. I also have added .ToString at the end of them and they still don't work. Any ideas?

                      Comment


                        #12
                        What error do you get?

                        I assume this is for HS2

                        How about this:

                        Code:
                        Public Sub Main(ByVal parms As String)
                            Dim theResponse As String = ""
                            Dim DenonArray() As String = parms.Trim.Split("|")
                            Dim theComm As String = DenonArray(0).Trim
                            Dim theStatus As String = DenonArray(1).Trim
                        
                            theResponse = hs.Plugin("BLDenon").SendRawCommand(theComm )
                            hs.WriteLog("Denon", "The Denon just: " & theResponse)
                            theResponse = Nothing
                        
                            theResponse = hs.Plugin("BLDenon").SendRawCommand(theStatus)
                            hs.WriteLog("Denon", "Denon Confirmation Return: " & theResponse)
                            theResponse = Nothing
                            theComm = Nothing
                            theStatus = Nothing
                        End Sub
                        Cheers,
                        Bob
                        Web site | Help Desk | Feature Requests | Message Board

                        Comment


                          #13
                          The trim did the trick. Thanks so much!!! Your the best!!!. And yes I am using HS2. Also, FMI if I purchase the HS2 plugin, do I need to repurchase HS3 plugin?

                          Comment


                            #14
                            Originally posted by dcarreiro View Post
                            Also, FMI if I purchase the HS2 plugin, do I need to repurchase HS3 plugin?
                            No you should get a HS3 license for free if you purchase HS2 plugin.

                            Any HS2 plugin purchased after Oct 1, 2013 will get a free HS3 license
                            Cheers,
                            Bob
                            Web site | Help Desk | Feature Requests | Message Board

                            Comment

                            Working...
                            X