Announcement

Collapse
No announcement yet.

Insteon_ExtDevSupport_Source.vb

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

    Insteon_ExtDevSupport_Source.vb

    I get (and always have been getting) the Insteon message "External device support script does not exist in the HomeSeer scripts directory" on HS startup.

    I do see Insteon_ExtDevSupport_Source.vb in the HS Scripts sub-directory. I tried changing its extension to .txt: still no go. Note that HS is not installed in the default directory.

    How and where does the Insteon plug-in look for this script ?

    #2
    The sample file distributed with HomeSeer has TWO extensions -- Insteon_ExtDevSupport.vb.txt -- and if you are using Explorer with the "hide extensions of known file types" option turned on, you won't see the .txt part. Make extensions visible (or use something less brain-dead than Explorer) and rename Insteon_ExtDevSupport.vb.txt to Insteon_ExtDevSupport.vb (removing the .txt at the end).

    It's hard to pick the dumbest thing Microsoft ever did while trying to make Windows look like the Mac, but hiding file extensions is in the top 10.

    To answer your question of how the plug-in finds it: The plug-in gets the HomeSeer install directory from HomeSeer (app_path from the settings.ini file), adds "\scripts\Insteon_ExtDevSupport.vb" to it, and tries to find the file. If you bodily moved the HomeSeer files from the default directory or renamed the directory after installation, check the app_path value, and make sure it matches reality. You'll have no end of troubles if it doesn't.

    Comment


      #3
      Jeffry,

      First of all, thanks. I've found your replies on previous messages very helpful.

      As for this current post:
      • HomeSeer finds its Startup.txt, as well as a Call Back script, in the ...\Scripts directory , so paths are OK. Root path is "G:\Domotique\HomeSeer 2".
      • I seem to remember having problems with my Call Back script when it had a .vb extension; I changed it to .txt and all was fine. Tried the same with Insteon_ExtDevSupport_Source but still no go.
      So the Insteon plug-in seems to have a peculiar method of locating the script. I'm sure it's something silly, but what ?

      Comment


        #4
        Bonjour, Claude.

        When you look in G:\Domotique\HomeSeer 2\Scripts, do you see any files at all starting with the word Insteon? Try opening a command prompt, going to G:\Domotique\HomeSeer 2\Scripts, and doing a dir insteon*.* then posting the results.

        Comment


          #5
          Trust me, it's there, I've edited it to include some new devices.

          Again, since everybody else seems to find their way to this sub-directory, what's different with the way the Insteon plug-in searches for Insteon_ExtDevSupport_Source.vb ?

          G:\Domotique\HomeSeer 2\Scripts>dir
          Volume in drive G is DAT2-D0
          Volume Serial Number is 643C-0DF8
          Directory of G:\Domotique\HomeSeer 2\Scripts
          2008-03-23 16:45 <DIR> .
          2008-03-23 16:45 <DIR> ..
          2006-04-24 13:20 54,128 enerzone.thm
          2007-02-03 14:37 15,576 Insteon_ExtDevSupport_Source 080323.vb
          2008-03-23 16:13 17,544 Insteon_ExtDevSupport_Source.vb
          2008-01-10 18:35 1,355 LogStatChange.txt
          2005-03-15 23:50 18,086 rc100.thm
          2005-03-15 23:50 17,930 rc80.thm
          2005-03-15 23:50 39,915 rcs_tr15.thm
          2006-04-13 09:28 27,521 rcs_tx15b.thm
          2005-03-15 23:50 80 shutdown.txt
          2008-01-13 02:16 531 startup.txt
          2006-05-12 16:39 13,394 zstat.thm
          11 File(s) 206,060 bytes
          2 Dir(s) 141,571,964,928 bytes free
          G:\Domotique\HomeSeer 2\Scripts>

          Comment


            #6
            Look at your listing again. Your file is named Insteon_ExtDevSupport_Source.vb, but it's supposed to be named Insteon_ExtDevSupport.vb -- remove the _Source from the filename, and you should be fine.

            Comment


              #7
              Aren't discussion forums great ! Thanks again. That did it. Talk about looking all over town when it was just in your back yard !

              Now onto the next step ...

              All I'm trying to do is have HS register a 'virtual' device via scripting (as per Jon's suggestion). From what I gather, if I define a device through Insteon_ExtDevSupport.vb, not only will I need to invoke hs.RegisterStatusChangeCB to handle reactions to any status/value change of the device, but HS is totally ignorant of my device via its Web interface.

              I originally thought that this script would be useful for registering 'weird' devices, but then HS would treat it as a known device in its Web interface and there I could easily set events on that device. Except I don't see my virtual device on the Managed devices page.

              Am I understanding this right so far ?

              Comment


                #8
                The term "virtual device" can have many meanings, but it always refers to a device entry in HomeSeer that doesn't correspond to a physical device.

                I use bunches of them, mostly to track states, enable/disable alarms, and such. The easiest way to make a virtual device is to click the Add Device button on the HomeSeer status page. Give it a name and a room, then choose the best representation from the drop-down for device type. Most of mine are "Status Only" or "Virtual." Then pick an X10 code that (a) isn't in use, and (b) isn't a real X10 code. All the lower-case housecodes are virtual in that HomeSeer knows they aren't "real" devices. HomeSeer will never send or receive X10 for them, but you can use them for events, status displays, clicking, etc.

                It's possible, but harder, to create virtual Insteon devices. (To be picky, you'll create virtual X10 devices and tie them to Insteon events. From the HomeSeer status page, it'll look like you're directly controlling Insteon devices, but you're actually interacting with scripts.) The most logical place to do this would be from within Insteon_ExtDevSupport.vb. You use the scripting functions to create virtual X10 devices (see the above paragraph), then write code to manage the state of those devices depending on input and output to your Insteon device. I do this, for example, with a SimpleHomeNet EZIO2x4 that manages my garage doors. When a door opens, the EZIO2x4 sends an Insteon broadcast. Since I have the device ID registered with HomeSeer as belonging to my script, HomeSeer sends a message to my script through the named callback, and my script sets the virtual X10 device's status to match. Regular HomeSeer events then turn on the garage light, beep at me if the door doesn't close again promptly, and so forth. This takes a bit of programming, but it's all VBScript, so it's not difficult.

                As an example only, I'm attaching my script to handle the EZIO2x4 in the garage. You'll want to pick it apart to see how it works, then customize it for yourself.

                N.B. I don't put much code into Insteon_ExtDevSupport.vb. Instead, I create a separate script for each device (or class of devices if there are multiples that can share the same script), then just add a line to Insteon_ExtDevSupport.vb to call them. Makes things much easier to keep organized.

                Filename: EZIO2x4-Garage.vb
                Attached Files

                Comment


                  #9
                  Here is an example Insteon_ExtDevSupport.vb file to support my example EZIO2x4 script above:

                  Code:
                  Sub RegisterDevices(ByVal parm As Object)
                  
                      Try
                          hs.RunEx("EZIO2x4-Garage.vb",          "RegisterDevices",parm)        ' handles garage and gates
                  
                      Catch ex As Exception
                          hs.WriteLog("Insteon_ExtDevSupport","Error in Insteon_ExtDevSupport:RegisterDevices " & ex.ToString)
                      End Try
                  End Sub
                  Yes, that's the whole thing. The idea is to keep it lean and mean, and keep your device-dependent code in a separate file. This way, when the next forum poster shares his cool Insteon_ExtDevSupport script, you only have to give it a unique name and drop a line in the main file to activate it.

                  Be sure to save your sample Insteon_ExtDevSupport.vb file in a safe place, so you can refer back to it.

                  Comment


                    #10
                    Thanks Jeffry. I'll look into this later this week.

                    Comment


                      #11
                      Hi all I am testing this script with my 2x4 device and this is the first one that seems to work. There is one exception. The sensors do not report status changes unless i click the verify button. Is there anything that I can do about this?

                      Regards,
                      CM
                      HomeSeer Version: HS3 Pro Edition
                      Operating System: Microsoft Windows 10 Pro
                      Processor Type and Speed: i7 - 3.26 GHz
                      Total Physical Memory: 16Gig

                      Plugins: BlBackup | EasyTrigger | FitbitSeer | HSTouchServer | Insteon | WeatherXML

                      Comment


                        #12
                        Never mind, i monkeyed with the script a bit and figured out a way to get it to see the status updates. Probably not the best way but it works.

                        CM
                        HomeSeer Version: HS3 Pro Edition
                        Operating System: Microsoft Windows 10 Pro
                        Processor Type and Speed: i7 - 3.26 GHz
                        Total Physical Memory: 16Gig

                        Plugins: BlBackup | EasyTrigger | FitbitSeer | HSTouchServer | Insteon | WeatherXML

                        Comment

                        Working...
                        X