Announcement

Collapse
No announcement yet.

Migrating functions from SG to HS

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

    #16
    Uncle Michael - you mentioned alternatives for I/O - like the digital and opto-isolated relays - of StarGate.
    Have you made any further changes in that area?
    Once I step off of my ever-shrinking ice-flow that is the most excellent (but near-extinct) StarGate, I am very concerned about stepping onto something that will be bigger, better, more stable, growing-not-shrinking, and MORE features, not less, than SG.
    I suspect as I start really investing and investigating, many things will find their own replacement solutions. Problem is that each is "mo money" than what the original solution was. Why is it more, rather than less, to do the same function nearly 20 years later? And of course, there are exceptions to that. AND there are some very nice enhancements that were not available in 1997.

    Comment


      #17
      Originally posted by TexARC View Post
      Uncle Michael - you mentioned alternatives for I/O - like the digital and opto-isolated relays - of StarGate.
      Have you made any further changes in that area?
      I have not yet found a compelling alternative to the digital and analog inputs and relays on my SG box. The primary attraction of the SG hardware - aside from its robust design - is that I have it, know how to use it, and can exchange information with HS easily. Another advantage is that the SG box provides some autonomous processing power, either as prepossessing or as an independent agent, responding to a signal without requiring intervention by HS. In addition to providing a pass-though to its inputs and relays, in a few cases I also have it acting as an intelligent peripheral, the way a thermostat performs, acting independently on (admittedly simple) tasks assigned to it.

      As far as your other comments, I heartily agree. I think you will be amazed at what you will be able to do with HS and its more capable and clever plug-ins. Unfortunately, it does cost money. I suspect the restricted market size has prevented HA from receiving as much benefit from economies of scale as other areas of technology. I'm sure that will change, but maybe not in our lifetimes,
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #18
        Thanks, Uncle Mike.
        I expect what I need to do, is sit down and construct a diagram/list of all the things I both USED to be able to do, and WANT to do, and CURRENTLY do, with my SG/IR expander/IOxpander/RS485 hub, and then figure out what is going to provide alternative methods.
        I did notice that Google is releasing a hub for WiFi, that also supports Zigbee, has USB 4.0 support, which has me wondering if this might be a new way into HA... hmmm... what to do, what to do.... at $200, the router alone would be worth it, but if it allows any device on the home network to cause it to relay signals/commands to zigbee devices, but I don't know anything about the "Weave" programming it mentions. Still, very interesting.

        Comment


          #19
          Although it is an interesting idea, I doubt the Google hub as it is currently advertised will have much benefit to a serious HA enthusiast. It may, however, contribute to a growing trend to bring HA ideas and practices further into the mainstream. Anything that can increase demand should help to lower component prices and improve system design and reliability.

          For now, though, there is almost nothing that rivals HomeSeer for sheer power and flexibility. The downside is that it still demands a great deal from the user in both expertise and time. There's a significant learning curve, and as an individual system becomes more capable it also becomes more complex, more unique and more difficult to understand and maintain. In other words, more fun.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #20
            Hi, I am in the process of trying to move my CommStar (Stargate) over to HS3 from my HS2. I originally had it talking to homeseer through this method before moving to the HS2 plugin, and I still have all of my scripts.

            I am using the following command in my startup.vb:

            result = hs.OpenComPort(1, "9600,N,8,1", 1, "GetSG_ASCII.vb", "Main", "$")

            and I am getting the following error:

            Running script Startup.vb :Exception has been thrown by the target of an invocation.Overload resolution failed because no accessible 'OpenComPort' accepts this number of arguments.

            Any thoughts? Thanks.

            Comment


              #21
              I ran into the same problem. The function is now "OpenComPortTerm". In HS3 "OpenComPort" does not support the termination character.

              It's documented in the Help file, but it's about as obscure as it could possibly be.
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548, NUC i3

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

              Comment


                #22
                Thanks, I will try this out tonight. I was able to dig up all of my old script files when I used to handle the communication to my CommStar directly. I see that I had originally opened the port as follows:

                result = hs.OpenComPort(4, "9600,N,8,1", 1, "COM4_CStar.txt", "GotData",vbCR )

                Apparently this worked at the time so I suppose I can continue with vbCR as the terminator vs. $. I will try both.

                Also, I have posted on this before but I thought I would ask here - I do not have a copy of my .sch files from WinEVM. I am able to get WinEVM to connect to the CommStar. Is there no way to rebuild the schedule files? Thanks.

                Comment


                  #23
                  Originally posted by simonmason View Post
                  I see that I had originally opened the port as follows:

                  result = hs.OpenComPort(4, "9600,N,8,1", 1, "COM4_CStar.txt", "GotData",vbCR )

                  Apparently this worked at the time so I suppose I can continue with vbCR as the terminator vs. $. I will try both.
                  I would expect either to work. I chose $ because it it printable, but unlikely to appear in any of my messages.
                  I do not have a copy of my .sch files from WinEVM. I am able to get WinEVM to connect to the CommStar. Is there no way to rebuild the schedule files?
                  I do not know of any way to build a .sch file expect by manually entering the program again in WinEVM and re-saving it.
                  Mike____________________________________________________________ __________________
                  HS3 Pro Edition 3.0.0.548, NUC i3

                  HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                  Comment


                    #24
                    SimonMason: In HS3 you have to use "OpenComPortTerm", your "OpenComPort" will not work. Here is the script I use. It is called from Startup.vb

                    I connected HS3 to Stargate's Com2 so that I can still use Stargate's Com1 for WINEVM access. That way Stargate can talk to HS3 while I can still access Stargate on WINEVM.

                    Sub Main(parm as object)
                    ' com port script to send data to a COM port
                    ' this script registers a callback script named StargateEventHandler5.vb
                    ' when data is received on the COM port the StargateEventHandler5.vb script is called and the
                    ' data is processed there.
                    ' This script only needs to be called once as the com port will stay open until closed.

                    dim e as string
                    dim i as integer

                    for i = 1 to 20 ' Make 20 attempts

                    e=hs.OpenComPortTerm(1,"9600,n,8,1",1,"StargateEventHandler5 .vb","Main",vbcr)

                    if e = "" then 'Success
                    hs.writelog("COM Port 1","Opened successfully for Stargate")
                    GoTo 1000: 'Done so exit

                    else 'Error so retry
                    hs.writelog("Error opening com1",e)
                    hs.writelog("Error Com1","Failed to open after " + str(i) + " attempts - re-try in 5 seconds")
                    hs.TriggerEventAndWait ("Stargate Comm Initialization - Wait") 'Re-try it in a few seconds

                    end if

                    next i

                    hs.writelog("Com1 Failed","Com 1 failed to open after 20 attempts")
                    hs.speak("Com 1 failed to open after 20 attempts")

                    1000: 'Continue

                    End Sub

                    Comment


                      #25
                      Originally posted by Burrington View Post
                      Here is the script I use. It is called from Startup.vb
                      Does it ever take more than one try to open the port? I just put the open command as a line in my Startup script and have had no failures.
                      Mike____________________________________________________________ __________________
                      HS3 Pro Edition 3.0.0.548, NUC i3

                      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                      Comment


                        #26
                        Originally posted by Uncle Michael View Post
                        Does it ever take more than one try to open the port? I just put the open command as a line in my Startup script and have had no failures.
                        Very occasionally. It missed a couple times so the lights weren't working and she who shall remain nameless noticed it before I did. Also, we are away for extended periods, so I wanted to make sure everything fired up correctly after power failures. So I added the test and retry routine. That part is even more important now with WIN10 doing automatic updates and rebooting itself every couple days whether you want it to or not...

                        Comment


                          #27
                          Getting HS to monitor COMM port for SG ASCII

                          Q for Mike:
                          How do you get HS to monitor the com port for ASCII in from the Stargate, you mention:
                          Note, the '$' at the end. When that character is received, HS automaticall calls the script, "GetSG_ASCII.vb", which parses the received ASCII string.

                          How operationally do you set that up to automatically call the script? Also, I am assuming that you have some sort of powerline interface connected to HS and are not using the SG powerline IF to control lights, etc...
                          Thanks in advance!
                          -Rob

                          Comment


                            #28
                            Originally posted by ggrumbles View Post
                            Q for Mike:
                            How do you get HS to monitor the com port for ASCII in from the Stargate, you mention:
                            Note, the '$' at the end. When that character is received, HS automaticall calls the script, "GetSG_ASCII.vb", which parses the received ASCII string.

                            How operationally do you set that up to automatically call the script? Also, I am assuming that you have some sort of powerline interface connected to HS and are not using the SG powerline IF to control lights, etc...
                            Rob,
                            Take a look a Post #2 in this thread. If that does not answer your question about getting HS to monitor for messages, I'll try elaborate further. (More specific questions will help focus my response.)

                            You are correct, I am using an XTB-232 interface connected to HS. I still have an interface connected to SG, but use it only to monitor X10 traffic and to send a 'heartbeat' X10 command periodically.
                            Mike____________________________________________________________ __________________
                            HS3 Pro Edition 3.0.0.548, NUC i3

                            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                            Comment


                              #29
                              Rob, I can answer that for you. The script is called automatically based on the OpenComPort statement. See my post above where it says "e=hs.OpenComPortTerm(1,"9600,n,8,1",1,"StargateEventHandler 5.vb","Main",vbcr)". The script, in my case "StargateEventHandler5.vb", is called every time Com port 1 receives characters terminated with a CR (carriage return). Mike uses a $ instead of a CR, but that is just personal preference. The script StargateEventHandler5.vb (you can call it anything you want) has all the scripting that handles the received ascii messages from Stargate and tells HS3 what to do with them.

                              Yes, you use the HS PLM to send/receive X10 traffic and stop Stargate from sending anything, otherwise the two PLM's conflict and gives lots of errors (I tried it and failed miserably...)

                              Here's what I did - works well (its not as bad as it looks):

                              Step 1) Create a file called "ComPortOpen1.vb" in your HS3 "scripts" folder, and copy the following into it. Make changes to customize to your situation.
                              ------------------------------------------------
                              Sub Main(parm as object)
                              ' com port script to send data to a COM port
                              ' this script registers a callback script named StargateEventHandler5.vb
                              ' when data is received on the COM port the StargateEventHandler5.vb script is called and the
                              ' data is processed there.
                              ' This script only needs to be called once as the com port will stay open until closed.

                              dim e as string
                              dim i as integer

                              for i = 1 to 20 ' Make 20 attempts

                              e=hs.OpenComPortTerm(1,"9600,n,8,1",1,"StargateEventHandler5 .vb","Main",vbcr)

                              if e = "" then 'Success
                              hs.writelog("COM Port 1","Opened successfully for Stargate")
                              GoTo 1000: 'Done so exit

                              else 'Error so retry
                              hs.writelog("Error opening com1",e)
                              hs.writelog("Error Com1","Failed to open after " + str(i) + " attempts - re-try in 5 seconds")
                              hs.TriggerEventAndWait ("Stargate Comm Initialization - Wait") 'Re-try it in a few seconds

                              end if

                              next i

                              hs.writelog("Com1 Failed","Com 1 failed to open after 20 attempts")
                              hs.speak("Com 1 failed to open after 20 attempts")

                              1000: 'Continue

                              End Sub
                              -----------------------------------------------------------


                              Step 2) Create the following event in HS3:
                              -------------------------------------------------
                              Event Name: Stargate Comm Initialization
                              IF This event is MANUALLY triggered
                              Then Run the script: C:/Program Files (x86)/HomeSeer HS3/scripts/ComPort1Open.vb
                              -------------------------------------------------

                              Step 3) Copy the following into the end of your existing "Startup.vb" file in the HS3 "scripts" folder.
                              -------------------------------------------------

                              ' Set up Comport 1 to receive responses from JDS Stargate
                              hs.TriggerEvent("Stargate Comm Initialization")
                              --------------------------------------------------

                              Step 4) Create a new script called "StargateEventHandler5.vb" and paste this into it. You will need to customize it to your situation of course:
                              --------------------------------------------------
                              Sub Main(ByVal response as String)

                              ' when mode is a 1, response is complete string
                              ' Stargate commands and responses all end with a CR (not CRLF).
                              ' Stargate commands are variable length but must start with a 3 digit command:
                              ' 3 digits command, x digits parameter, cr

                              ' Log the response for troubleshooting.
                              hs.writelog("Stargate Response",response)


                              ' Isolate the Event (first 3 characters) and select the correct handler
                              Dim StargateEvent As String = Left(response, 3)
                              ' Isolate the Parameter (rest of the string) and select the correct action to take
                              Dim StargateParameter As String = Mid(response, 4)

                              ' Analyze Received Events
                              Select Case StargateEvent

                              Case "INP"
                              'Digital input events
                              Dim Address as String = Left(StargateParameter, 1)
                              Dim Value as Object = Mid(StargateParameter, 2)

                              Select Case Address
                              Case "1"
                              hs.SetDeviceValue("s1",Value)

                              Case "2"
                              hs.SetDeviceValue("s2",Value)

                              Case "3"
                              hs.SetDeviceValue("s3",Value)

                              Case "4"
                              hs.SetDeviceValue("s4",Value)

                              Case "5"
                              hs.SetDeviceValue("s5",Value)

                              Case "6"
                              hs.SetDeviceValue("s6",Value)

                              Case "7"
                              hs.SetDeviceValue("s7",Value)

                              Case "8"
                              hs.SetDeviceValue("s8",Value)

                              Case "9"
                              hs.SetDeviceValue("s9",Value)

                              Case "A"
                              hs.SetDeviceValue("s10",Value)

                              Case "B"
                              hs.SetDeviceValue("s11",Value)

                              Case "C"
                              hs.SetDeviceValue("s12",Value)

                              Case "D"
                              hs.SetDeviceValue("s13",Value)

                              Case "E"
                              hs.SetDeviceValue("s14",Value)

                              Case "F"
                              hs.SetDeviceValue("s15",Value)

                              Case "G"
                              hs.SetDeviceValue("s16",Value)

                              Case Else
                              hs.speak("Stargate unknown digital input address")
                              hs.writelog("Stargate", "Unknown Digital Input Address")
                              End Select


                              Case "A/D"
                              'Analog input events
                              Dim Address as String = Left(StargateParameter, 1)
                              Dim Value as Object = Mid(StargateParameter, 2)

                              Select Case Address
                              Case "1"
                              hs.SetDeviceValue("14-s31",Value)
                              hs.SetDeviceValue("233-V85",Math.Abs(value-hs.DeviceValue(230)))

                              Case "2"
                              hs.SetDeviceValue("s32",Value)

                              Case "3"
                              hs.SetDeviceValue("s33",Value)

                              Case "4"
                              hs.SetDeviceValue("s34",Value)

                              Case "5"
                              hs.SetDeviceValue("s35",Value)

                              Case "6"
                              hs.SetDeviceValue("s36",Value)

                              Case "7"
                              hs.SetDeviceValue("s37",Value)

                              Case "8"
                              hs.SetDeviceValue("s38",Value)

                              Case Else
                              hs.speak("Stargate unknown analog input address")
                              hs.writelog("Stargate", "Unknown Analog Input Address")
                              End Select


                              Case "I/R"
                              'Infrared input events

                              Select Case StarGateParameter
                              Case "1HKON" 'MBR Receiver On
                              hs.SetDeviceValue("v23",100)

                              Case "1HKOFF" 'MBR Receiver Off
                              hs.SetDeviceValue("v23",0)

                              Case "2HKON" 'Ensuite MultiZone On
                              hs.SetDeviceValue("v25",100)

                              Case "2HKOFF" 'Ensuite MultiZone Off
                              hs.SetDeviceValue("v25",0)

                              Case "3HKON" 'Kitchen HK Receiver On
                              hs.SetDeviceValue("v22",100)

                              Case "3HKOFF" 'Kitchen HK Receiver Off
                              hs.SetDeviceValue("v22",0)

                              Case Else
                              hs.speak("Stargate unknown Infrared Response from Stargate")
                              hs.writelog("Stargate", "Unknown Infrared Response from Stargate")
                              End Select


                              Case "H2O"
                              'Water input events

                              Select Case StargateParameter
                              Case "REQOFF"
                              hs.SetDeviceValue("Z41",0)

                              Case "REQON"
                              hs.SetDeviceValue("Z41",100)

                              Case "STAT0"
                              hs.SetDeviceValue("Z40",0)

                              Case "STAT100"
                              hs.SetDeviceValue("Z40",100)

                              Case Else
                              hs.speak("Stargate unknown water input parameter")
                              hs.writelog("Stargate", "Unknown Water H2O Input Parameter")
                              End Select


                              Case "HVA"
                              'HVAC input events
                              Dim Command as String = Left(StargateParameter, 5)
                              Dim Value as integer = Mid(StargateParameter, 6)

                              Select Case Command

                              Case "NMODE"
                              hs.SetDeviceValue("127-V70",Value)

                              Case "SMODE"
                              hs.SetDeviceValue("126-V60",Value)

                              Case "NTEMP"
                              hs.SetDeviceValue("230-V73",Value)
                              hs.writelog("North Temp =", value)
                              hs.SetDeviceValue("233-V85",Math.Abs(value-hs.DeviceValue(14))) 'Set the Up/Down temp differential

                              Case "STEMP"
                              hs.SetDeviceValue("231-V63",Value)
                              hs.writelog("South Temp =", value)

                              Case "NSETP"
                              hs.SetDeviceValue("130-V71",Value)

                              Case "SSETP"
                              hs.SetDeviceValue("128-V61",Value)

                              Case Else
                              hs.speak("Stargate unknown HVAC input parameter")
                              hs.writelog("Stargate", "Unknown HVAC Input Parameter")
                              End Select


                              Case Else
                              hs.speak("Stargate unknown input command")
                              hs.writelog("Stargate", "Unknown Input Command")

                              End Select

                              End Sub
                              -------------------------------------------------

                              Step 5) Create Stargate events to send ascii text to HS. For example:
                              -------------------------------------------------
                              EVENT: HS<Digital Input 4 - Off
                              If
                              (DI: LEAK ELEC FL) Goes Off
                              Then
                              ASCII-Out 'INP40' [COM2] <-- Means Input 4 value 0 (Off)
                              End
                              -------------------------------------------------
                              another example
                              -------------------------------------------------
                              Step 6) Create a script file in HS "Scripts" folder called "StargateCommandSender.vb" and paste the following into it:
                              ------------------------------------------------
                              Sub Stargate(command as object)

                              ' Sends the characters in the parameter "command" to com port 1 (Stargate).
                              ' Use the following script format to send
                              EVENT: HS<Digital Input 4 - On
                              If
                              (DI: LEAK ELEC FL) Goes On
                              Then
                              ASCII-Out 'INP4100' [COM2] <-- Means Input 4 value 100 (On)
                              End
                              -------------------------------------------------


                              ' Existing script name: StargateCommandSender.vb
                              ' Optional Parameters: [Stargate],[command] <---!!note that Case must match exactly!!)
                              ' :eg. [Stargate] [X10P15ON]

                              hs.sendtocomport(1,command+vbcr)
                              hs.writelog ("Stargate command sent",command)

                              End Sub
                              -----------------------------------------------

                              Step 7) In HS3 events, add the following to send a command to Stargate:
                              -----------------------------------------------
                              Immediate script command.
                              Choose or change the script file to run: C:/Program Files (x86)/HomeSeer HS3/scripts/StargateCommandSender.vb
                              Sub or Function: Stargate
                              Parameters: H2OREQON <-- This can be anything you want, just needs to match up at the Stargate end.

                              Step 8) Build Stargate events to interpret incoming commands from HS. Examples:
                              ----------------------------------------------
                              EVENT: HS>Relay 2 - On
                              If
                              ASCII-In Match 'RLY2ON' Starting at Character 1 [COM2]
                              Then
                              (RELAY:Back H2O) ON
                              End
                              -------------------------------------------------

                              Confused yet? Sounds harder than it is. But it works...
                              Any questions just ask...

                              Comment


                                #30
                                Thank you so much! Yes, I understand completely. Def a different approach than when Glen did the plugin and I was testing, I dont even know where to get the native command set for SG anymore. I actually have never used the ASCII-OUT function with SG. I am in process of staging new box for HS3, the one I am running HS2 on is about 12 years old...lol. It is def gonna b some work to get it going but now I have a framework! I am wondering, however, what HS3 gives you over HS2. It seems interface is slicker and updated, but what else do you guys find that HS3 does or does/better than HS2?

                                warm regards,
                                -Rob

                                Comment

                                Working...
                                X