Announcement

Collapse
No announcement yet.

AVR control via script w/o plugin for ZEE?

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

    AVR control via script w/o plugin for ZEE?

    Hi there,

    I would like to send basic commands like ON, OFF, VOLUME UP ... from my ZEE to a Denon AVR. It seems that the AVR is network enabled and several iOS based apps work perfectly to remote control the AVR.

    What would be great is to send basic commands from the ZEE.

    I would purchase the blade plugin but the ZEE (does not support the use of plugin's :-(

    Can someone please help?


    Best regards.
    Alex

    #2
    If you know the commands to send you should be able to use SendToComPort to accomplish this. SendToComPort is covered in the HS3 help files. A quick search turned up a lot of information when searching for "Denon AVR serial commands"
    -Rupp
    sigpic

    Comment


      #3
      I will try and let you know. Thank you.

      Comment


        #4
        Originally posted by Rupp View Post
        If you know the commands to send you should be able to use SendToComPort to accomplish this. SendToComPort is covered in the HS3 help files. A quick search turned up a lot of information when searching for "Denon AVR serial commands"
        none of the HS serial commands work on Linux because sendtocomport/opencomport expect a integer value for the port rather than a string value that Linux names its ports by. It is in the bugzilla.

        Comment


          #5
          Below is a script that I use to send IR commands to my Global Cache via WIFI. You should be able to modify it to send commands to your AVR. It is a simple script, but I am a simple person. If you know the commands to send it should work.

          Bob



          Code:
          ' import required modules
          Imports System.Net
          Imports System.Net.Sockets
          Imports System.Text
              Sub Main(ByVal parms as Object)
                  Const Host = "192.168.1.250"
                  Const HostPort = 4998
                  Const LGTVPWRCode = "sendir,1:1,1,37993,1,1,342,170,22,21,22,21,22,63,22,21,22,21,22,21,22,21,22,21,22,63,22,63,22,21,22,63,22,63,22,63,22,63,22,63,22,21,22,21,22,21,22,63,22,21,22,21,22,21,22,21,22,63,22,63,22,63,22,21,22,63,22,63,22,63,22,63,22,1514,342,85,22,3654,342,3799" &vbCR
                  If hs.IsOff(93) Then
                       Dim tcpClient As New System.Net.Sockets.TcpClient()
                       tcpClient.Connect(host, hostport)
                       Dim networkStream As NetworkStream = tcpClient.GetStream()
                       Dim strResponse As String
                       strResponse = "No response"
                       If networkStream.CanWrite Then
                          Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(LGTVPWRCode)
                          networkStream.Write(sendBytes, 0, sendBytes.Length)
                          Dim bytes(tcpClient.ReceiveBufferSize) As Byte
                          networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
                          Dim returndata As String = Encoding.ASCII.GetString(bytes)
                          strResponse = "Device responded: " & CStr(returndata)
                       Else
                          If Not networkStream.CanWrite Then
                             strResponse = "Error: Cannot write data to the device"
                             tcpClient.Close()
                          End If
                       End If
                  End If
                End Sub

          Comment


            #6
            .Net has a SerialPort class that is pretty easy to use, so I would just use that. I can post a snippet if you need it. Here are the docs, and there is some sample code there:

            http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx

            The functions in HS were added when HS2 was using vbscript and vbscript did not have access to the com ports, so there is no advantage to using that with Linux.
            website | buy now | support | youtube

            Comment


              #7
              Originally posted by rjh View Post
              .Net has a SerialPort class that is pretty easy to use, so I would just use that. I can post a snippet if you need it. Here are the docs, and there is some sample code there:

              http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx

              The functions in HS were added when HS2 was using vbscript and vbscript did not have access to the com ports, so there is no advantage to using that with Linux.
              Point taken for sending but this can't be done for receiving data can it?? If I go to HS3 in the future then I would be interested in Linux but I would be reliant on serial ports working easily on HS.

              Comment


                #8
                Sure. When a vb.net script is compiled and run, its just as if it was included with the HS3 program. It lives forever (until the system is restarted). So you can have a vb.net script launch a thread and that thread will stay running. So the thread can check for com port data and process as needed. This is actually far better than the HS3 com port script stuff where it launches a script when data comes in.

                Originally posted by mrhappy View Post
                Point taken for sending but this can't be done for receiving data can it?? If I go to HS3 in the future then I would be interested in Linux but I would be reliant on serial ports working easily on HS.
                website | buy now | support | youtube

                Comment

                Working...
                X