Announcement

Collapse
No announcement yet.

How To Properly Turn On An Insteon Group From A Script?

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

    How To Properly Turn On An Insteon Group From A Script?

    I am unable to trigger an Insteon Group/Scene from a script anymore in HS3. Here is what I am doing:

    To turn on the Group/Scene

    hs.SetDeviceValueByRef({Reference ID of Insteon Group}, 1, True)

    When I call this, the Group/Scene ITSELF does show On, but the devices in the Group/Scene do not.

    If however I create an event to turn On the same the same Insteon Group/Scene and then call that event from my script, it works properly.

    How do I properly turn On an Insteon Group/Scene from a script?

    Jean-Marie Vaneskahian
    ---------------------------------------------------
    Jean-Marie G. Vaneskahian
    jean@vaneskahian.com
    ---------------------------------------------------

    #2
    this is a fundamental change in HS3:

    hs.SetDeviceValueByRef and related functions only change the value of the hs device but does not trigger an action to the plugin (like it did in HS2)

    you will need to do something like the following to control a hs device from script

    1. hs.CAPIControlHandler(hs.CAPIGetSingleControlByUse(hs.GetDev iceRefByName(devicename), ePairControlUse._On))

    2. can you also use a script cmd to run an event
    Mark

    HS3 Pro 4.2.19.5
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
    Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

    Comment


      #3
      I could not get the CAPI code you posted to work, but I did get this to work against the Insteon Group:

      hs.CAPIControlHandler(hs.CAPIGetSingleControl({Device Reference},True,"On",False,True))

      My question now is, how can I (On an individual Insteon light, not the group) set a specific light level from 1% to 99% using CAPI?

      For something so important, I am surprised CAPI is not well documented in HS3.

      Thanks for your help Mark!
      ---------------------------------------------------
      Jean-Marie G. Vaneskahian
      jean@vaneskahian.com
      ---------------------------------------------------

      Comment


        #4
        I'm not going to be able to answer all these questions. I'll need to refer you to the hs3 scripting forum for more expert help.

        the following has a simple example
        http://homeseer.com/support/homeseer...getcontrol.htm


        to dim you probably need to use the following
        use ePairControlUse._Dim

        please post back what you find out
        Mark

        HS3 Pro 4.2.19.5
        Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
        Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
        Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

        Comment


          #5
          I am searching, but not finding anything. I am simply amazed at this in HS3!

          It seems like they are pushing creating Events REALLY hard.

          I tried all the following with no success:

          My Device Reference is: 467

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"On", False,True))
          - This worked, turned the Insteon light On

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"Off" ,False,True))
          - This worked, turned the Insteon light Off

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"Dim" ,False,True))
          - This set the Dim level to 1%

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"Dim 2",False,True))
          - This failed and did nothing

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"Dim 50",False,True))
          - This failed and did nothing

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"Dim 50%",False,True))
          - This failed and did nothing

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"50", False,True))
          - This failed and did nothing

          hs.CAPIControlHandler(hs.CAPIGetSingleControl(467,True,"50%" ,False,True))
          - This failed and did nothing

          So, I have no idea how to set the Dim value of an Insteon light using the CRAPPY, I mean CAPI HS3 command. The idea that this is that hard to script on a platform like HomeSeer is insane.

          Why are there not examples how to specifically control a light in the HS3 documentation?

          Anyone know what I am doing wrong?

          Will I need to create an event for all the Dim levels I might want and then call the event with the proper dim level? (That is nuts)

          Thanks for any help.
          ---------------------------------------------------
          Jean-Marie G. Vaneskahian
          jean@vaneskahian.com
          ---------------------------------------------------

          Comment


            #6
            i found this in one of the blradar scripts:

            Dim CC As CAPIControl

            CC = hs.CAPIGetSingleControlByUse(hs.GetDeviceRefByName(devicenam e), ePairControlUse._Dim)
            CC.ControlValue = dimlevel
            hs.CAPIControlHandler(CC)
            devicename is a string value like "kitchen lights"

            dimlevel is a number 1 to 99
            Mark

            HS3 Pro 4.2.19.5
            Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
            Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
            Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

            Comment


              #7
              Mark, that did it! I was looking for a 1 liner, but that code snippet worked! Thanks!
              ---------------------------------------------------
              Jean-Marie G. Vaneskahian
              jean@vaneskahian.com
              ---------------------------------------------------

              Comment

              Working...
              X