homebridge-melcloud-control 4.0.1 → 4.0.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/CHANGELOG.md CHANGED
@@ -21,6 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
21
 
22
22
  - Do not use Homebridge UI > v5.5.0 because of break config.json
23
23
 
24
+ ## [4.0.2] - (06.11.2025)
25
+
26
+ ## Changes
27
+
28
+ - fix RESTFul extrnal integration for MELCloud Home devices
29
+ - readme updated
30
+ - cleanup
31
+
24
32
  ## [4.0.1] - (06.11.2025)
25
33
 
26
34
  ## Changes
package/README.md CHANGED
@@ -222,6 +222,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
222
222
  | `ataDevices[].autoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
223
223
  | `ataDevices[].temperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
224
224
  | `ataDevices[].temperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
225
+ | `ataDevices[].errorSensor` | This enable `Error` sensors to use with automations in HomeKit app. |
225
226
  | `ataDevices[].refreshInterval` | Here set the background devices state refresh time in (sec), default `5s`. |
226
227
  | `ataDevices[].presets[]` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
227
228
  | `ataDevices[].presets[].id` | Read only data, do not change it. |
@@ -248,6 +249,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
248
249
  | `atwDevices[].temperatureSensorReturnWaterTank` | This enable extra `Return Water Tank` temperature sensors to use with automations in HomeKit app. |
249
250
  | `atwDevices[].temperatureSensorFlowZone2` | This enable extra `Flow Zone 2` temperature sensors to use with automations in HomeKit app. |
250
251
  | `atwDevices[].temperatureSensorReturnZone2` | This enable extra `Return Zone 2` temperature sensors to use with automations in HomeKit app. |
252
+ | `atwDevices[].errorSensor` | This enable `Error` sensors to use with automations in HomeKit app. |
251
253
  | `atwDevices[].refreshInterval` | Here set the background devices state refresh time in (sec), default `5s`. |
252
254
  | `atwDevices[].presets[]` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
253
255
  | `atwDevices[].presets[].id` | Read only data, do not change it. |
@@ -267,6 +269,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
267
269
  | `ervDevices[].temperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
268
270
  | `ervDevices[].temperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
269
271
  | `ervDevices[].temperatureSensorSupply` | This enable extra `Supply` temperature sensors to use with automations in HomeKit app. |
272
+ | `ervDevices[].errorSensor` | This enable `Error` sensors to use with automations in HomeKit app. |
270
273
  | `ervDevices[].refreshInterval` | Here set the background devices state refresh time in (sec), default `5s`. |
271
274
  | `ervDevices[].presets[]` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
272
275
  | `ervDevices[].presets[].id` | Read only data, do not change it. |
@@ -300,7 +303,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
300
303
 
301
304
  ### RESTful Integration
302
305
 
303
- * Port: last 4 numbers of `device Id`, displayed in HB log during start.
306
+ * Port:
307
+ * MELCLoud, last 4 numbers of `device Id`, also displayed in HB log during start.
308
+ * MELCLoud Home, start at `30000` displayed in HB log during start.
304
309
  * POST data as a JSON Object `{OperationMode: 8}`.
305
310
  * Header content type must be `application/json`.
306
311
  * Path `status` response all available paths.
package/index.js CHANGED
@@ -127,7 +127,7 @@ class MelCloudPlatform {
127
127
  const devices = [...ataDevices, ...atwDevices, ...ervDevices];
128
128
  if (logLevel.debug) log.info(`Found configured devices ATA: ${ataDevices.length}, ATW: ${atwDevices.length}, ERV: ${ervDevices.length}.`);
129
129
 
130
- for (const device of devices) {
130
+ for (const [index, device] of devices.entries()) {
131
131
  //chack device from config exist on melcloud
132
132
  const displayType = device.displayType > 0;
133
133
  const deviceExistInMelCloud = devicesList.Devices.some(dev => dev.DeviceID === device.id);
@@ -140,7 +140,12 @@ class MelCloudPlatform {
140
140
  const deviceRefreshInterval = (device.refreshInterval ?? 5) * 1000;
141
141
  const defaultTempsFile = `${prefDir}/${accountName}_${device.id}_Temps`;
142
142
 
143
+ // set rest ful port
144
+ account.restFul.port = (device.id).slice(-4).replace(/^0/, '9');
145
+
143
146
  if (accountType === 'melcloudhome') {
147
+ account.restFul.port = `${3000}${index}`;
148
+
144
149
  try {
145
150
  const temps = {
146
151
  defaultCoolingSetTemperature: 24,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.1",
4
+ "version": "4.0.2",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceata.js CHANGED
@@ -81,7 +81,7 @@ class DeviceAta extends EventEmitter {
81
81
  if (restFulEnabled) {
82
82
  if (!this.restFulConnected) {
83
83
  this.restFul1 = new RestFul({
84
- port: this.deviceId.toString().slice(-4).replace(/^0/, '9'),
84
+ port: this.restFul.port,
85
85
  logWarn: this.logWarn,
86
86
  logDebug: this.logDebug
87
87
  })
package/src/deviceatw.js CHANGED
@@ -86,7 +86,7 @@ class DeviceAtw extends EventEmitter {
86
86
  if (restFulEnabled) {
87
87
  if (!this.restFulConnected) {
88
88
  this.restFul1 = new RestFul({
89
- port: this.deviceId.toString().slice(-4).replace(/^0/, '9'),
89
+ port: this.restFul.port,
90
90
  logWarn: this.logWarn,
91
91
  logDebug: this.logDebug
92
92
  })
package/src/deviceerv.js CHANGED
@@ -79,7 +79,7 @@ class DeviceErv extends EventEmitter {
79
79
  if (restFulEnabled) {
80
80
  if (!this.restFulConnected) {
81
81
  this.restFul1 = new RestFul({
82
- port: this.deviceId.toString().slice(-4).replace(/^0/, '9'),
82
+ port: this.restFul.port,
83
83
  logWarn: this.logWarn,
84
84
  logDebug: this.logDebug
85
85
  })