Announcement

Collapse
No announcement yet.

Controlling Relays from HS

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Controlling Relays from HS

    I would like to control SG relays from a script in HS but haven't had any luck in figuring it out. What would a script look like to do this. I've been trying to do it from a one line script command such as
    &hs.SetDeviceStatus "Intercm Talk", 2 and I also tried SetDeviceValue.

    I can control the relays from the Status page just fine. I noticed that the log shows the relay names as "JDS Intercm Talk" so I tried that as well and then got an error saying that the "object does not support this property or method"

    The Stargate Help file is not much help. Is there some other better documentation out there?

    If anyone can shed some light on this for me, I would really appreciate it.

    thx -- greg

    #2
    There seems to be more wrong here than just controlling relays. I can't seem to control X10 either through SG by using a one line script action. I can do it through the status page ok which means HS is communicating to SG.

    Any ideas?

    -- greg

    Comment


      #3
      Search through the message board. Certain types of devices require certain calls. I believe that somebody compiled a list and posted it here within the past 12 months.

      For example, to set a relay, I use:
      hs.ExecX10 PagingDev,"on",0,0 'sets Paging Relay ON

      I think I do flags the same way. i check and set flags using:
      if hs.IsOn( )
      hs.ExecX10 poolspanotify, "off", 0, 0

      for variables, i use:
      if hs.DeviceValue(CatBoxCounter)>4
      hs.SetDeviceValue "[73",pool_temp

      Like I said, search the board. There is a list of what works and what doesn't. For me, I just do it as shown above and it works flawlessly.

      Tim

      Comment


        #4
        I just went through all my scripts and found I never set up a SG-relay directly from HS, probably because I came accross the same problem as you when setting-up my HS integration to HS.
        The first way would be to create an HS event that switches your SG relay ON (or off or toggle). Than you could fire this event, using conditional triggers or within a script (using hs.TriggerEvent).

        The second way will use SG events and flags. I guess this would be the best way to go if you already have put a good amout of work in your SG schedule, an wish to use what is the beauty of the SG-HS couple.

        Use a variable to pass commands between SG and HS.
        When HS sets the variable to 1, then do something with SG (here close a relay), when the variable is set to 2, SG could do something else (trip another relay). Don't forget to have SG set the variable to 0 after completing its event.

        Have fun

        Pierre
        Last edited by Pierre; February 3, 2008, 11:13 AM. Reason: misspelling
        Visit zee e-maison : http://www.e-maison.com

        Comment


          #5
          In my experience, hs.ExecX10 is the most reliable way to get SG to recognize a command that originates from HS. Another way to interact that I am using more frequently now is to call SG Then Macros from HS. In one case, the macro does nothing but toggle a SG relay on and off to simulate a button press. (I use the macros in my SG schedule too, so they are not there just to be called by HS, but in some cases I've structured them deliberately so that they are suitable for either case.)
          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


            #6
            I've done a lot of searching but haven't been able to find the list you are referring to. What I did find is a lot of other posts complaining about the lack of such a resource tho. This is something causual users that don't have much time to devote to searching for the answers such as my self would find very helpful. At the moment it is really limiting my ability to make progress.

            That being said, I spent about three hours today pushing through this and solved it.
            Here is the code that works:
            &hs.execx10byname "JDS Intercm Talk", "on"

            I found that HS inserts the JDS in front of the device name as shown on the Status list. You can see it in the log. When I inserted the JDS into the name it started working. Go figure. It sure would help if we didn't have to put on a miners hat on everytime we try and do something simple. I would pay a couple of hundred bucks just to have a good set of docs to help learn how to drive this contraption.

            Thanks for the help.

            -- greg

            Comment


              #7
              I should have mentioned that I also got it working with this code:
              &hs.execx10 "%10", "on"

              -- greg

              Comment


                #8
                Originally posted by noopara View Post
                I found that HS inserts the JDS in front of the device name as shown on the Status list. You can see it in the log. When I inserted the JDS into the name it started working. Go figure. It sure would help if we didn't have to put on a miners hat on everytime we try and do something simple. -- greg
                Greg,
                I understand your frustration. On the other hand, the HS User's Guide has this info for ExecX10ByName (emphasis is mine):
                ExecX10ByName

                Purpose

                This is functionally identical to ExecX10 except that the first parameter is the device name (location and name) instead of the device address.
                In the case of JDS devices, 'location' is 'JDS'. The User's Guide actually notes the convention that the device name consists of both location and name in several places.

                So, if you are fully into the mindset of the people writing the manual, you can see that they would argue that they have been very specific about what is required as input for this function. Unfortunately for the rest of us, it is still not very clear. In the absence of changing the convention, however, I'm not sure how to make it clearer. Do you have any suggestions?
                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


                  #9
                  Doing a search on hs.Exec10 in the JDS forum, I found the list that I remembered, posted by Mark Sullivan: It seems to still be correct.

                  http://board.homeseer.com/showpost.p...16&postcount=3

                  Thanks Glen, I THINK I get it now.

                  To help avoid future frustration, I did some experimenting to determine for myself which script device functions work with Stargate Flags, Relays, Variables, and DI's and their effect on Value and Status. This is what I found:

                  FLAGS
                  SetDeviceStatus (2ON or 3OFF) - This operates flag. It also sets DeviceValue to 1 or 0, respectively.
                  ExecX10 (On or Off) - This operates flag. It also correctly sets Value (1/0) and Status (2/3).
                  SetDeviceValue (0 or 1) - This does NOT operate flag. It does not set Status. It takes a long time, but it does set the Value.
                  DeviceValue, DeviceStatus, IsOn and IsOff all return correctly.

                  RELAYS
                  SetDeviceStatus (2ON or 3OFF) - This does NOT operate relay. But it does change Value and Status.
                  ExecX10 (On or Off) - This operates relay. It also correctly sets Value (1/0) and Status (2/3).
                  SetDeviceValue (0 or 1)- This does NOT operate relay. However, it does set the Value (1/0). Sets Status to Unknown.

                  VARIABLES
                  SetDeviceStatus (2ON or 3OFF) - Nothing useful.
                  ExecX10 (On or Off, with dimval{number}) - Surprisingly, this will set variable to number if you use dimval.
                  SetDeviceValue (number)- This does work, sets variable to number. Sets Status to unknown

                  DIGITAL INPUTS
                  Both DeviceValue and DeviceStatus seem to return the correct position of the input.

                  Mark

                  Another relevant post:

                  http://board.homeseer.com/showthread.php?t=122541&highlight=hs.execX10
                  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>

                  Comment


                    #10
                    Mike & Tim,

                    Thanks for the helpful info. I see the error of my ways now.

                    I still feel that I could learn faster if the users guide had more examples associated with each function. For some reason my brain doesn't always pick it up from the word explanation - give me an equation or a line of code and I get it.

                    Now on to the next challenge - making Speakeasy control SG relays. I'm using my whole house Greyfox Intercom as a means to communicate with HS as well as having both SG and HS use it to make announcements along with a few extra speakers here and there. The sound quality is quite good and the VR works pretty well. The problem is getting HS to switch SG relays before and after speaking. I'm trying to use the SpeakEasy plug-in to do this. If you have any ideas for a simple way to do accomplish the same thing, I'd love to hear it.

                    Thanks again for all the help.

                    -- greg

                    Comment


                      #11
                      Mike & Tim,

                      Thanks for the helpful info. I see the error of my ways now.

                      I still feel that I could learn faster if the users guide had more examples associated with each function. For some reason my brain doesn't always pick it up from the word explanation - give me an equation or a line of code and I get it.

                      Now on to the next challenge - making Speakeasy control SG relays. I'm using my whole house Greyfox Intercom as a means to communicate with HS as well as having both SG and HS use it to make announcements along with a few extra speakers here and there. The sound quality is quite good and the VR works pretty well. The problem is getting HS to switch SG relays before and after speaking. I'm trying to use the SpeakEasy plug-in to do this. If you have any ideas for a simple way to do accomplish the same thing, I'd love to hear it.

                      Thanks again for all the help.

                      -- greg

                      Comment


                        #12
                        Simple Method for SG Relay Conrol

                        Create an Event which Sets the Relay with a 1 sec delay and then Resets it with a 3 second delay. Works every time, cf.

                        05-Feb-08 05:27:46 Info Event Trigger "CycleMasterDoor"
                        05-Feb-08 05:27:47 Info Event Trigger "RO_MHallRQE (delayed action)"
                        05-Feb-08 05:27:47 Info Device: SG_Relays RO_MHallRQE (#14) ON
                        05-Feb-08 05:27:47 Info Deleting event after run: "Delayed Actions RO_MHallRQE (delayed action)"
                        05-Feb-08 05:27:47 JDS StarGate Relay #14 (SG_Relays RO_MHallRQE) set to ON
                        05-Feb-08 05:27:49 Info Event Trigger "RO_MHallRQE (delayed action)-1"
                        05-Feb-08 05:27:49 Info Device: SG_Relays RO_MHallRQE (#14) OFF
                        05-Feb-08 05:27:49 Info Deleting event after run: "Delayed Actions RO_MHallRQE (delayed action)-1"
                        05-Feb-08 05:27:49 JDS StarGate Relay #14 (SG_Relays RO_MHallRQE) set to OFF
                        05-Feb-08 05:27:56 JDS StarGate Digital $33 (SG_DigInputs DI_MHallDr) Changed to ON ------------Door Closed<door closed=""></door>

                        Comment


                          #13
                          Cairndhu1--

                          Sorry, but I should have been clearer about what I'm looking for. Here's what I'm trying to do.
                          1. push talk on intercom and speak attention phrase and
                          2. have hs sense that attention phrase came from intercom and
                          3. have hs answer through only the intercom, then
                          4. have hs sense the intercom push to talk has been pressed and
                          5. listen for a command after the "pop" and carry out the command, or
                          4. speak attention phrase from several other locations (mics) and
                          5. have hs sense what location attention phrase came from and
                          6. have hs speak through speaker at that location and
                          7. have hs speak general announcements to select speakers or intercom
                          depending on priority or subject or other variables

                          I've figured out how to do all of this and have most ofl the hardware. I believe the only issue is getting hs to switch the SG relay before it answers and then to switch the relay off when its done. The SpeakEasy plug-in is designed for this as a speak proxy, however it does not currently work with the SG plug-in. The SpeakEasy author might be able to incorporate changes so it will work so perhaps that will be my solution. It is a very powerful and flexible plug-in for speech handling. The reason for my post is to see if the HS/SG community has gone a different way with this problem since SG provides more options than plain HS.

                          I have worked out methods to control SG relays from HS to speak announcements through the intercom using delays as you suggest. This works out well especially when you know the time length of the announcement. In some cases the announcement (weather for example) can vary in length by 15 to 30 seconds from time to time. Using a speak proxy such as SpeakEasy eliminates the "dead air". Another issue I'm seeing is that the "pop" sound from the intercom's push to talk button (after you get HS's attention and then wish to issue a command) causes HS to "not understand". (bad attitude) I'm hoping that I will be able to solve that with a timing adjustment.

                          In a nutshell that's what I'm trying to do.

                          If anyone has solved this one already with the combo of HS and SG, I'd love to hear about it.

                          -- greg

                          Comment

                          Working...
                          X