That's a damm fine idea to change the polling if you are out of the house. Has anyone worked out how to do it?
Announcement
Collapse
No announcement yet.
BT Connector 2.48.2.2 performance issues
Collapse
This topic is closed.
X
X
-
It seems like Emotion has
Originally posted by darren-mc View PostThat's a damm fine idea to change the polling if you are out of the house. Has anyone worked out how to do it?
Comment
-
Changing the polling times has been posted in the forum before. Here's my BTProcessing.vb script. Call in an event with the paramer "ClientID|Interval". Note, the client ID can change if you add/modify clients.
PHP Code:''' <summary>
''' Modify bluetooth client polling interval
''' </summary>
''' <param name="Params">Client|Interval where Client is the bluetooth client device name as
''' string and Interval is the time interval in seconds to poll</param>
''' <remarks>This function changes the polling interval for a client. It can be used
''' to make the polling interval longer when a client is detected or home and shorter
''' once the client is not detected or away. This allows the system to detect the client
''' faster on return without draining the battery while home.</remarks>
Public Sub ChangePolling(ByVal Params As String)
Dim Client As String
Dim Interval As String
Dim arrParm() As String
arrParm = Split(Params, "|", -1, 1)
Client = arrParm(0)
Interval = arrParm(1)
' Save the new PollDelay value
hs.SaveINISetting(Client, "PollDelay", Interval, "hspi_bt.ini")
' Force the plugin to update the polling interval
hs.Plugin("BT Connector").scanner.Devices(Client).ReloadConfig()
End Sub
Comment
-
Here's another example script of how to change the polling interval.
http://board.homeseer.com/showpost.p...2&postcount=57
I agree it would be great if this were built in to the plugin.
Comment
-
Hi Blinder,
I have several iPhones registered of all different versions with the Bluetooth connector, they work OK with "ConnectService". I've found you must always pair your phone up with the PC with HomeSeer not running - works much faster. Then you must do the Bluetooth Connector stuff within HomeSeer fairly soon afterwards before the Bluetooth stack gets too busy - again, this just saves time.
Here is a cut&paste of the Bluetooth routine taken from the Emotion application for HS which reconfigures the PollDelay and LostConfirm values to whatever you pass into the Sub.
The important line is section = hs.GetINISection(SectionName, "hspi_bt.ini") which allows you to change the settings in hspi_bt.ini in the HomeSeer directory somewhere (I think in C:\Program Files\HomeSeer HS2\Config). Then you need to do a hs.Plugin("BT Connector").scanner.Devices(SectionName).ReloadConfig() to commit those changes and make them active without having to restart HomeSeer.
Private Sub ConfigureBluetooth(ByVal PollDelay, ByVal LostConfirm, ByVal hcuc)
Dim BtDevice As String
Dim SectionName, items
Dim section As String = ""
Dim FoundSection As Boolean
BtDevice = hcuc.ToLower
For ds = 0 To MaxFriends
SectionName = "Device" & ds.ToString
Try
section = hs.GetINISection(SectionName, "hspi_bt.ini")
Catch : End Try
If section = "" Then
FoundSection = False
Exit For
End If
items = Split(section, Chr(0))
For I = 0 To UBound(items)
If Strings.Left(items(I), 9) = "HsDevice=" Then
If LCase(Mid(items(I), 10)) = BtDevice Then
FoundSection = True
Exit For
End If
End If
Next
If FoundSection = True Then 'Start configuring
Try
hs.SaveINISetting(SectionName, "PollDelay", PollDelay, "hspi_bt.ini")
hs.SaveINISetting(SectionName, "LostConfirm", LostConfirm, "hspi_bt.ini")
hs.Plugin("BT Connector").scanner.Devices(SectionName).ReloadConfig()
Catch ex As Exception
Try
If My.Settings.Debug Then hs.WriteLogEx(My.Settings.ComputerSpoken, "Sub ConfigureBluetooth failed on hs.Plugin")
Catch
End Try
End Try
Exit For
End If
Next
End Sub
Comment
Comment