bt-sensors-plugin-sk 1.2.0-beta.0.0.5 → 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 +2 -1
- package/README.md +20 -12
- package/package.json +1 -1
- package/sensor_classes/ATC.js +2 -0
- package/sensor_classes/GoveeH510x.js +2 -0
- package/sensor_classes/Inkbird.js +2 -0
- package/sensor_classes/MopekaTankSensor.js +19 -10
- package/sensor_classes/RuuviTag.js +2 -1
- package/sensor_classes/ShellySBHT003C.js +2 -0
- package/sensor_classes/SwitchBotMeterPlus.js +2 -0
- package/sensor_classes/SwitchBotTH.js +2 -0
- package/sensor_classes/UltrasonicWindMeter.js +8 -4
- package/sensor_classes/VictronACCharger.js +15 -4
- package/sensor_classes/VictronInverterRS.js +17 -6
- package/sensor_classes/VictronLynxSmartBMS.js +13 -9
- package/sensor_classes/VictronOrionXS.js +13 -1
- package/sensor_classes/XiaomiMiBeacon.js +2 -0
package/BTSensor.js
CHANGED
|
@@ -101,6 +101,7 @@ function preparePath(obj, str) {
|
|
|
101
101
|
|
|
102
102
|
class BTSensor extends EventEmitter {
|
|
103
103
|
//static metadata=new Map()
|
|
104
|
+
|
|
104
105
|
static DEFAULTS = require('./plugin_defaults.json');
|
|
105
106
|
|
|
106
107
|
/**
|
|
@@ -320,7 +321,7 @@ class BTSensor extends EventEmitter {
|
|
|
320
321
|
|
|
321
322
|
//create the 'location' parameter
|
|
322
323
|
|
|
323
|
-
this.addDefaultParam("location")
|
|
324
|
+
//this.addDefaultParam("location")
|
|
324
325
|
|
|
325
326
|
//create the 'RSSI' parameter
|
|
326
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
|
-
##
|
|
3
|
+
## What's New
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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": {
|
package/sensor_classes/ATC.js
CHANGED
|
@@ -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'){
|
|
@@ -276,7 +276,7 @@ class MopekaTankSensor extends BTSensor{
|
|
|
276
276
|
this.addParameter("medium",
|
|
277
277
|
{
|
|
278
278
|
title:"type of liquid in tank",
|
|
279
|
-
enum: Object.keys(Media)
|
|
279
|
+
enum: Object.keys(Media)
|
|
280
280
|
}
|
|
281
281
|
)
|
|
282
282
|
this.addParameter("tankHeight",
|
|
@@ -286,34 +286,43 @@ class MopekaTankSensor extends BTSensor{
|
|
|
286
286
|
unit:"mm"
|
|
287
287
|
}
|
|
288
288
|
)
|
|
289
|
+
this.addDefaultParam("id")
|
|
289
290
|
|
|
290
|
-
this.
|
|
291
|
-
((buffer)=>{
|
|
291
|
+
this.addDefaultPath("battVolt","sensors.batteryVoltage")
|
|
292
|
+
.read=((buffer)=>{
|
|
292
293
|
this.battVolt = (buffer.readUInt8(1)/32)
|
|
293
294
|
return this.battVolt
|
|
294
295
|
}).bind(this)
|
|
295
|
-
|
|
296
|
-
this.
|
|
297
|
-
(buffer)=>{ return Math.max(0, Math.min(1, (((this.battVolt) - 2.2) / 0.65))) }
|
|
298
|
-
|
|
296
|
+
|
|
297
|
+
this.addDefaultPath("battStrength", "sensors.batteryStrength")
|
|
298
|
+
.read=(buffer)=>{ return Math.max(0, Math.min(1, (((this.battVolt) - 2.2) / 0.65))) }
|
|
299
|
+
|
|
299
300
|
this.addMetadatum("temp","K","temperature",
|
|
300
301
|
((buffer)=>{
|
|
301
302
|
this.temp = parseFloat(((buffer.readUInt8(2)&0x7F)+233.15).toFixed(2))
|
|
302
303
|
return this.temp
|
|
303
|
-
})
|
|
304
|
+
})
|
|
304
305
|
)
|
|
306
|
+
.default="tanks.{id}.temperature"
|
|
305
307
|
this.addMetadatum("tankLevel","ratio","tank level",
|
|
306
308
|
(buffer)=>{ return (this._tankLevel(((buffer.readUInt16LE(3))&0x3FFF)))/this.getTankHeight()}
|
|
307
309
|
)
|
|
310
|
+
.default="tanks.{id}.currentLevel"
|
|
311
|
+
|
|
308
312
|
this.addMetadatum("readingQuality","","quality of read",
|
|
309
313
|
(buffer)=>{ return buffer.readUInt8(4)>>6}
|
|
310
314
|
)
|
|
315
|
+
.default="sensors.{macAndName}.readingQuality"
|
|
316
|
+
|
|
311
317
|
this.addMetadatum("accX","Mg","acceleration on X-axis",
|
|
312
318
|
(buffer)=>{ return buffer.readUInt8(8)}
|
|
313
319
|
)
|
|
320
|
+
.default="sensors.{macAndName}.accelerationXAxis"
|
|
321
|
+
|
|
314
322
|
this.addMetadatum("accY","Mg","acceleration on Y-axis",
|
|
315
323
|
(buffer)=>{ return buffer.readUInt8(9)}
|
|
316
324
|
)
|
|
325
|
+
.default="sensors.{macAndName}.accelerationYAxis"
|
|
317
326
|
}
|
|
318
327
|
|
|
319
328
|
propertiesChanged(props){
|
|
@@ -326,8 +335,8 @@ class MopekaTankSensor extends BTSensor{
|
|
|
326
335
|
if (this.name)
|
|
327
336
|
return this.name
|
|
328
337
|
|
|
329
|
-
const _name =
|
|
330
|
-
return _name?_name:
|
|
338
|
+
const _name = MopekaDevice.get(this?.modelID??0x0).name
|
|
339
|
+
return _name?_name:MopekaDevice.get(0x0).name
|
|
331
340
|
|
|
332
341
|
}
|
|
333
342
|
}
|
|
@@ -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
|
|
|
@@ -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
|
|
@@ -27,16 +27,20 @@ class UltrasonicWindMeter extends BTSensor{
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
(buffer)=>{return (buffer.readUInt8())/100}
|
|
30
|
+
initSchema(){
|
|
31
|
+
super.initSchema()
|
|
32
|
+
this.addDefaultPath("batt",'sensors.batteryStrength')
|
|
33
|
+
.read=(buffer)=>{return (buffer.readUInt8())/100}
|
|
34
|
+
|
|
34
35
|
this.addMetadatum("awa","rad","Apparent Wind Angle",
|
|
35
36
|
(buffer)=>{return ((buffer.readInt16LE())/100)*(Math.PI/180)}
|
|
36
37
|
)
|
|
38
|
+
.default='environment.wind.angleApparent'
|
|
39
|
+
|
|
37
40
|
this.addMetadatum("aws","m/s","Apparent Wind Speed",
|
|
38
41
|
(buffer)=>{return (buffer.readInt16LE()/100)*.514444} //convert knots to m/s
|
|
39
42
|
)
|
|
43
|
+
.default='environment.wind.speedApparent'
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
initGATTConnection(){
|
|
@@ -31,28 +31,39 @@ class VictronACCharger extends VictronSensor{
|
|
|
31
31
|
|
|
32
32
|
initSchema(){
|
|
33
33
|
super.initSchema()
|
|
34
|
+
this.addDefaultParam("id")
|
|
34
35
|
|
|
35
36
|
this.addMetadatum('state','', 'device state',
|
|
36
37
|
(buff)=>{return VC.OperationMode.get(buff.readUInt8(0))})
|
|
37
|
-
|
|
38
|
+
.default= "electrical.chargers.{id}.state"
|
|
38
39
|
this.addMetadatum('chargerError','', 'charger error code',
|
|
39
40
|
(buff)=>{return VC.ChargerError.get(buff.readUInt8(1))})
|
|
40
|
-
|
|
41
|
+
.default= "electrical.chargers.{id}.error"
|
|
42
|
+
|
|
41
43
|
this.addMetadatum('batt1','V', 'battery 1 voltage')
|
|
44
|
+
.default= "electrical.chargers.{id}.battery1.voltage"
|
|
42
45
|
|
|
43
46
|
this.addMetadatum('curr1','A', 'battery 1 current')
|
|
47
|
+
.default= "electrical.chargers.{id}.battery1.current"
|
|
44
48
|
|
|
45
49
|
this.addMetadatum('batt2','V', 'battery 2 voltage')
|
|
50
|
+
.default= "electrical.chargers.{id}.battery2.voltage"
|
|
46
51
|
|
|
47
52
|
this.addMetadatum('curr2','A', 'battery 2 current')
|
|
53
|
+
.default= "electrical.chargers.{id}.battery2.current"
|
|
48
54
|
|
|
49
55
|
this.addMetadatum('batt3','V', 'battery 3 voltage')
|
|
56
|
+
.default= "electrical.chargers.{id}.battery3.voltage"
|
|
50
57
|
|
|
51
58
|
this.addMetadatum('curr3','A', 'battery 3 current')
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
.default= "electrical.chargers.{id}.battery3.current"
|
|
60
|
+
|
|
61
|
+
this.addMetadatum('temp', 'K', 'charger temperature')
|
|
62
|
+
.default= "electrical.chargers.{id}.temperature"
|
|
54
63
|
|
|
55
64
|
this.addMetadatum('acCurr','A', 'AC current')
|
|
65
|
+
.default= "electrical.chargers.{id}.ac.current"
|
|
66
|
+
|
|
56
67
|
}
|
|
57
68
|
emitValuesFrom(buffer){
|
|
58
69
|
super.emitValuesFrom(buffer)
|
|
@@ -11,22 +11,33 @@ class VictronInverterRS extends VictronSensor{
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
initSchema() {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
super.initSchema()
|
|
15
|
+
this.addDefaultParam("id")
|
|
16
16
|
this.addMetadatum('deviceState','', 'inverter device state',
|
|
17
|
-
|
|
17
|
+
(buff)=>{return VC.OperationMode.get(buff.readIntU8(0))})
|
|
18
|
+
.default='electrical.inverters.{id}.state'
|
|
19
|
+
|
|
18
20
|
const md = this.addMetadatum('chargerError','', 'charger error',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
(buff)=>{return VC.ChargerError(buff.readIntU8(1))})
|
|
22
|
+
.default='electrical.inverters.{id}.error'
|
|
23
|
+
md.notify=true
|
|
21
24
|
|
|
22
25
|
this.addMetadatum('batteryVoltage','V', 'battery voltage',
|
|
23
26
|
(buff)=>{return this.NaNif(buff.readInt16LE(2),0x7FFF)/100})
|
|
27
|
+
.default='electrical.inverters.{id}.battery.voltage'
|
|
28
|
+
|
|
24
29
|
this.addMetadatum('pvPower','W', 'PV power',
|
|
25
30
|
(buff)=>{return this.NaNif(buff.readUInt16LE(4), 0xffff)})
|
|
31
|
+
.default='electrical.inverters.{id}.power'
|
|
32
|
+
|
|
26
33
|
this.addMetadatum('yieldToday','W', 'yield yoday in watts',
|
|
27
34
|
(buff)=>{return this.NaNif(buff.readUInt16LE(6), 0xffff)*10})
|
|
35
|
+
.default='electrical.inverters.{id}.yieldToday'
|
|
36
|
+
|
|
28
37
|
this.addMetadatum('acOutPower','W', 'AC out power in watts',
|
|
29
|
-
(buff)=>{this.NaNif(buff.readInt16LE(8), 0x7fff)})
|
|
38
|
+
(buff)=>{this.NaNif(buff.readInt16LE(8), 0x7fff)})
|
|
39
|
+
.default='electrical.inverters.{id}.ac.power'
|
|
40
|
+
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
emitValuesFrom(decData){
|
|
@@ -22,24 +22,28 @@ class VictronLynxSmartBMS extends VictronSensor{
|
|
|
22
22
|
return await this.identifyMode(device, 0x0A)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
initSchema(){
|
|
27
26
|
super.initSchema()
|
|
28
27
|
this.addMetadatum('error','', 'error code',
|
|
29
28
|
(buff)=>{return buff.readUInt8(0)})
|
|
30
29
|
|
|
31
|
-
this.
|
|
32
|
-
(buff)=>{return this.NaNif(buff.readUInt16LE(1),0xFFFF)*60}
|
|
33
|
-
this.
|
|
34
|
-
(buff)=>{return this.NaNif(buff.readInt16LE(3),0x7FFF)/100}
|
|
35
|
-
this.
|
|
36
|
-
(buff)=>{return this.NaNif(buff.readInt16LE(5),0x7FFF)/10}
|
|
30
|
+
this.addDefaultPath('ttg','electrical.batteries.capacity.timeRemaining')
|
|
31
|
+
.read=(buff)=>{return this.NaNif(buff.readUInt16LE(1),0xFFFF)*60}
|
|
32
|
+
this.addDefaultPath('voltage','electrical.batteries.voltage')
|
|
33
|
+
.read=(buff)=>{return this.NaNif(buff.readInt16LE(3),0x7FFF)/100}
|
|
34
|
+
this.addDefaultPath('current','electrical.batteries.current')
|
|
35
|
+
.read=(buff)=>{return this.NaNif(buff.readInt16LE(5),0x7FFF)/10}
|
|
36
|
+
|
|
37
37
|
this.addMetadatum('ioStatus','','IO Status', //TODO
|
|
38
38
|
(buff)=>{return buff.readUInt16LE(7)})
|
|
39
|
+
|
|
39
40
|
this.addMetadatum('warningsAndAlarms','','warnings and alarms')
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
this.addDefaultPath('soc','electrical.batteries.capacity.stateOfCharge')
|
|
41
43
|
this.addMetadatum('consumedAh','Ah','amp-hours consumed')
|
|
42
|
-
|
|
44
|
+
.default="electrical.batteries.{batteryID}.capacity.ampHoursConsumed"
|
|
45
|
+
|
|
46
|
+
this.addDefaultPath('temp', 'electrical.batteries.temperature')
|
|
43
47
|
}
|
|
44
48
|
emitValuesFrom(buffer){
|
|
45
49
|
super.emitValuesFrom(buffer)
|
|
@@ -10,20 +10,32 @@ class VictronOrionXS extends VictronSensor{
|
|
|
10
10
|
}
|
|
11
11
|
initSchema() {
|
|
12
12
|
super.initSchema()
|
|
13
|
+
this.addDefaultParam("id")
|
|
13
14
|
this.addMetadatum('deviceState','', 'device state',
|
|
14
15
|
(buff)=>{return VC.OperationMode.get(buff.readUInt8(0))})
|
|
16
|
+
.default="electrical.chargers.{id}.state"
|
|
17
|
+
|
|
15
18
|
this.addMetadatum('chargerError','', 'charger error',
|
|
16
19
|
(buff)=>{return VC.ChargerError.get(buff.readUInt8(1))})
|
|
20
|
+
.default="electrical.chargers.{id}.error"
|
|
21
|
+
|
|
17
22
|
this.addMetadatum('outputVoltage','V', 'output voltage',
|
|
18
23
|
(buff)=>{return this.NaNif(buff.readInt16LE(2),0x7FF)/100})
|
|
24
|
+
.default="electrical.chargers.{id}.output.voltage"
|
|
25
|
+
|
|
26
|
+
|
|
19
27
|
this.addMetadatum('current','A','output current',
|
|
20
28
|
(buff)=>{return this.NaNif(buff.readUInt16LE(4),0xFFFF)/10})
|
|
29
|
+
.default="electrical.chargers.{id}.output.current"
|
|
21
30
|
this.addMetadatum('inputVoltage','V', 'input voltage',
|
|
22
31
|
(buff)=>{return this.NaNif(buff.readInt16LE(6),0x07FF)/100})
|
|
32
|
+
.default="electrical.chargers.{id}.input.voltage"
|
|
23
33
|
this.addMetadatum('inputCurrent','A','input current',
|
|
24
34
|
(buff)=>{return this.NaNif(buff.readUInt16LE(8),0xFFFF)/10})
|
|
35
|
+
.default="electrical.chargers.{id}.input.current"
|
|
25
36
|
this.addMetadatum('deviceOffReason','', 'device off reason',
|
|
26
|
-
(buff)=>{return VC.OffReasons(buff.readUInt32BE(10))})
|
|
37
|
+
(buff)=>{return VC.OffReasons(buff.readUInt32BE(10))})
|
|
38
|
+
.default="electrical.chargers.{id}.offReason"
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
}
|