signalk-rec-bms 1.1.0 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-rec-bms",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "SignalK plugin for REC-BMS",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@ module.exports = {
20
20
  websocketURL: {
21
21
  title: "WebSocket URL",
22
22
  type: "string",
23
- default: "ws://192.168.88.10/ws"
23
+ default: "ws://WiFi_module_ip/ws"
24
24
  }
25
25
  }
26
26
  },
package/public/index.html CHANGED
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  <div class="metric-box">
38
38
  <div class="metric-label">State of Charge</div>
39
- <div class="metric-value" id="soc">-- %</div>
39
+ <div class="metric-value" id="stateOfCharge">-- %</div>
40
40
  </div>
41
41
  <div class="metric-box">
42
42
  <div class="metric-label">Pack Voltage</div>
package/public/js/main.js CHANGED
@@ -14,7 +14,7 @@ class BMSSystem {
14
14
  voltage: null,
15
15
  current: null,
16
16
  power: null,
17
- soc: null,
17
+ stateOfCharge: null,
18
18
  cellVoltages: {},
19
19
  cellResistances: {},
20
20
  cellVoltageDifference: null,
@@ -38,7 +38,7 @@ class BMSSystem {
38
38
 
39
39
  cacheDomElements() {
40
40
  const metrics = [
41
- 'voltage', 'current', 'power', 'soc', 'cellVoltageDifference',
41
+ 'voltage', 'current', 'power', 'stateOfCharge', 'cellVoltageDifference',
42
42
  'bmsTemperature', 'cellTemperature1', 'maxCellVoltage', 'minCellVoltage',
43
43
  'ampHourRemaining', 'ampHourUsed', 'capacity'
44
44
  ];
@@ -90,8 +90,11 @@ class BMSSystem {
90
90
  setValue(this.dom.metricElements.voltage, this.liveData.voltage, "V");
91
91
  setValue(this.dom.metricElements.current, this.liveData.current, "A");
92
92
  setValue(this.dom.metricElements.power, this.liveData.power, "W");
93
- setValue(this.dom.metricElements.soc, this.liveData.soc, "%");
94
- setValue(this.dom.metricElements.cellVoltageDifference, this.liveData.cellVoltageDifference, "V");
93
+ setValue(this.dom.metricElements.stateOfCharge, this.liveData.stateOfCharge, "%");
94
+ if (this.dom.metricElements.cellVoltageDifference) {
95
+ const v = this.liveData.cellVoltageDifference;
96
+ this.dom.metricElements.cellVoltageDifference.textContent = v !== null ? `${v.toFixed(4)}V` : "--";
97
+ }
95
98
  setValue(this.dom.metricElements.bmsTemperature, this.liveData.bmsTemperature, "°C");
96
99
  setValue(this.dom.metricElements.cellTemperature1, this.liveData.cellTemperature1, "°C");
97
100
  setValue(this.dom.metricElements.maxCellVoltage, this.liveData.maxCellVoltage, "V");