The Bluetooth Connector has been released and is available through the HomeSeer updater.
To download the latest release for HomeSeer 2.0 and HomeSeer 2.1, see here: http://board.homeseer.com/showthread.php?t=111846
Features:
- Supports both the Microsoft and the Widcomm Bluetooth Stacks. Does not support the Toshiba, BlueSoleil or other Bluetooth stacks.
- Supports RSSI (signal strength) on the Widcomm stack only
- Currently supports 3 polling methods (Connect to Service, Discover Services, or AutoDiscovery).
- The AutoDiscovery method does not support signal strength, as it does not connect to the device (It uses BT discovery packets).
- Configurable polling interval for each device
- Autocreates HomeSeer device for each BT Device, or use any existing (pre-created) HomeSeer device.
- You can rename the Bluetooth device to anything you want in the HomeSeer status page.
- Polling for each Bluetooth device can be independantly Enabled / Disabled from the web configuration interface.
- Additional "Device lost confirmation polls" configurable for each device.
- Supports setting multiple device strings and values based on signal strength through the plugin web configuration interface.
To install the plugin:
- Shutdown HomeSeer
- Unzip the attached file and copy the content to the HomeSeer 2 directory. There is an html subdirectory (for the web configuration interface) that must go to the HomeSeer 2 html subdirectory. If you copy the whole directory as-is, everything should be OK.
- Restart HomeSeer2
- Go to Setup / Interfaces
- Enable the 'BT Connector' interface (by clicking the 'Disabled' button)
- Click the 'Save' button
- Click the yellow 'Config' button
- An empty list of Bluetooth devices should appear
- Turn on a first Bluetooth device, and click the "Scan for new Bluetooth Devices" button
- After a while (please wait) the device should appear in the list (if it doesn't you can try to scan again)
- Click the 'Edit' button
- Fill a HomeSeer Device Code (such as w1...) in the 'HS Device' column
- Click 'Update'
- Click 'Enable'
Then you can go to the HomeSeer Device Status page, and watch your new Device Status (it may take as long as the specified polling period for the initial update)
How to use Signal Strengh and Device Strings
In the latest versions of the plugin, all this is configurable through the Web Configuration interface...
The description of the config file hspi_bt bellow is only kept here for reference.
Here is the format of a Bluetooth Device section in Config/hspi_bt.ini:
[Device0]
Enabled=True
BtAddress=(00:07:E0:5C:91:EC)
PollDelay=10
PollMethod=ConnectService
PollService=1
HsDevice="w1"
HsConfig0=2,Too Close, @(Network0) > 1
HsConfig1=1,Normal, @(Network0) >= -1
HsConfig2=3,Too Far, @(Network0) > -15
HsConfig3=0,Away, true
The HsConfigX entries are evaluated in order. The first boolean expression that matches will assign the specified device value and device string to the HomeSeer device.
HsConfigX= Device Value <HS device value>, Device String<HS device string>, Boolean expression
The Boolean expressions can be anything and follow the C# syntax.
The variables @(Network0), @(Network1), @(Network2)... represent the signal strength seen from each network (Bluetooth dongle).
For Example:
HsConfig0=5,Kitchen,@(Network0)>-5 && @(Network0)<1 && (@Network1)>-15 && (@Network1) <=0 && (@Network2) > -4
This will assign value 5 and status string "Kitchen" to the device if the boolean expression matches the specified signal strength from Networks 0, 1 and 2.
You should always add a last HsConfigX statement with expression "true" such as in the example (HsConfig3=0,Away, true). This last statement will match if none of the above statement matched.
If you use the Microsoft stack and want to use device strings, you can configure something very simple such as:
HsConfig0=1,Device Present, @(Network0)>=0
HsConfig1=0,Device Away, true
Don't forget that you may have to Shutdown HomeSeer before making manual changes to the .ini, because HomeSeer may cache the config file internaly.
Advanced functionalities of the expression evaluator (this may be usefull for advanced positionning if you have good BT dongles)
Valid unary operators: <CODE>-</CODE>, <CODE>!</CODE>, <CODE>~</CODE>.
Valid binary operators: <CODE>*</CODE>, <CODE>/</CODE>, <CODE>%</CODE>, <CODE>+</CODE>, <CODE>-</CODE>, <CODE><</CODE>, <CODE><=</CODE>, <CODE>></CODE>, <CODE>>=</CODE>, <CODE>==</CODE> (also <CODE>=</CODE>), <CODE>!=</CODE>, <CODE>&</CODE>, <CODE>^</CODE>, <CODE>!</CODE>, <CODE>&&</CODE>, <CODE>||</CODE>.
Parenthesis are evaluated first.
E-notation (<CODE>7.511E-10</CODE>) is allowed for numbers and...
Hexadecimal as well (<CODE>0xaaf1</CODE>).
Math functions:
"sin","cos","tan","sec","csc","cot","asin","acos","atan"
"sinh","cosh","tanh","abs","sqrt","ciel","floor","exp"
"log10","log","max","min","pow","round", "PI", "E"
DateTime functions:
"now","today","mindate","maxdate","monthname"
"adddays","addmonths","addyears","addhours","addminutes", "addseconds"
Logical functions:
"iif", "case"
Other:
- You may remove the dll BlueToolsMS.dll from your HomeSeer2 directory if you use the Widcomm stack
- You may remove BluetoolsWC.dll and BluetoolsWC150.dll if you use the MS stack.
- The Bluetooth lib doesn't currently support multiple dongles per computer. It should be available soon but I didn't get any release date from the Lib developer.
To download the latest release for HomeSeer 2.0 and HomeSeer 2.1, see here: http://board.homeseer.com/showthread.php?t=111846
Features:
- Supports both the Microsoft and the Widcomm Bluetooth Stacks. Does not support the Toshiba, BlueSoleil or other Bluetooth stacks.
- Supports RSSI (signal strength) on the Widcomm stack only
- Currently supports 3 polling methods (Connect to Service, Discover Services, or AutoDiscovery).
- The AutoDiscovery method does not support signal strength, as it does not connect to the device (It uses BT discovery packets).
- Configurable polling interval for each device
- Autocreates HomeSeer device for each BT Device, or use any existing (pre-created) HomeSeer device.
- You can rename the Bluetooth device to anything you want in the HomeSeer status page.
- Polling for each Bluetooth device can be independantly Enabled / Disabled from the web configuration interface.
- Additional "Device lost confirmation polls" configurable for each device.
- Supports setting multiple device strings and values based on signal strength through the plugin web configuration interface.
To install the plugin:
- Shutdown HomeSeer
- Unzip the attached file and copy the content to the HomeSeer 2 directory. There is an html subdirectory (for the web configuration interface) that must go to the HomeSeer 2 html subdirectory. If you copy the whole directory as-is, everything should be OK.
- Restart HomeSeer2
- Go to Setup / Interfaces
- Enable the 'BT Connector' interface (by clicking the 'Disabled' button)
- Click the 'Save' button
- Click the yellow 'Config' button
- An empty list of Bluetooth devices should appear
- Turn on a first Bluetooth device, and click the "Scan for new Bluetooth Devices" button
- After a while (please wait) the device should appear in the list (if it doesn't you can try to scan again)
- Click the 'Edit' button
- Fill a HomeSeer Device Code (such as w1...) in the 'HS Device' column
- Click 'Update'
- Click 'Enable'
Then you can go to the HomeSeer Device Status page, and watch your new Device Status (it may take as long as the specified polling period for the initial update)
How to use Signal Strengh and Device Strings
In the latest versions of the plugin, all this is configurable through the Web Configuration interface...
The description of the config file hspi_bt bellow is only kept here for reference.
Here is the format of a Bluetooth Device section in Config/hspi_bt.ini:
[Device0]
Enabled=True
BtAddress=(00:07:E0:5C:91:EC)
PollDelay=10
PollMethod=ConnectService
PollService=1
HsDevice="w1"
HsConfig0=2,Too Close, @(Network0) > 1
HsConfig1=1,Normal, @(Network0) >= -1
HsConfig2=3,Too Far, @(Network0) > -15
HsConfig3=0,Away, true
The HsConfigX entries are evaluated in order. The first boolean expression that matches will assign the specified device value and device string to the HomeSeer device.
HsConfigX= Device Value <HS device value>, Device String<HS device string>, Boolean expression
The Boolean expressions can be anything and follow the C# syntax.
The variables @(Network0), @(Network1), @(Network2)... represent the signal strength seen from each network (Bluetooth dongle).
For Example:
HsConfig0=5,Kitchen,@(Network0)>-5 && @(Network0)<1 && (@Network1)>-15 && (@Network1) <=0 && (@Network2) > -4
This will assign value 5 and status string "Kitchen" to the device if the boolean expression matches the specified signal strength from Networks 0, 1 and 2.
You should always add a last HsConfigX statement with expression "true" such as in the example (HsConfig3=0,Away, true). This last statement will match if none of the above statement matched.
If you use the Microsoft stack and want to use device strings, you can configure something very simple such as:
HsConfig0=1,Device Present, @(Network0)>=0
HsConfig1=0,Device Away, true
Don't forget that you may have to Shutdown HomeSeer before making manual changes to the .ini, because HomeSeer may cache the config file internaly.
Advanced functionalities of the expression evaluator (this may be usefull for advanced positionning if you have good BT dongles)
Valid unary operators: <CODE>-</CODE>, <CODE>!</CODE>, <CODE>~</CODE>.
Valid binary operators: <CODE>*</CODE>, <CODE>/</CODE>, <CODE>%</CODE>, <CODE>+</CODE>, <CODE>-</CODE>, <CODE><</CODE>, <CODE><=</CODE>, <CODE>></CODE>, <CODE>>=</CODE>, <CODE>==</CODE> (also <CODE>=</CODE>), <CODE>!=</CODE>, <CODE>&</CODE>, <CODE>^</CODE>, <CODE>!</CODE>, <CODE>&&</CODE>, <CODE>||</CODE>.
Parenthesis are evaluated first.
E-notation (<CODE>7.511E-10</CODE>) is allowed for numbers and...
Hexadecimal as well (<CODE>0xaaf1</CODE>).
Math functions:
"sin","cos","tan","sec","csc","cot","asin","acos","atan"
"sinh","cosh","tanh","abs","sqrt","ciel","floor","exp"
"log10","log","max","min","pow","round", "PI", "E"
DateTime functions:
"now","today","mindate","maxdate","monthname"
"adddays","addmonths","addyears","addhours","addminutes", "addseconds"
Logical functions:
"iif", "case"
Other:
- You may remove the dll BlueToolsMS.dll from your HomeSeer2 directory if you use the Widcomm stack
- You may remove BluetoolsWC.dll and BluetoolsWC150.dll if you use the MS stack.
- The Bluetooth lib doesn't currently support multiple dongles per computer. It should be available soon but I didn't get any release date from the Lib developer.
Comment