Announcement

Collapse
No announcement yet.

Sharing ideas for BT Connector usage

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

    #16
    Originally posted by Michel View Post
    Keep me inform on the stability of your set-up.

    What BT dungle are you using. What stack and what version.
    I was going to post today and brag about how well things went last night, and that things were working perfectly, but instead it will just be an update.

    Last night we got home late (after our exterior lights are set to turn off), and upon detecting our presence, the exterior lights came on as expected, making it much easier to see our way into the house.

    Now the problem is I made a mistake with the events and HS got stuck in an infinite loop - crashing in spectacular fashion as our lights turned on and off rapidly.

    I think I now have things sorted and will hopefully be able to report back in a week saying things are working now. So I'm still in the trial phases.

    To answer your other question, I purchased the IOgear GBU321 dongle, and it seems to work well enough to detect us when we get into the driveway.

    Jakob: Those are all great ideas, the only thing I would recommend is to have some sort of manual override in place, for times when the phone battery dies or other scenarios. It would be very bad for someone to be locked outside in the rain.

    Good luck!

    Comment


      #17
      We have key for those situations :-)
      Best,
      Jakob Sand, I automate everything!

      Comment


        #18
        Originally posted by Jakob.Sand View Post
        We have key for those situations :-)

        Of course you would...

        I thought it out right after I hit "Post" and almost went back and edited it-but decided it wouldn't hurt to make a fool of myself every once and a while.

        Comment


          #19
          Originally posted by stipus View Post
          If you add the BT Connector DLL to Scripting References, you can reload a single device configuration:

          hs.plugin( "BT Connector").scanner.Devices( "Device0" ).ReloadConfig()
          I think I've found where my infinite loop gets started, and it relates to reloading the entire config vs a single device config. The problem is that I can't seem to find any documentation on how to add the DLL as a scripting reference. Could someone point me in the right direction?

          Thanks!

          Comment


            #20
            Originally posted by Crashless View Post
            I think I've found where my infinite loop gets started, and it relates to reloading the entire config vs a single device config. The problem is that I can't seem to find any documentation on how to add the DLL as a scripting reference. Could someone point me in the right direction?

            Thanks!
            I'd like help with this as well.

            Thanks!

            Comment


              #21
              To add a scripting reference,
              - open Config/settings.ini
              - Find the entry ScriptingReferences=...
              - Add HSPI_BT;C:\Program Files\HomeSeer 2\hspi_bt.dll
              - Save and restart HomeSeer

              Replace C:\Program Files\HomeSeer 2\ with the path of your HomeSeer 2

              If you already have some data, separate entries with a comma. Here is a sample with 3 Scripting references:

              Code:
              ScriptingReferences=HSPI_SMSC;C:\Program Files\HomeSeer 2\hspi_smsc.dll,HSPI_SKYPE;C:\Program Files\HomeSeer 2\hspi_skype.dll,HSPI_SIP;C:\Program Files\HomeSeer 2\hspi_sip.dll
              --
              stipus

              Comment


                #22
                Originally posted by stipus View Post
                To add a scripting reference,
                - open Config/settings.ini
                - Find the entry ScriptingReferences=...
                - Add HSPI_BT;C:\Program Files\HomeSeer 2\hspi_bt.dll
                - Save and restart HomeSeer

                Replace C:\Program Files\HomeSeer 2\ with the path of your HomeSeer 2

                If you already have some data, separate entries with a comma. Here is a sample with 3 Scripting references:

                Code:
                ScriptingReferences=HSPI_SMSC;C:\Program Files\HomeSeer 2\hspi_smsc.dll,HSPI_SKYPE;C:\Program Files\HomeSeer 2\hspi_skype.dll,HSPI_SIP;C:\Program Files\HomeSeer 2\hspi_sip.dll
                Thank you!

                I did as you shared. I now get a different error:

                Code:
                4/20/2012 3:58:51 PM  - Error - Running script, script run or compile error in file: Bluetooth 30.txt450:Wrong number of arguments or invalid property assignment: 'hs.plugin(...).scanner.Devices' in line 3 More info: Wrong number of arguments or invalid property assignment: 'hs.plugin(...).scanner.Devices'
                Here is one of my scripts called Bluetooth 120.txt:

                Code:
                Sub Main
                hs.SaveINISetting "Device1","PollDelay","120","hspi_bt.ini"
                hs.plugin( "BT Connector").scanner.Devices( "Device1" ).ReloadConfig()
                End Sub
                The hspi_bt.ini is being changed to reflect the change of the Poll Delay. However, it does not appear to be reloading.
                Last edited by imott; April 21, 2012, 01:27 AM.

                Comment


                  #23
                  I don't understand why the command doesn't work. It should reload the device configuration. However, it depends on the Polling Method. If you are using the AutoDiscovery polling method, the AutoDiscoveryInterval is set at the Network level in the .ini file, and not at the Device level.


                  MAKE SURE YOU RUN ALL COMMANDS FROM A .VB SCRIPT
                  IT MAY NOT WORK FROM A .TXT SCRIPT AS IT MUST BE VB.NET


                  Here are some more commands you could use to reload some parts of the .ini file.

                  Command to Reload only one device: "Device1"

                  hs.plugin( "BT Connector").scanner.Devices( "Device1" ).ReloadConfig()


                  If you changed BT device configuration in the plugin .ini file, you may run the following command to reload all devices.

                  hs.plugin( "BT Connector").scanner.ReloadBtDevices()


                  If you changed any BT network configuration, you should reload both networks and devices:

                  hs.plugin( "BT Connector").scanner.ReloadBtNetworks()
                  hs.plugin( "BT Connector").scanner.ReloadBtDevices()
                  Last edited by stipus; April 21, 2012, 12:28 PM.
                  --
                  stipus

                  Comment


                    #24
                    Man! I hope I am not being a pest. Thank you for your help.

                    I changed .TXT to .VB. now when I run the script I get these in my log:
                    Code:
                    4/21/2012 8:48:33 PM 	Error 	Script compile error: Method arguments must be enclosed in parentheses.on line 15
                    Code:
                    4/21/2012 8:48:33 PM 	SCR 	Option Strict Offimports Schedulerimports SystemPublic Module scriptcode19#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin	 Public WithEvents hs As Scheduler.hsapplication	 Public WithEvents hsp As scheduler.hsp	 Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Mainhs.SaveINISetting "Device1","PollDelay","15","hspi_bt.ini"hs.plugin("BT Connector"),scanner.Devices ("Device1").ReloadConfig()End SubEnd Module
                    Here is my entry in ScriptingReferences:
                    Code:
                    ScriptingReferences=System.XML;System.XML.Dll,System.Data;System.Data.Dll,System.Web;System.Web.Dll,HSPI_BT;C:\Program Files\HomeSeer HS2\hspi_bt.dll
                    Can you see what is going on? I have not done a lot of scripting and none in VB.NET. This hill is kind of steep.

                    BTW...Would it be possible to add the ability to have different polling times for home and away as a feature to this plugin?

                    Thanks again!
                    Last edited by imott; April 22, 2012, 12:16 AM.

                    Comment


                      #25
                      Use parentheses for method arguments:

                      This:
                      hs.SaveINISetting "Device1","PollDelay","120","hspi_bt.ini"

                      Must be changed to:
                      hs.SaveINISetting( "Device1","PollDelay","120","hspi_bt.ini" )
                      --
                      stipus

                      Comment


                        #26
                        Copy and pasted as directed. New error:
                        Code:
                        4/22/2012 2:46:47 PM 	Error 	Scripting runtime error: System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
                        Last edited by imott; April 23, 2012, 12:03 AM.

                        Comment


                          #27
                          Parameter count mismatch, for one of your method calls.

                          Can you copy/paste your entire script ?
                          --
                          stipus

                          Comment


                            #28
                            Code:
                            Sub Main
                            hs.SaveINISetting( "Device1","PollDelay","120","hspi_bt.ini" )
                            hs.plugin( "BT Connector").scanner.Devices( "Device1" ).ReloadConfig()
                            End Sub

                            Comment


                              #29
                              Essaye ceci:

                              PHP Code:
                              Sub Mainparam As Object )
                                
                              hs.SaveINISetting"Device1","PollDelay","120","hspi_bt.ini" )
                                
                              hs.plugin"BT Connector").scanner.Devices"Device1" ).ReloadConfig()
                              End Sub 
                              --
                              stipus

                              Comment


                                #30
                                Perfect!!!

                                Thank you!!!


                                Comment

                                Working...
                                X