homebridge-melcloud-control 4.1.2-beta.33 → 4.1.2-beta.35
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/config.schema.json +96 -93
- package/package.json +2 -2
- package/src/functions.js +26 -3
- package/src/melcloud.js +13 -1
package/config.schema.json
CHANGED
|
@@ -2228,46 +2228,41 @@
|
|
|
2228
2228
|
"expanded": false,
|
|
2229
2229
|
"items": [
|
|
2230
2230
|
{
|
|
2231
|
-
"
|
|
2232
|
-
"type": "
|
|
2233
|
-
"
|
|
2234
|
-
"expandable": true,
|
|
2235
|
-
"expanded": false,
|
|
2236
|
-
"items": [
|
|
2237
|
-
"accounts[].ataDevices[].temperatureSensor",
|
|
2238
|
-
"accounts[].ataDevices[].temperatureOutdoorSensor"
|
|
2239
|
-
]
|
|
2240
|
-
},
|
|
2241
|
-
{
|
|
2242
|
-
"title": "System",
|
|
2243
|
-
"type": "section",
|
|
2244
|
-
"description": "Section for setup system sensors",
|
|
2245
|
-
"expandable": true,
|
|
2246
|
-
"expanded": false,
|
|
2247
|
-
"items": [
|
|
2248
|
-
"accounts[].ataDevices[].frostProtectionSensor",
|
|
2249
|
-
"accounts[].ataDevices[].overheatProtectionSensor",
|
|
2250
|
-
"accounts[].ataDevices[].holidayModeSensor",
|
|
2251
|
-
"accounts[].ataDevices[].scheduleSensor",
|
|
2252
|
-
"accounts[].ataDevices[].errorSensor"
|
|
2253
|
-
]
|
|
2254
|
-
},
|
|
2255
|
-
{
|
|
2256
|
-
"title": "Custom",
|
|
2257
|
-
"type": "section",
|
|
2258
|
-
"description": "Section for creating custom buttons/sensors",
|
|
2259
|
-
"expandable": true,
|
|
2260
|
-
"expanded": false,
|
|
2231
|
+
"key": "accounts[].ataDevices[]",
|
|
2232
|
+
"type": "tabarray",
|
|
2233
|
+
"title": "{{ value.name }}",
|
|
2261
2234
|
"items": [
|
|
2262
2235
|
{
|
|
2263
|
-
"
|
|
2264
|
-
"
|
|
2265
|
-
|
|
2236
|
+
"title": "Temperature",
|
|
2237
|
+
"items": [
|
|
2238
|
+
"accounts[].ataDevices[].temperatureSensor",
|
|
2239
|
+
"accounts[].ataDevices[].temperatureOutdoorSensor"
|
|
2240
|
+
]
|
|
2241
|
+
},
|
|
2242
|
+
{
|
|
2243
|
+
"title": "System",
|
|
2266
2244
|
"items": [
|
|
2267
|
-
"accounts[].ataDevices[].
|
|
2268
|
-
"accounts[].ataDevices[].
|
|
2269
|
-
"accounts[].ataDevices[].
|
|
2270
|
-
"accounts[].ataDevices[].
|
|
2245
|
+
"accounts[].ataDevices[].frostProtectionSensor",
|
|
2246
|
+
"accounts[].ataDevices[].overheatProtectionSensor",
|
|
2247
|
+
"accounts[].ataDevices[].holidayModeSensor",
|
|
2248
|
+
"accounts[].ataDevices[].scheduleSensor",
|
|
2249
|
+
"accounts[].ataDevices[].errorSensor"
|
|
2250
|
+
]
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
"title": "Custom",
|
|
2254
|
+
"items": [
|
|
2255
|
+
{
|
|
2256
|
+
"key": "accounts[].ataDevices[].buttonsSensors",
|
|
2257
|
+
"type": "tabarray",
|
|
2258
|
+
"title": "{{ value.name || 'button/sensor' }}",
|
|
2259
|
+
"items": [
|
|
2260
|
+
"accounts[].ataDevices[].buttonsSensors[].displayType",
|
|
2261
|
+
"accounts[].ataDevices[].buttonsSensors[].mode",
|
|
2262
|
+
"accounts[].ataDevices[].buttonsSensors[].name",
|
|
2263
|
+
"accounts[].ataDevices[].buttonsSensors[].namePrefix"
|
|
2264
|
+
]
|
|
2265
|
+
}
|
|
2271
2266
|
]
|
|
2272
2267
|
}
|
|
2273
2268
|
]
|
|
@@ -2379,41 +2374,45 @@
|
|
|
2379
2374
|
"expandable": true,
|
|
2380
2375
|
"expanded": false,
|
|
2381
2376
|
"items": [
|
|
2382
|
-
"accounts[].atwDevices[].errorSensor",
|
|
2383
2377
|
{
|
|
2384
|
-
"
|
|
2385
|
-
"type": "
|
|
2386
|
-
"
|
|
2387
|
-
"expandable": true,
|
|
2388
|
-
"expanded": false,
|
|
2389
|
-
"items": [
|
|
2390
|
-
"accounts[].atwDevices[].temperatureSensor",
|
|
2391
|
-
"accounts[].atwDevices[].temperatureFlowSensor",
|
|
2392
|
-
"accounts[].atwDevices[].temperatureReturnSensor",
|
|
2393
|
-
"accounts[].atwDevices[].temperatureFlowZone1Sensor",
|
|
2394
|
-
"accounts[].atwDevices[].temperatureReturnZone1Sensor",
|
|
2395
|
-
"accounts[].atwDevices[].temperatureFlowWaterTankSensor",
|
|
2396
|
-
"accounts[].atwDevices[].temperatureReturnWaterTankSensor",
|
|
2397
|
-
"accounts[].atwDevices[].temperatureFlowZone2Sensor",
|
|
2398
|
-
"accounts[].atwDevices[].temperatureReturnZone2Sensor"
|
|
2399
|
-
]
|
|
2400
|
-
},
|
|
2401
|
-
{
|
|
2402
|
-
"title": "Custom",
|
|
2403
|
-
"type": "section",
|
|
2404
|
-
"description": "Section for creating custom buttons/sensors",
|
|
2405
|
-
"expandable": true,
|
|
2406
|
-
"expanded": false,
|
|
2378
|
+
"key": "accounts[].atwDevices[]",
|
|
2379
|
+
"type": "tabarray",
|
|
2380
|
+
"title": "{{ value.name }}",
|
|
2407
2381
|
"items": [
|
|
2408
2382
|
{
|
|
2409
|
-
"
|
|
2410
|
-
"type": "tabarray",
|
|
2411
|
-
"title": "{{ value.name || 'button/sensor' }}",
|
|
2383
|
+
"title": "Temperature",
|
|
2412
2384
|
"items": [
|
|
2413
|
-
"accounts[].atwDevices[].
|
|
2414
|
-
"accounts[].atwDevices[].
|
|
2415
|
-
"accounts[].atwDevices[].
|
|
2416
|
-
"accounts[].atwDevices[].
|
|
2385
|
+
"accounts[].atwDevices[].temperatureSensor",
|
|
2386
|
+
"accounts[].atwDevices[].temperatureFlowSensor",
|
|
2387
|
+
"accounts[].atwDevices[].temperatureReturnSensor",
|
|
2388
|
+
"accounts[].atwDevices[].temperatureFlowZone1Sensor",
|
|
2389
|
+
"accounts[].atwDevices[].temperatureReturnZone1Sensor",
|
|
2390
|
+
"accounts[].atwDevices[].temperatureFlowWaterTankSensor",
|
|
2391
|
+
"accounts[].atwDevices[].temperatureReturnWaterTankSensor",
|
|
2392
|
+
"accounts[].atwDevices[].temperatureFlowZone2Sensor",
|
|
2393
|
+
"accounts[].atwDevices[].temperatureReturnZone2Sensor"
|
|
2394
|
+
]
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
"title": "System",
|
|
2398
|
+
"items": [
|
|
2399
|
+
"accounts[].atwDevices[].errorSensor"
|
|
2400
|
+
]
|
|
2401
|
+
},
|
|
2402
|
+
{
|
|
2403
|
+
"title": "Custom",
|
|
2404
|
+
"items": [
|
|
2405
|
+
{
|
|
2406
|
+
"key": "accounts[].atwDevices[].buttonsSensors",
|
|
2407
|
+
"type": "tabarray",
|
|
2408
|
+
"title": "{{ value.name || 'button/sensor' }}",
|
|
2409
|
+
"items": [
|
|
2410
|
+
"accounts[].atwDevices[].buttonsSensors[].displayType",
|
|
2411
|
+
"accounts[].atwDevices[].buttonsSensors[].mode",
|
|
2412
|
+
"accounts[].atwDevices[].buttonsSensors[].name",
|
|
2413
|
+
"accounts[].atwDevices[].buttonsSensors[].namePrefix"
|
|
2414
|
+
]
|
|
2415
|
+
}
|
|
2417
2416
|
]
|
|
2418
2417
|
}
|
|
2419
2418
|
]
|
|
@@ -2524,35 +2523,39 @@
|
|
|
2524
2523
|
"expandable": true,
|
|
2525
2524
|
"expanded": false,
|
|
2526
2525
|
"items": [
|
|
2527
|
-
"accounts[].ervDevices[].errorSensor",
|
|
2528
|
-
{
|
|
2529
|
-
"title": "Temperature",
|
|
2530
|
-
"type": "section",
|
|
2531
|
-
"description": "Section for setup temperature sensors",
|
|
2532
|
-
"expandable": true,
|
|
2533
|
-
"expanded": false,
|
|
2534
|
-
"items": [
|
|
2535
|
-
"accounts[].ervDevices[].temperatureSensor",
|
|
2536
|
-
"accounts[].ervDevices[].temperatureOutdoorSensor",
|
|
2537
|
-
"accounts[].ervDevices[].temperatureSensorSupply"
|
|
2538
|
-
]
|
|
2539
|
-
},
|
|
2540
2526
|
{
|
|
2541
|
-
"
|
|
2542
|
-
"type": "
|
|
2543
|
-
"
|
|
2544
|
-
"expandable": true,
|
|
2545
|
-
"expanded": false,
|
|
2527
|
+
"key": "accounts[].atwDevices[]",
|
|
2528
|
+
"type": "tabarray",
|
|
2529
|
+
"title": "{{ value.name }}",
|
|
2546
2530
|
"items": [
|
|
2547
2531
|
{
|
|
2548
|
-
"
|
|
2549
|
-
"
|
|
2550
|
-
|
|
2532
|
+
"title": "Temperature",
|
|
2533
|
+
"items": [
|
|
2534
|
+
"accounts[].ervDevices[].temperatureSensor",
|
|
2535
|
+
"accounts[].ervDevices[].temperatureOutdoorSensor",
|
|
2536
|
+
"accounts[].ervDevices[].temperatureSensorSupply"
|
|
2537
|
+
]
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
"title": "System",
|
|
2541
|
+
"items": [
|
|
2542
|
+
"accounts[].ervDevices[].errorSensor"
|
|
2543
|
+
]
|
|
2544
|
+
},
|
|
2545
|
+
{
|
|
2546
|
+
"title": "Custom",
|
|
2551
2547
|
"items": [
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2548
|
+
{
|
|
2549
|
+
"key": "accounts[].ervDevices[].buttonsSensors",
|
|
2550
|
+
"type": "tabarray",
|
|
2551
|
+
"title": "{{ value.name || 'button/sensor' }}",
|
|
2552
|
+
"items": [
|
|
2553
|
+
"accounts[].ervDevices[].buttonsSensors[].displayType",
|
|
2554
|
+
"accounts[].ervDevices[].buttonsSensors[].mode",
|
|
2555
|
+
"accounts[].ervDevices[].buttonsSensors[].name",
|
|
2556
|
+
"accounts[].ervDevices[].buttonsSensors[].namePrefix"
|
|
2557
|
+
]
|
|
2558
|
+
}
|
|
2556
2559
|
]
|
|
2557
2560
|
}
|
|
2558
2561
|
]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.1.2-beta.
|
|
4
|
+
"version": "4.1.2-beta.35",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"async-mqtt": "^2.6.3",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
41
|
"express": "^5.1.0",
|
|
42
|
-
"puppeteer
|
|
42
|
+
"puppeteer": "^24.29.1"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"homebridge",
|
package/src/functions.js
CHANGED
|
@@ -113,7 +113,7 @@ class Functions extends EventEmitter {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
// === Linux (x64, Docker, etc.) ===
|
|
116
|
+
// === Linux (x64, Docker, QNAP etc.) ===
|
|
117
117
|
if (osName === 'Linux') {
|
|
118
118
|
try {
|
|
119
119
|
// --- Try detect common Chromium binaries ---
|
|
@@ -127,6 +127,29 @@ class Functions extends EventEmitter {
|
|
|
127
127
|
|
|
128
128
|
if (this.logWarn) this.emit('warn', 'Chromium not found. Attempting installation...');
|
|
129
129
|
|
|
130
|
+
// --- Detect Entware (QNAP) ---
|
|
131
|
+
let entwareExists = false;
|
|
132
|
+
try {
|
|
133
|
+
await access('/opt/bin/opkg', fs.constants.X_OK);
|
|
134
|
+
entwareExists = true;
|
|
135
|
+
} catch { }
|
|
136
|
+
|
|
137
|
+
if (entwareExists) {
|
|
138
|
+
try {
|
|
139
|
+
if (this.logDebug) this.emit('debug', 'Detected Entware. Attempting installation via opkg...');
|
|
140
|
+
await execPromise('/opt/bin/opkg update');
|
|
141
|
+
await execPromise('/opt/bin/opkg install chromium');
|
|
142
|
+
const { stdout: checkOut } = await execPromise('which chromium || which chromium-browser || true');
|
|
143
|
+
chromiumPath = checkOut.trim() || '/opt/bin/chromium';
|
|
144
|
+
if (chromiumPath) {
|
|
145
|
+
if (this.logDebug) this.emit('debug', `Chromium installed successfully via Entware at ${chromiumPath}`);
|
|
146
|
+
return chromiumPath;
|
|
147
|
+
}
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (this.logDebug) this.emit('debug', `Entware installation failed: ${error.message}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
130
153
|
// --- Try install (Docker-optimized first) ---
|
|
131
154
|
const installCommands = [
|
|
132
155
|
'apt-get update -y && apt-get install -y chromium chromium-browser chromium-codecs-ffmpeg',
|
|
@@ -138,7 +161,6 @@ class Functions extends EventEmitter {
|
|
|
138
161
|
try {
|
|
139
162
|
if (this.logDebug) this.emit('debug', `Trying installation: ${cmd}`);
|
|
140
163
|
await execPromise(`sudo ${cmd}`);
|
|
141
|
-
// Check for binary after install
|
|
142
164
|
const { stdout: checkOut } = await execPromise('which chromium || which chromium-browser || true');
|
|
143
165
|
chromiumPath = checkOut.trim() || '/usr/bin/chromium';
|
|
144
166
|
if (chromiumPath) {
|
|
@@ -151,7 +173,6 @@ class Functions extends EventEmitter {
|
|
|
151
173
|
}
|
|
152
174
|
|
|
153
175
|
if (isDocker) {
|
|
154
|
-
// Docker fallback specific
|
|
155
176
|
try {
|
|
156
177
|
await execPromise('sudo apt-get update -y && sudo apt-get install -y chromium');
|
|
157
178
|
await access('/usr/bin/chromium', fs.constants.X_OK);
|
|
@@ -172,5 +193,7 @@ class Functions extends EventEmitter {
|
|
|
172
193
|
return null;
|
|
173
194
|
}
|
|
174
195
|
}
|
|
196
|
+
|
|
197
|
+
|
|
175
198
|
}
|
|
176
199
|
export default Functions
|
package/src/melcloud.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import { exec } from 'child_process';
|
|
3
4
|
import { promisify } from 'util';
|
|
4
5
|
import EventEmitter from 'events';
|
|
5
|
-
import puppeteer from 'puppeteer
|
|
6
|
+
import puppeteer from 'puppeteer';
|
|
6
7
|
import ImpulseGenerator from './impulsegenerator.js';
|
|
7
8
|
import Functions from './functions.js';
|
|
8
9
|
import { ApiUrls, ApiUrlsHome } from './constants.js';
|
|
@@ -337,6 +338,17 @@ class MelCloud extends EventEmitter {
|
|
|
337
338
|
try {
|
|
338
339
|
const accountInfo = { State: false, Info: '', ContextKey: null, UseFahrenheit: false };
|
|
339
340
|
const chromiumPath = await this.functions.ensureChromiumInstalled();
|
|
341
|
+
|
|
342
|
+
// === Fallback to Puppeteer's built-in Chromium ===
|
|
343
|
+
if (!chromiumPath) {
|
|
344
|
+
try {
|
|
345
|
+
const puppeteerPath = puppeteer.executablePath();
|
|
346
|
+
if (puppeteerPath && fs.existsSync(puppeteerPath)) {
|
|
347
|
+
chromiumPath = puppeteerPath;
|
|
348
|
+
if (this.logDebug) this.emit('debug', `Using bundled Chromium from Puppeteer at ${chromiumPath}`);
|
|
349
|
+
}
|
|
350
|
+
} catch { }
|
|
351
|
+
}
|
|
340
352
|
if (!chromiumPath) {
|
|
341
353
|
accountInfo.Info = 'Chromium not found on Your device, please install it manually and try again';
|
|
342
354
|
return accountInfo;
|