bt-sensors-plugin-sk 1.2.0-beta.0.0.6 → 1.2.0-beta.0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BTSensor.js CHANGED
@@ -321,7 +321,7 @@ class BTSensor extends EventEmitter {
321
321
 
322
322
  //create the 'location' parameter
323
323
 
324
- this.addDefaultParam("location")
324
+ //this.addDefaultParam("location")
325
325
 
326
326
  //create the 'RSSI' parameter
327
327
  this.addDefaultPath("RSSI","sensors.RSSI")
package/README.md CHANGED
@@ -1,8 +1,21 @@
1
1
  # Bluetooth Sensors for [Signal K](http://www.signalk.org)
2
2
 
3
- ## Beta 1.0.0
3
+ ## What's New
4
4
 
5
- Dynamic configuration added (no more screen refreshing necessary).
5
+ ## 1.2.0-beta-0.0.7
6
+
7
+ Added zone config param for environmental sensors. Removed location parameter.
8
+
9
+ ## 1.2.0-beta-0.0.6
10
+ Default values for paths for most sensor classes.
11
+
12
+ ## 1.2.0-beta-0.0.5
13
+
14
+ Added workaround to support multiple simultaneous GATT connections. Owing to problematic behavior in Bluez where making a GATT connection halted the scanner which made additional updates and connections impossible, added a scanner restart after making each GATT connection.
15
+
16
+ ## 1.2.0-beta-0.0.1
17
+
18
+ Dynamic configuration added. List updates when new devices are found by scanner. (No more screen refreshing necessary).
6
19
 
7
20
  ## WHAT IT IS
8
21
 
@@ -33,13 +46,13 @@ Signalk users with a Linux boat-puter (Windows and MacOS are NOT currently suppo
33
46
  NOTE: If you're running the 1.0.3 release, you will have to reconfigure your devices.<br>
34
47
 
35
48
  ### Signalk Appstore
36
- The plugin is currently available in the Signalk Appstore. <br>
49
+ The beta plugin is not currently available in the Signalk Appstore. <br>
37
50
 
38
51
  ### NPM
39
52
 
40
53
  Go to you signalk home (usually ~/.signalk) and run:
41
54
 
42
- npm i bt-sensors-plugin-sk@1.1.0-beta.2.1
55
+ npm i bt-sensors-plugin-sk@1.2.0-beta.0.0.7
43
56
 
44
57
  ### Linux
45
58
 
@@ -48,7 +61,7 @@ If you want to install directly from source (this is mostly of interest to custo
48
61
  <pre> cd ~/[some_dir]
49
62
  git clone https://github.com/naugehyde/bt-sensors-plugin-sk
50
63
  cd bt-sensors-plugin-sk
51
- git switch '1.1.0'
64
+ git switch '1.2.0-beta'
52
65
  git pull
53
66
  npm i
54
67
  [sudo] npm link
@@ -68,16 +81,11 @@ After installing and restarting Signalk you should see a "BT Sensors Plugin" opt
68
81
 
69
82
  On initial configuration, wait for your Bluetooth adapter to scan devices. The plugin will scan for new devices at whatever you set the "scan for new devices interval" value to. <br><br>
70
83
 
71
- > TIP: Close and re-open the config screen to refresh the screen. The config screen isn't as <i>reactive</i> as it oughtta be.<br><br>
72
-
73
- Then press the + button to add a sensor. Your screen should look something like this:<br><br>
74
- <img width="1122" alt="Screenshot 2024-10-13 at 6 52 52 PM" src="https://github.com/user-attachments/assets/0487b8d0-4bc0-4358-85c6-a507bc3c97d2">
75
-
76
84
  <br><br>
77
85
 
78
- Select the sensor you want Signalk to listen to from the drop down.<br>
86
+ Select the sensor you want Signalk to listen to from the list.<br>
79
87
 
80
- If you don't see your device and you know that it's on and nearby to the server, it may not be currently supported. But fear not, you can add custom sensor classes yourself. (Check out [the development section](#development).). <br><br>
88
+ If you don't see your device and you know that it's on and nearby to the server, it may not be currently supported (It could also be out of range.) But fear not, you can add custom sensor classes yourself. (Check out [the development section](#development).). <br><br>
81
89
 
82
90
  Now it's a simple matter of associating the data emitted by the sensor with the Signalk path you want it to update. (Also, you can name your sensor so when it appears in logs its easy to recognize.) <br><br>
83
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-sensors-plugin-sk",
3
- "version": "1.2.0-beta.0.0.6",
3
+ "version": "1.2.0-beta.0.0.7",
4
4
  "description": "Bluetooth Sensors for Signalk -- support for Victron devices, RuuviTag, Xiaomi, ATC and Inkbird, Ultrasonic wind meters, Mopeka tank readers, Renogy Battery and Solar Controllers, Aranet4 environment sensors, SwitchBot temp and humidity sensors, KilovaultHLXPlus smart batteries, and Govee GVH51xx temp sensors",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -33,6 +33,8 @@ class ATC extends BTSensor{
33
33
  }
34
34
  initSchema(){
35
35
  super.initSchema()
36
+ this.addDefaultParam("zone")
37
+
36
38
  this.addDefaultPath('batteryStrength','sensors.batteryStrength')
37
39
  .read=(buff)=>{return ((buff.readUInt8(12))/100)}
38
40
 
@@ -36,6 +36,8 @@ class GoveeH510x extends BTSensor{
36
36
 
37
37
  initSchema(){
38
38
  super.initSchema()
39
+ this.addDefaultParam("zone")
40
+
39
41
  this.addDefaultPath("temp","environment.temperature")
40
42
  this.addDefaultPath("humidity", "environment.humidity")
41
43
  this.addDefaultPath("battery","sensors.batteryStrength")
@@ -15,6 +15,8 @@ class Inkbird extends BTSensor{
15
15
 
16
16
  initSchema() {
17
17
  super.initSchema()
18
+ this.addDefaultParam("zone")
19
+
18
20
  this.addDefaultPath('temp','environment.temperature')
19
21
  this.addDefaultPath('battery', 'sensors.batteryStrength')
20
22
  if (this.getName() == 'sps'){
@@ -10,13 +10,14 @@ class RuuviTag extends BTSensor{
10
10
 
11
11
  initSchema(){
12
12
  super.initSchema()
13
+ this.addDefaultParam("zone")
14
+
13
15
  const md = this.valueIfVariant(this.getManufacturerData(this.constructor.manufacturerID))
14
16
  this.mode = md[0]
15
17
  if (this['_initModeV'+this.mode])
16
18
  this['_initModeV'+this.mode]()
17
19
  else
18
20
  throw new Error("Unrecognized Ruuvitag data mode "+md[0])
19
- this.addDefaultParam("zone")
20
21
 
21
22
  }
22
23
 
@@ -80,6 +80,8 @@ class ShellySBHT003C extends AbstractBTHomeSensor {
80
80
 
81
81
  initSchema() {
82
82
  super.initSchema()
83
+ this.addDefaultParam("zone")
84
+
83
85
  this.addDefaultPath(
84
86
  "battery",
85
87
  "sensors.batteryStrength")
@@ -37,6 +37,8 @@ class SwitchBotMeterPlus extends BTSensor{
37
37
  // Refer https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md#(new)-broadcast-message
38
38
 
39
39
  super.initSchema()
40
+ this.addDefaultParam("zone")
41
+
40
42
  this.addDefaultPath('temp', 'environment.temperature')
41
43
  .read= (buffer)=>{return (( ( ( (buffer[4] & 0x7f) + ((buffer[3] & 0x0f)/10) ) * ( (buffer[4] & 0x80)>0 ? 1 : -1 ) ) - ( (buffer[5] & 0x80)>0 ? 32 : 0) ) / ( (buffer[5] & 0x80)>0 ? 1.8 : 1) ) + 273.15 }
42
44
  this.addDefaultPath('humidity', 'environment.humidity')
@@ -39,6 +39,8 @@ class SwitchBotTH extends BTSensor {
39
39
 
40
40
  initSchema(){
41
41
  super.initSchema()
42
+ this.addDefaultParam("zone")
43
+
42
44
  this.addDefaultPath('temp', 'environment.temperature')
43
45
  .read=(buffer)=>{
44
46
  return (27315+(((buffer[8] & 0x0F)/10 + (buffer[9] & 0x7F)) * (((buffer[9] & 0x80)>0)?100:-100)))/100
@@ -207,6 +207,8 @@ class XiaomiMiBeacon extends BTSensor{
207
207
  }
208
208
  initSchema(){
209
209
  super.initSchema()
210
+ this.addDefaultParam("zone")
211
+
210
212
  this.addParameter(
211
213
  "encryptionKey",
212
214
  {