hoffmation-base 2.20.0 → 2.20.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.
@@ -142,7 +142,7 @@ class CameraDevice {
142
142
  }
143
143
  update(idSplit, state) {
144
144
  const stateName = idSplit[4];
145
- this.log(models_1.LogLevel.Debug, `Update for "${stateName}"`);
145
+ this.log(models_1.LogLevel.Debug, `Update for "${stateName}" to value: ${state.val}`);
146
146
  switch (stateName) {
147
147
  case 'MotionDetected':
148
148
  this._movementDetectedStateId = idSplit.join('.');
@@ -39,10 +39,10 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
39
39
  temp: {
40
40
  ref: 20, // Point temperature
41
41
  },
42
- Pmax: 100,
42
+ Pmax: 100, // Max power (output),
43
43
  // Tune the PID Controller
44
- Kp: 25,
45
- Ki: 1000,
44
+ Kp: 25, // PID: Kp in 1/1000
45
+ Ki: 1000, // PID: Ki in 1/1000
46
46
  Kd: 9, // PID: Kd in 1/1000
47
47
  });
48
48
  this._lastBatteryPersist = 0;
@@ -31,10 +31,10 @@ class ZigbeeHeater extends zigbeeDevice_1.ZigbeeDevice {
31
31
  temp: {
32
32
  ref: 20, // Point temperature
33
33
  },
34
- Pmax: 100,
34
+ Pmax: 100, // Max power (output),
35
35
  // Tune the PID Controller
36
- Kp: 25,
37
- Ki: 1000,
36
+ Kp: 25, // PID: Kp in 1/1000
37
+ Ki: 1000, // PID: Ki in 1/1000
38
38
  Kd: 9, // PID: Kd in 1/1000
39
39
  });
40
40
  this._seasonTurnOff = false;
@@ -11,8 +11,8 @@ class ioBrokerMain {
11
11
  this.connectionCallbacks = new models_1.ConnectionCallbacks();
12
12
  this.initConnCallbacks();
13
13
  this.servConn = new connection_1.IOBrokerConnection({
14
- name: '',
15
- connLink: services_1.SettingsService.settings.ioBrokerUrl,
14
+ name: '', // optional - default 'vis.0'
15
+ connLink: services_1.SettingsService.settings.ioBrokerUrl, // optional URL of the socket.io adapter
16
16
  socketSession: '', // optional - used by authentication
17
17
  }, this.connectionCallbacks);
18
18
  ioBrokerMain.iOConnection = this.servConn;
@@ -79,7 +79,7 @@ class OwnGoveeDevice {
79
79
  var _a, _b;
80
80
  log_service_1.ServerLogService.writeLog(level, `${this.name}: ${message}`, {
81
81
  debugType: debugType,
82
- room: (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.roomName) !== null && _b !== void 0 ? _b : '',
82
+ room: (_b = (_a = this._room) === null || _a === void 0 ? void 0 : _a.roomName) !== null && _b !== void 0 ? _b : '',
83
83
  deviceId: this.name,
84
84
  deviceName: this.name,
85
85
  });
@@ -26,7 +26,7 @@ class TibberService {
26
26
  active: true,
27
27
  // Endpoint configuration.
28
28
  apiEndpoint: {
29
- apiKey: newSettings.apiKey,
29
+ apiKey: newSettings.apiKey, // Demo token
30
30
  queryUrl: 'wss://api.tibber.com/v1-beta/gql/subscriptions',
31
31
  },
32
32
  // Query configuration.
@@ -151,11 +151,23 @@ class VictronDevice {
151
151
  // Step 4: Combine to get currently excess energy
152
152
  this._excessEnergy = solarOutput - neededBatteryWattage - baseConsumption;
153
153
  }
154
+ let isSocTooLow = false;
155
+ if (this.data.battery.dcPower !== null && this.data.battery.soc !== null) {
156
+ if (timeOfDay === models_1.TimeOfDay.Night) {
157
+ isSocTooLow = this.data.battery.soc < 0.5;
158
+ }
159
+ else if (timeOfDay === models_1.TimeOfDay.AfterSunset) {
160
+ isSocTooLow = this.data.battery.soc < 0.75;
161
+ }
162
+ else if (hoursTilSunset > 4) {
163
+ isSocTooLow = this.data.battery.soc < 0.7;
164
+ }
165
+ else {
166
+ isSocTooLow = this.data.battery.soc < 0.8;
167
+ }
168
+ }
154
169
  // Whilst calculated spare energy is more precise, we don't mind using the battery as a buffer, if it is full enough.
155
- if (this.data.battery.dcPower !== null &&
156
- this.data.battery.soc !== null &&
157
- this.data.battery.soc >
158
- (hoursTilSunset > 4 && timeOfDay !== models_1.TimeOfDay.AfterSunset && timeOfDay !== models_1.TimeOfDay.Night ? 0.7 : 0.8)) {
170
+ if (this.data.battery.dcPower !== null && this.data.battery.soc !== null && !isSocTooLow) {
159
171
  this._excessEnergy = this.settings.maximumBatteryDischargeWattage - Math.max(this.data.battery.dcPower, 0);
160
172
  }
161
173
  this.calculatePersistenceValues();