bt-sensors-plugin-sk 1.2.4-1 → 1.2.4-2
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/README.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Bluetooth Sensors for [Signal K](http://www.signalk.org)
|
|
2
|
-
# Version 1.2.4-
|
|
2
|
+
# Version 1.2.4-2
|
|
3
|
+
|
|
4
|
+
- RenogyRoverClient fix to Battery SOC calculation
|
|
5
|
+
- VictronBatteryMonitor set default aux mode to secondary voltage
|
|
6
|
+
- SwitchBotTH and Meter Plus ::identify errors fixed
|
|
7
|
+
- MercurySmartcraft::identify method fix
|
|
3
8
|
|
|
4
9
|
## WHAT'S NEW
|
|
5
10
|
|
|
11
|
+
# 1.2.4-1
|
|
12
|
+
|
|
6
13
|
- **NEW SENSOR** [Bank Manager](https://marinedcac.com/pages/bankmanager) (tested)
|
|
7
14
|
- **NEW SENSOR** [Mercury Smartcraft](https://www.mercurymarine.com/us/en/gauges-and-controls/displays/smartcraft-connect) (untested)
|
|
8
15
|
- Fixed Govee 5075 parsing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bt-sensors-plugin-sk",
|
|
3
|
-
"version": "1.2.4-
|
|
3
|
+
"version": "1.2.4-2",
|
|
4
4
|
"description": "Bluetooth Sensors for Signalk - see https://www.npmjs.com/package/bt-sensors-plugin-sk#supported-sensors for a list of supported sensors",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -21,7 +21,7 @@ class MercurySmartcraft extends BTSensor{
|
|
|
21
21
|
|
|
22
22
|
const name = await this.getDeviceProp(device,"Name")
|
|
23
23
|
const address = await this.getDeviceProp(device,"Address")
|
|
24
|
-
if (name == `VVM_${address.replace(":","")}`)
|
|
24
|
+
if (name && address && name == `VVM_${address.replace(":","")}`)
|
|
25
25
|
return this
|
|
26
26
|
else
|
|
27
27
|
return null
|
|
@@ -34,7 +34,7 @@ class RenogyRoverClient extends RenogySensor {
|
|
|
34
34
|
this.addMetadatum('batteryType', '', "battery type")
|
|
35
35
|
.default="electrical.chargers.{id}.battery.type"
|
|
36
36
|
this.addMetadatum('batteryPercentage', 'ratio', "battery percentage",
|
|
37
|
-
(buffer)=>{return buffer.readUInt16BE(3) })
|
|
37
|
+
(buffer)=>{return buffer.readUInt16BE(3)/100 })
|
|
38
38
|
.default="electrical.chargers.{id}.battery.soc"
|
|
39
39
|
|
|
40
40
|
this.addMetadatum('batteryVoltage', 'V', "battery voltage",
|
|
@@ -24,7 +24,7 @@ class SwitchBotMeterPlus extends BTSensor{
|
|
|
24
24
|
const keys = Object.keys(md)
|
|
25
25
|
if ( (keys && keys.length>0) && (sdKeys && sdKeys.length >0) ){
|
|
26
26
|
const id = keys[keys.length-1]
|
|
27
|
-
if (parseInt(id)==this.ID && md[id][0]==modelID && sdKeys[0] == this.serviceDataKey)
|
|
27
|
+
if (parseInt(id)==this.ID && md[id][0]==this.modelID && sdKeys[0] == this.serviceDataKey)
|
|
28
28
|
return this
|
|
29
29
|
}
|
|
30
30
|
return null
|
|
@@ -63,7 +63,7 @@ class SwitchBotMeterPlus extends BTSensor{
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
getName() {
|
|
66
|
-
return "
|
|
66
|
+
return `SwitchBot Meter Plus (${this?.name??"Unnamed"})`
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
}
|
|
@@ -32,7 +32,7 @@ class SwitchBotTH extends BTSensor {
|
|
|
32
32
|
const keys = Object.keys(md)
|
|
33
33
|
if (keys && keys.length>0){
|
|
34
34
|
const id = keys[keys.length-1]
|
|
35
|
-
if (parseInt(id)==this.ID && md[id].length==12 && md[id][0]==modelID)
|
|
35
|
+
if (parseInt(id)==this.ID && md[id].length==12 && md[id][0]==this.modelID)
|
|
36
36
|
return this
|
|
37
37
|
}
|
|
38
38
|
return null
|
|
@@ -59,7 +59,7 @@ class SwitchBotTH extends BTSensor {
|
|
|
59
59
|
return "Wonder Labs"
|
|
60
60
|
}
|
|
61
61
|
getName() {
|
|
62
|
-
|
|
62
|
+
return `SwitchBotTH (${this?.name??"Unnamed"})`
|
|
63
63
|
}
|
|
64
64
|
async propertiesChanged(props){
|
|
65
65
|
super.propertiesChanged(props)
|
|
@@ -22,7 +22,9 @@ class VictronBatteryMonitor extends VictronSensor{
|
|
|
22
22
|
d.currentProperties = {}
|
|
23
23
|
d.currentProperties.ManufacturerData={}
|
|
24
24
|
d.currentProperties.ManufacturerData[0x02e1]=b
|
|
25
|
-
d.
|
|
25
|
+
d.debug = (m)=>{console.log(m)}
|
|
26
|
+
d.debug.bind(d)
|
|
27
|
+
d.initSchema()
|
|
26
28
|
Object.keys(d.getPaths()).forEach((tag)=>{
|
|
27
29
|
d.on(tag,(v)=>console.log(`${tag}=${v}`))
|
|
28
30
|
})
|
|
@@ -72,7 +74,7 @@ class VictronBatteryMonitor extends VictronSensor{
|
|
|
72
74
|
this.addDefaultPath( 'ttg',"electrical.batteries.capacity.timeRemaining")
|
|
73
75
|
.read=(buff,offset=0)=>{return this.NaNif(buff.readUInt16LE(offset),0xFFFF)*60}
|
|
74
76
|
this.getPath("ttg").gatt='65970ffe-4bda-4c1e-af4b-551c4cf74769'
|
|
75
|
-
|
|
77
|
+
this.auxMode=VC.AuxMode.STARTER_VOLTAGE
|
|
76
78
|
try {
|
|
77
79
|
if (this.encryptionKey){
|
|
78
80
|
const decData = this.decrypt(this.getManufacturerData(0x02e1))
|