Announcement

Collapse
No announcement yet.

Script for Monoprice 6 zone Audio

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

    Script for Monoprice 6 zone Audio

    I have 3 monoprice 6 zone amps in my house but having trouble figuring out how to send the scripts through the rs232 to control them. I have the manual with all the command but can't figure out how to put it all together.
    Can anyone give me a sample script to control at least 1 function of this?

    Thanks,

    #2
    Sent you a message with all my scripts but you can use the below script to test

    Change COMPort.PortName to your port and this will turn all zones On machine1 On

    Com = "<10PR01" & vbCr

    To turn off:
    Com = "<10PR00" & vbCr



    Code:
    Imports System.Threading
    Imports System.IO.Ports 
    Public COMPort As New SerialPort()
    Public Sub Main(ByVal parm as Object)
    
    
    Dim Com as Object
    Dim rxBuff as String
    rxBuff = ""
    
    'hs.writelog("Audio", "ScriptCallParm=" & ScriptCallParm)
    
    COMPort.PortName = "COM6"
    COMPort.BaudRate = 9600
    COMPort.Parity = System.IO.Ports.Parity.None
    COMPort.DataBits = 8
    COMPort.StopBits = System.IO.Ports.StopBits.One
    Comport.ReadTimeout = 1000
     
    hs.writelog("Audio", "Main() Called - Attempting To Open")
     
    If COMPort.IsOpen = False Then 
     COMPort.Open() 
    End If
     
    hs.writelog("Audio", "Port Open - Sending Data")
     
    Com = "<10PR01" & vbCr
     
    hs.writelog("Audio", "Sending: " & Com)
     
    'writes to com port
    COMPort.Write(Com)
    
    System.Threading.Thread.Sleep(600)
    
    'Reading the com port:
    rxBuff = (COMPort.ReadExisting)
    
    If rxBuff <> "" Then
    hs.writelog("Audio", "Received:" & rxBuff)
    rxBuff = ""
    	
    End If
    
    COMPort.close()
     
    hs.writelog("Audio", "Ended")
     
    End Sub
    Thanks Steven

    Comment


      #3
      Steven,

      Ok first test was a success. change it to com 4. and edited it to turn on all of zone 2.

      Now for the fun long process of doing like 100 of these to do all 18 zones, at different volumes, on's and off's and so on. LOL

      Comment


        #4
        This is awesome help! Thank you. Since moving to HS3 on linux I've struggled with the syntax to access the tty serial port. I have a monoprice amp and a Nuvo amp. If you have any additional scripts I'd appreciate a PM. I'll post any of my successes as well.

        Thanks again.

        Comment


          #5
          I sent you an email with all my scripts zipped up including screen shots of events

          Let me know if you have any questions.

          Thanks,
          Steven G

          Comment


            #6
            Steven,

            Thank you for all of your efforts with this. I just received my Monoprice 6-Zone today. Could I please get a copy of your scripts, so that I can integreate the Amp into my HS3 environment.

            Thanks!

            Comment


              #7
              Hi John,

              I've been working on a plugin for the monoprice amp for HS3. Most of it is working. Things I know don't work are the All amp commands for all zones off all zones mute. But all the individual zone stuff seems to work as well as actions. It has a settable poll rate but baud is fixed at amp default of 9600. it only supports one amp. Also I haven't programmed any triggers or conditions yet or any type of scripting interface. I've been running it for a couple days now on a windows 7 machine and nothing has exploded so that's good

              Seems like you might be in a position to try it and provide some feedback. If you're interested I'll send you a copy.
              Attached Files
              https://forums.homeseer.com/forum/de...plifier-plugin

              Comment


                #8
                Originally posted by happnatious1 View Post
                Hi John,

                I've been working on a plugin for the monoprice amp for HS3. Most of it is working. Things I know don't work are the All amp commands for all zones off all zones mute. But all the individual zone stuff seems to work as well as actions. It has a settable poll rate but baud is fixed at amp default of 9600. it only supports one amp. Also I haven't programmed any triggers or conditions yet or any type of scripting interface. I've been running it for a couple days now on a windows 7 machine and nothing has exploded so that's good

                Seems like you might be in a position to try it and provide some feedback. If you're interested I'll send you a copy.
                Hi Happ,

                That would be great! I just took the amp out of the box yesterday. I need to mod my cabinet today to ensure good ventilation. I also need to pick an RS-232 extension cable. I am also running Win7 on an Intel NUC as my HS3 machine. I will use a Trendnet TU-S9 USB/Serial to interface to the amp. I should be all set to go by tomorrow. I will gladly provide testing and feedback. Please PM me with the information. Thanks again!

                Comment


                  #9
                  Originally posted by happnatious1 View Post
                  Hi John,

                  I've been working on a plugin for the monoprice amp for HS3. Most of it is working. Things I know don't work are the All amp commands for all zones off all zones mute. But all the individual zone stuff seems to work as well as actions. It has a settable poll rate but baud is fixed at amp default of 9600. it only supports one amp. Also I haven't programmed any triggers or conditions yet or any type of scripting interface. I've been running it for a couple days now on a windows 7 machine and nothing has exploded so that's good

                  Seems like you might be in a position to try it and provide some feedback. If you're interested I'll send you a copy.
                  Happ,

                  I have my monoprice amp running and would love to provide you with feedback on the plugin. I'm running 5 zones and hs3 on win7. I have a virtual serial port on the hs3 (which is in my office) going over TCP/IP to a raspberry pi that's sitting next to the amp. I'm using ser2net to make the pi into a serial server (besides the music server) to control the amp.

                  Thanks
                  Marco

                  Comment


                    #10
                    Hey Marco,

                    Based on feedback from John I've added the ability for custom source names, of course that broke a few other things. So PM me your email address and I'll update both you guys when it's fixed.

                    Bill
                    https://forums.homeseer.com/forum/de...plifier-plugin

                    Comment


                      #11
                      Thanks Bill!

                      The plugin has been working great. Let me know when you need me to test anything else.

                      Comment


                        #12
                        Hi Bill,
                        I'm trying to do the same thing for a SpeakerCraft MZC-88 (8 zones, 8 inputs, RS232 control etc). The MZC-88 has almost identical settings/options (zone ON/OFF, volume, source, pager, treble, bass etc).

                        And I have the RS232 protocol document and the SpeakerCraft emulator software (to generate the correct RS232 command with checksum). For example to switch Zone 1 to source 1 you send "0x55, 0x05, 0xA3, 0x00, 0x00, 0x03" via RS232.

                        I wonder how difficult it would be to add the MZC-88 as an 'option' to this plugin? I imagine it would be a matter of having a different RS232 code table.

                        I'm not very good at scripting or writing plugins but am willing to invest some time to get this working.

                        Currently I use drule's plugin to send RS232 commands via events. But this is a rather clunky way of doing it.

                        Let me know if you are interested in 'expanding' your plugin. Maybe I could look at it myself if I had the code?

                        Thanks, Marty.
                        iCore5 Win 10 Pro x64 SSD

                        HS3 Pro Edition 3.0.0.435 Windows

                        BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                        Comment


                          #13
                          Originally posted by mminehan View Post
                          Hi Bill,
                          I'm trying to do the same thing for a SpeakerCraft MZC-88 (8 zones, 8 inputs, RS232 control etc). The MZC-88 has almost identical settings/options (zone ON/OFF, volume, source, pager, treble, bass etc).

                          And I have the RS232 protocol document and the SpeakerCraft emulator software (to generate the correct RS232 command with checksum). For example to switch Zone 1 to source 1 you send "0x55, 0x05, 0xA3, 0x00, 0x00, 0x03" via RS232.

                          I wonder how difficult it would be to add the MZC-88 as an 'option' to this plugin? I imagine it would be a matter of having a different RS232 code table.

                          I'm not very good at scripting or writing plugins but am willing to invest some time to get this working.

                          Currently I use drule's plugin to send RS232 commands via events. But this is a rather clunky way of doing it.

                          Let me know if you are interested in 'expanding' your plugin. Maybe I could look at it myself if I had the code?

                          Thanks, Marty.
                          Hey Marty,

                          I've been giving this a lot of thought and the definitive answer is...Maybe?

                          There are two subroutines that would need to be unique, one sends commands and the other polls for status. The status one would need to be totally re-written based on what your amp spits out for status. The command one would need to fit into a target-command-value structure such as "z1-power-off" or "z2-volume-20". The monoprice amp is based on the following script.
                          PHP Code:
                          'Send Parameters in the form target|command|value ie. z1|volume|20
                          '
                          targetsa1,a2,a3z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,z13,z14,z15,z16,z17,z18.
                          'commands: power,volume, mute, dnd(do not disturb),balance, treble, bass, source.
                          '
                          valueonoffvolume 00-38treble/base 00-14balance 00-20
                          'Don't forget to set the com port

                          Imports System
                          .Threading
                          Imports System
                          .IO.Ports
                          Imports System
                          .Object
                          Imports System
                          .Text
                          Public COMPort As New SerialPort()

                          Public 
                          Sub Main(ByVal parm as Object)

                          Dim tcArray(2) As String
                          tcArray 
                          parm.ToString.Split("|")
                          Dim target As String tcArray(0)
                          Dim command As String tcArray(1)
                          Dim value As String tcArray(2)

                          hs.writelog("Monoprice Amp""Script called with: "target "|" command "|" value)

                          Dim tcString "" 'this is what will eventually be sent to the com port
                          Dim tcStringBuilder As New StringBuilder("<") '
                          start building tcString

                          Select 
                          Case target           'Select Target
                          Case "a1"
                          tcStringBuilder.Append ("10")
                          Case "a2"
                          tcStringBuilder.Append ("20")
                          Case "a3"
                          tcStringBuilder.Append ("30")
                          Case "z1"
                          tcStringBuilder.Append ("11")
                          Case "z2"
                          tcStringBuilder.Append ("12")
                          Case "z3"
                          tcStringBuilder.Append ("13")
                          Case "z4"
                          tcStringBuilder.Append ("14")
                          Case "z5"
                          tcStringBuilder.Append ("15")
                          Case "z6"
                          tcStringBuilder.Append ("16")
                          Case "z7"
                          tcStringBuilder.Append ("21")
                          Case "z8"
                          tcStringBuilder.Append ("22")
                          Case "z9"
                          tcStringBuilder.Append ("23")
                          Case "z10"
                          tcStringBuilder.Append ("24")
                          Case "z11"
                          tcStringBuilder.Append ("25")
                          Case "z12"
                          tcStringBuilder.Append ("26")
                          Case "z13"
                          tcStringBuilder.Append ("31")
                          Case "z14"
                          tcStringBuilder.Append ("32")
                          Case "z15"
                          tcStringBuilder.Append ("33")
                          Case "z16"
                          tcStringBuilder.Append ("34")
                          Case "z17"
                          tcStringBuilder.Append ("35")
                          Case "z18"
                          tcStringBuilder.Append ("36")

                          Case Else
                          hs.writelog("Monoprice Amp", "Target not found: " & target)
                          End Select

                          Select Case command
                          Case "power"
                          tcStringBuilder.Append ("PR")
                          Case "mute"
                          tcStringBuilder.Append ("MU")
                          Case "volume"
                          tcStringBuilder.Append ("VO")
                          Case "dnd"
                          tcStringBuilder.Append ("DT")
                          Case "treble"
                          tcStringBuilder.Append ("TR")
                          Case "bass"
                          tcStringBuilder.Append ("BS")
                          Case "balance"
                          tcStringBuilder.Append ("BL")
                          Case "source"
                          tcStringBuilder.Append ("CH")

                          Case Else
                          hs.writelog("Monoprice Amp", "Command not found: " & command)
                          End Select

                          Select Case value
                          Case "on"
                          tcStringBuilder.Append ("01")
                          case "off"
                          tcStringBuilder.Append ("00")

                          Case Else
                          tcStringBuilder.Append (value)
                          End Select


                          tcString = tcStringBuilder.ToString()

                          Dim Com as Object
                          Dim rxBuff as String
                          rxBuff = ""

                          COMPort.PortName = "COM5"
                          COMPort.BaudRate = 9600
                          COMPort.Parity = System.IO.Ports.Parity.None
                          COMPort.DataBits = 8
                          COMPort.StopBits = System.IO.Ports.StopBits.One
                          Comport.ReadTimeout = 1000
                           
                          If COMPort.IsOpen = False Then 
                           COMPort.Open() 
                          End If
                           
                          Com = tcString & vbCr
                           
                          hs.writelog("Audio", "Sending: " & Com)
                           
                          COMPort.Write(Com)

                          System.Threading.Thread.Sleep(600)

                          '
                          Reading the com port:
                          rxBuff = (COMPort.ReadExisting)

                          If 
                          rxBuff <> "" Then
                          hs
                          .writelog("Audio""Received:" rxBuff)
                          rxBuff ""
                          End If

                          COMPort.close()
                           
                          End Sub 
                          I would say that if you can get this script working with your amp it would go a long way to getting a working plugin.

                          Big thanks to steveng for sharing his scripts.
                          https://forums.homeseer.com/forum/de...plifier-plugin

                          Comment


                            #14
                            So glad to see this get some movement, I have been running this amp for over a year with my scripts and never got around to making it a plugin.

                            Please let me know if I can help in any way.

                            Thanks,
                            Steven G

                            Comment


                              #15
                              MonoAmp

                              For anyone using my Monoprice amp plugin for the 6\4 Zone Amp - I've Released a newer Version


                              https://www.dropbox.com/s/i61qluqxhy...AmpV4.zip?dl=0

                              Please let me know any issues

                              Kind Regards,
                              Mike Pisano

                              Comment

                              Working...
                              X