Announcement

Collapse
No announcement yet.

Insteon scripting

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

    Insteon scripting

    Where can I find some insteon scripting commands. I am looking for basic stuff. Turn on a light switch, turn on to 50%. I searched all over and could find anything. Any help would be great. Thanks

    #2
    here is the protocol for transmitting an insteon cmd via script. this should cover just any thing you want to do.

    Public Sub TransmitInsteonCommand(ByVal HC As String, ByVal DC As String, ByVal InsteonCmd1 As Byte, ByVal InsteonCmd2 As Byte)

    you can find the insteon cmd set here:
    http://www.insteon.net/pdf/INSTEON_C..._20070925a.pdf
    www.madreporite.com/insteon/commands.htm

    there are new script functions for setting and getting device op flags and settings. see the latest plugin release notes.

    hope this helps
    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
      Almost got it

      Can you post a quick example to turn on a light to 50%? Would it be something like:

      hs.plugin("Insteon").setdevicevalue "Insteon ID", "Value", "50%"


      Or am I way off.

      Thanks.

      Comment


        #4
        if you just want to use standard hs functions/methods, you could do the following

        hs.setdevicevalue A1, 50

        where a1 is the devicecode for the insteon hs device, and 50 is the On level

        all the hs script commands are documented in the hs help so i won't go into them here.

        the script cmds avail via the plugin are the following:

        hs.plugin("Insteon").TransmitInsteonCommand
        hs.plugin("Insteon").setdevicesetting
        hs.plugin("Insteon").getdevicesetting
        hs.plugin("Insteon").setdeviceopflag
        hs.plugin("Insteon").getdeviceopflag

        these are for transmitting special insteon cmds to the device or more direct control of the device settings (typically changed via the plugin UI)

        holpe this helps
        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
          All Good

          Thank you, I think I got it now.

          Comment


            #6
            I need some help getting this script to execute from other stations on my LAN. I keep getting the "cannot create object" error if i try to run it from any computer other than the HS2 host.
            Code:
            dim hs
            set hsi = createobject ("HomeSeer2.application")
            hsi.SetHost "192.168.5.3"
            rval = hsi.Connect("default","default")
            if rval <> "" then
            msgbox rval
            end if
            Set hs = hsi.GetHSRef
            if hs.ison("\2") then hs.execx10 "\2","off",0 else hs.execx10 "\2","on",0
            Thanks for your assistance.

            Comment


              #7
              HI Bill,

              the object references you are making in your script are frin the homeseer executable running on your server. They will typically only run on the computer running Homeseer and plugins.


              You can look at something like this to see if that will work for you
              Paul

              Comment


                #8
                Thanks for the tip. Still no go. If I run the script from from a batch file referencing the script on the local machine, I get the "Microsoft VBScript runtime error: ActiveX
                component can't create object: 'HomeSeer2.application'" error.

                If I run the script from from a batch file referencing the script on the remote (HS2) machine, I get "CScript Error: Execution of the Windows Script Host failed. (Not enough storage
                is available to complete this operation. )"

                The script runs fine on the HS2 (XP) machine, either from a batch file or directly.

                This has to be doable... it seems so simple.

                Comment


                  #9
                  Insteon Scripting

                  Could someone give me an example using the transmitinsteoncommand below? I somewhat understand the insteon hex commands from the insteon developers guide, but I would like to see what exactly goes in the HC and DC.

                  TransmitInsteonCommand(ByVal HC As String, ByVal DC As String, ByVal InsteonCmd1 As Byte, ByVal InsteonCmd2 As Byte)

                  What I am trying to accomplish is sending a lock command to a keypadlinc. I successfully locked all of my dimmers using the built-in insteon action - send device command, but the keypads will not. It appears that the lock function (20 00) only works using a direct command which is what is sent to the dimmers, but for keypadlincs the send device command uses a group message (02 62 00 00 07 CF 20 00).

                  Although, it is possible that the keypads won't lock even with a direct command.
                  PS. using insteon plugin 1.7.3.1

                  Steve

                  Comment


                    #10
                    the hc/dc is the housecode/unitcode found on the hs status page. usually a character like / _ and then the unit code is a number

                    there is also an insteon action that might make this easier
                    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


                      #11
                      Ok, the HC is the hex code from the status page and the DC is the device category? or the message flags and/or to - from addresses? I assume that since the HC is given then you don't need the addresses.

                      Sorry if I am missing something here, but I did try the Insteon action of "send device comand" as mentioned earlier. It will not send a direct command to a keypadlinc, instead it will send a group message. If I use a built in command to change the backlight it will send a direct command. I believe I also need to send a direct command to change the lock opcode.

                      Steve

                      Comment


                        #12
                        steve can you post a screen shot of the hs status page showing the main on/off device of the kpl
                        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


                          #13
                          I would if I could, but apparently I do not have the
                          privileges to attach anything to my posts.
                          I don't have a "Manage Attachment" under additional options.
                          I only have: Miscellaneous Options, Thread Subscriptions and Rate Thread.

                          I created this account back in 2002 and this is the first time I have actually used it. My account profile list me a "Viewer".

                          Who do I contact to fix this?

                          Steve

                          Comment


                            #14
                            Rupp should be able to assist with the posting attachment issue
                            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


                              #15
                              Originally posted by norman100 View Post
                              I would if I could, but apparently I do not have the
                              privileges to attach anything to my posts.
                              I don't have a "Manage Attachment" under additional options.
                              I only have: Miscellaneous Options, Thread Subscriptions and Rate Thread.

                              I created this account back in 2002 and this is the first time I have actually used it. My account profile list me a "Viewer".

                              Who do I contact to fix this?

                              Steve
                              You have to have 8 or 10 posts before you are allowed to post attachments. So post a few blank posts and the ability to attach will show up.
                              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                              Comment

                              Working...
                              X