iobroker.mg-saic 0.1.0 → 0.1.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/README.md +17 -12
- package/admin/i18n/de.json +0 -1
- package/admin/i18n/en.json +0 -1
- package/admin/i18n/es.json +0 -1
- package/admin/i18n/fr.json +0 -1
- package/admin/i18n/it.json +0 -1
- package/admin/i18n/nl.json +0 -1
- package/admin/i18n/pl.json +0 -1
- package/admin/i18n/pt.json +0 -1
- package/admin/i18n/ru.json +0 -1
- package/admin/i18n/uk.json +0 -1
- package/admin/i18n/zh-cn.json +0 -1
- package/admin/jsonConfig.json +2 -1
- package/build/config.js +5 -2
- package/build/config.js.map +2 -2
- package/build/main.js +158 -56
- package/build/main.js.map +2 -2
- package/build/pending-setting-edits.js +24 -0
- package/build/pending-setting-edits.js.map +2 -2
- package/build/refresh-poll-queue.js +68 -0
- package/build/refresh-poll-queue.js.map +7 -0
- package/build/refresh-poll-timer.js +65 -0
- package/build/refresh-poll-timer.js.map +7 -0
- package/build/runtime-translations.js +777 -64
- package/build/runtime-translations.js.map +2 -2
- package/build/saic-client.js +128 -44
- package/build/saic-client.js.map +3 -3
- package/build/status-metadata.js +118 -27
- package/build/status-metadata.js.map +2 -2
- package/io-package.json +29 -3
- package/package.json +6 -6
- /package/{MG.png → admin/MG.png} +0 -0
package/README.md
CHANGED
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/iobroker.mg-saic)
|
|
4
4
|
[](https://www.npmjs.com/package/iobroker.mg-saic)
|
|
5
5
|
|
|
6
|
-
<img src="MG.png" alt="MG" width="314">
|
|
6
|
+
<img src="admin/MG.png" alt="MG" width="314">
|
|
7
7
|
|
|
8
8
|
The adapter is intended for connecting MG and SAIC vehicles to ioBroker through the iSmart cloud service. It is not affiliated with or endorsed by MG, SAIC, or iSmart.
|
|
9
9
|
|
|
10
|
+
For manufacturer information, see [MG Motor](https://www.mgmotor.eu/) and [SAIC Motor](https://www.saicmotor.com/).
|
|
11
|
+
|
|
10
12
|
## Setup
|
|
11
13
|
|
|
12
14
|
### Before you start
|
|
13
15
|
|
|
14
|
-
- Node.js
|
|
16
|
+
- Node.js 22.22.2 or later is required.
|
|
15
17
|
- ioBroker js-controller 7.2.2 or later is required.
|
|
16
18
|
- ioBroker Admin 8.2.0 or later is required.
|
|
17
19
|
- Use an iSmart account that has access to the vehicle. A separate account shared with the vehicle is recommended to avoid interfering with the mobile app session.
|
|
@@ -23,7 +25,7 @@ The adapter is intended for connecting MG and SAIC vehicles to ioBroker through
|
|
|
23
25
|
1. Install the adapter and create an instance in ioBroker Admin.
|
|
24
26
|
2. Select the account region and login type (email or phone number).
|
|
25
27
|
3. Enter the account's email address or phone number and password. For phone login, also enter the phone country calling code.
|
|
26
|
-
4. Set the status polling interval
|
|
28
|
+
4. Set the status polling interval >60 seconds. The default is 1800 seconds.
|
|
27
29
|
5. Save the settings and start the instance. Vehicles available to the account appear under `vehicles.<VIN>`.
|
|
28
30
|
|
|
29
31
|
## Features
|
|
@@ -34,13 +36,24 @@ The adapter is intended for connecting MG and SAIC vehicles to ioBroker through
|
|
|
34
36
|
|
|
35
37
|
## Installation
|
|
36
38
|
|
|
37
|
-
The adapter is published on npm
|
|
39
|
+
The adapter is published on npm and available from ioBroker's Latest adapter repository.
|
|
38
40
|
|
|
39
41
|
## Support
|
|
40
42
|
|
|
41
43
|
[](https://www.paypal.com/donate/?hosted_button_id=3RJQGSJNRSHUJ)
|
|
42
44
|
|
|
43
45
|
## Changelog
|
|
46
|
+
### 0.1.2 (2026-11-08)
|
|
47
|
+
|
|
48
|
+
- (Voodoo2man) Prevented unsafe or case-colliding API fields and vehicle IDs from creating duplicate datapoints, kept status IDs stable across field-casing changes, scheduled polling after each completed cycle while honoring queued manual refreshes, and removed an unused cloud-backend translation.
|
|
49
|
+
- (Voodoo2man) Replaced untrusted cloud error text with English code-based diagnostics and standardized the product title as MG/SAIC across locales.
|
|
50
|
+
- (Voodoo2man) Reused dynamic charging datapoints across field-name casing changes and normalized known status fields.
|
|
51
|
+
|
|
52
|
+
### 0.1.1 (2026-11-07)
|
|
53
|
+
|
|
54
|
+
- (Voodoo2man) Lowered the minimum Node.js requirement to 22.22.2.
|
|
55
|
+
- (Voodoo2man) Improved charging datapoint labels and units, enforced safe polling interval limits, and added manufacturer references.
|
|
56
|
+
|
|
44
57
|
### 0.1.0 (2026-11-01)
|
|
45
58
|
|
|
46
59
|
- (Voodoo2man) Reported real-time charging power in kW using the pack current and voltage.
|
|
@@ -62,14 +75,6 @@ The adapter is published on npm but has not yet been added to the ioBroker adapt
|
|
|
62
75
|
|
|
63
76
|
Older changelog entries are available in [CHANGELOG_OLD.md](CHANGELOG_OLD.md).
|
|
64
77
|
|
|
65
|
-
### 0.0.2 (2026-10-20)
|
|
66
|
-
|
|
67
|
-
- (Voodoo2man) Added regional iSmart account setup, vehicle status, and supported remote controls.
|
|
68
|
-
|
|
69
|
-
### 0.0.1 (2026-10-20)
|
|
70
|
-
|
|
71
|
-
- (Voodoo2man) Initial Version
|
|
72
|
-
|
|
73
78
|
## License
|
|
74
79
|
|
|
75
80
|
MIT License
|
package/admin/i18n/de.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Region",
|
|
8
8
|
"European Union": "Europäische Union",
|
|
9
9
|
"Rest of World": "Rest der Welt",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Die Cloud-Anbindung ist noch nicht implementiert. Dieser Wert wählt kein funktionsfähiges Backend aus.",
|
|
11
10
|
"Login type": "Anmeldetyp",
|
|
12
11
|
"Email": "E-Mail",
|
|
13
12
|
"Phone number": "Telefonnummer",
|
package/admin/i18n/en.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Region",
|
|
8
8
|
"European Union": "European Union",
|
|
9
9
|
"Rest of World": "Rest of World",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Cloud connectivity is not implemented yet. This value does not select a working backend.",
|
|
11
10
|
"Login type": "Login type",
|
|
12
11
|
"Email": "Email",
|
|
13
12
|
"Phone number": "Phone number",
|
package/admin/i18n/es.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Región",
|
|
8
8
|
"European Union": "Unión Europea",
|
|
9
9
|
"Rest of World": "Resto del mundo",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "La conexión a la nube aún no está implementada. Este valor no selecciona un servicio operativo.",
|
|
11
10
|
"Login type": "Tipo de inicio de sesión",
|
|
12
11
|
"Email": "Correo electrónico",
|
|
13
12
|
"Phone number": "Número de teléfono",
|
package/admin/i18n/fr.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Région",
|
|
8
8
|
"European Union": "Union européenne",
|
|
9
9
|
"Rest of World": "Reste du monde",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "La connexion au cloud n'est pas encore implémentée. Cette valeur ne sélectionne pas de service fonctionnel.",
|
|
11
10
|
"Login type": "Type de connexion",
|
|
12
11
|
"Email": "E-mail",
|
|
13
12
|
"Phone number": "Numéro de téléphone",
|
package/admin/i18n/it.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Regione",
|
|
8
8
|
"European Union": "Unione europea",
|
|
9
9
|
"Rest of World": "Resto del mondo",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "La connessione cloud non è ancora implementata. Questo valore non seleziona un servizio funzionante.",
|
|
11
10
|
"Login type": "Tipo di accesso",
|
|
12
11
|
"Email": "E-mail",
|
|
13
12
|
"Phone number": "Numero di telefono",
|
package/admin/i18n/nl.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Regio",
|
|
8
8
|
"European Union": "Europese Unie",
|
|
9
9
|
"Rest of World": "Rest van de wereld",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Cloudverbinding is nog niet geïmplementeerd. Deze waarde selecteert geen werkende backend.",
|
|
11
10
|
"Login type": "Aanmeldtype",
|
|
12
11
|
"Email": "E-mailadres",
|
|
13
12
|
"Phone number": "Telefoonnummer",
|
package/admin/i18n/pl.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Region",
|
|
8
8
|
"European Union": "Unia Europejska",
|
|
9
9
|
"Rest of World": "Reszta świata",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Połączenie z chmurą nie jest jeszcze zaimplementowane. Ta wartość nie wybiera działającej usługi.",
|
|
11
10
|
"Login type": "Typ logowania",
|
|
12
11
|
"Email": "E-mail",
|
|
13
12
|
"Phone number": "Numer telefonu",
|
package/admin/i18n/pt.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Região",
|
|
8
8
|
"European Union": "União Europeia",
|
|
9
9
|
"Rest of World": "Resto do mundo",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "A ligação à nuvem ainda não está implementada. Este valor não seleciona um serviço funcional.",
|
|
11
10
|
"Login type": "Tipo de início de sessão",
|
|
12
11
|
"Email": "E-mail",
|
|
13
12
|
"Phone number": "Número de telefone",
|
package/admin/i18n/ru.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Регион",
|
|
8
8
|
"European Union": "Европейский союз",
|
|
9
9
|
"Rest of World": "Остальной мир",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Подключение к облаку пока не реализовано. Это значение не выбирает работающий сервер.",
|
|
11
10
|
"Login type": "Тип входа",
|
|
12
11
|
"Email": "Электронная почта",
|
|
13
12
|
"Phone number": "Номер телефона",
|
package/admin/i18n/uk.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Region": "Регіон",
|
|
8
8
|
"European Union": "Європейський Союз",
|
|
9
9
|
"Rest of World": "Решта світу",
|
|
10
|
-
"Cloud connectivity is not implemented yet. This value does not select a working backend.": "Підключення до хмари ще не реалізовано. Це значення не вибирає робочий сервер.",
|
|
11
10
|
"Login type": "Тип входу",
|
|
12
11
|
"Email": "Електронна пошта",
|
|
13
12
|
"Phone number": "Номер телефону",
|
package/admin/i18n/zh-cn.json
CHANGED
package/admin/jsonConfig.json
CHANGED
package/build/config.js
CHANGED
|
@@ -19,16 +19,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var config_exports = {};
|
|
20
20
|
__export(config_exports, {
|
|
21
21
|
DEFAULT_POLL_INTERVAL_SECONDS: () => DEFAULT_POLL_INTERVAL_SECONDS,
|
|
22
|
+
MAX_POLL_INTERVAL_SECONDS: () => MAX_POLL_INTERVAL_SECONDS,
|
|
22
23
|
validateConfig: () => validateConfig
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(config_exports);
|
|
25
26
|
var import_regions = require("./regions");
|
|
26
27
|
const DEFAULT_POLL_INTERVAL_SECONDS = 1800;
|
|
28
|
+
const MAX_POLL_INTERVAL_SECONDS = 2147483;
|
|
27
29
|
function validateConfig(config) {
|
|
28
30
|
var _a, _b, _c;
|
|
29
31
|
const errors = [];
|
|
30
|
-
if (config.pollIntervalSeconds !== void 0 && (!Number.isInteger(config.pollIntervalSeconds) || config.pollIntervalSeconds <
|
|
31
|
-
errors.push(
|
|
32
|
+
if (config.pollIntervalSeconds !== void 0 && (!Number.isInteger(config.pollIntervalSeconds) || config.pollIntervalSeconds < 60 || config.pollIntervalSeconds > MAX_POLL_INTERVAL_SECONDS)) {
|
|
33
|
+
errors.push(`Polling interval must be an integer between 60 and ${MAX_POLL_INTERVAL_SECONDS} seconds`);
|
|
32
34
|
}
|
|
33
35
|
if (!((_a = config.region) == null ? void 0 : _a.trim())) {
|
|
34
36
|
errors.push("Region/backend code is required");
|
|
@@ -54,6 +56,7 @@ function validateConfig(config) {
|
|
|
54
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
57
|
0 && (module.exports = {
|
|
56
58
|
DEFAULT_POLL_INTERVAL_SECONDS,
|
|
59
|
+
MAX_POLL_INTERVAL_SECONDS,
|
|
57
60
|
validateConfig
|
|
58
61
|
});
|
|
59
62
|
//# sourceMappingURL=config.js.map
|
package/build/config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import { isIndiaRegion, resolveSaicRegion } from './regions';\n\n/** Settings entered for one iSmart account and backend. */\nexport interface MgSaicConfig {\n\t/** Automatic status polling interval in seconds. */\n\tpollIntervalSeconds?: number;\n\t/** Backend region code. */\n\tregion?: string;\n\t/** Whether the account identifier is an email address or phone number. */\n\taccountType?: string;\n\t/** Email address or phone number used to sign in. */\n\taccountIdentifier?: string;\n\t/** International calling code when using a phone account. */\n\tphoneCountryCode?: string;\n\t/** Account password, decrypted by ioBroker for the adapter process. */\n\tpassword?: string;\n}\n\nexport const DEFAULT_POLL_INTERVAL_SECONDS = 1800;\n\n/**\n * Returns configuration problems without logging any credential values.\n *\n * @param config The instance's native configuration.\n */\nexport function validateConfig(config: MgSaicConfig): string[] {\n\tconst errors: string[] = [];\n\tif (\n\t\tconfig.pollIntervalSeconds !== undefined &&\n\t\t(!Number.isInteger(config.pollIntervalSeconds)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiD;AAkB1C,MAAM,gCAAgC;
|
|
4
|
+
"sourcesContent": ["import { isIndiaRegion, resolveSaicRegion } from './regions';\n\n/** Settings entered for one iSmart account and backend. */\nexport interface MgSaicConfig {\n\t/** Automatic status polling interval in seconds. */\n\tpollIntervalSeconds?: number;\n\t/** Backend region code. */\n\tregion?: string;\n\t/** Whether the account identifier is an email address or phone number. */\n\taccountType?: string;\n\t/** Email address or phone number used to sign in. */\n\taccountIdentifier?: string;\n\t/** International calling code when using a phone account. */\n\tphoneCountryCode?: string;\n\t/** Account password, decrypted by ioBroker for the adapter process. */\n\tpassword?: string;\n}\n\nexport const DEFAULT_POLL_INTERVAL_SECONDS = 1800;\nexport const MAX_POLL_INTERVAL_SECONDS = 2_147_483;\n\n/**\n * Returns configuration problems without logging any credential values.\n *\n * @param config The instance's native configuration.\n */\nexport function validateConfig(config: MgSaicConfig): string[] {\n\tconst errors: string[] = [];\n\tif (\n\t\tconfig.pollIntervalSeconds !== undefined &&\n\t\t(!Number.isInteger(config.pollIntervalSeconds) ||\n\t\t\tconfig.pollIntervalSeconds < 60 ||\n\t\t\tconfig.pollIntervalSeconds > MAX_POLL_INTERVAL_SECONDS)\n\t) {\n\t\terrors.push(`Polling interval must be an integer between 60 and ${MAX_POLL_INTERVAL_SECONDS} seconds`);\n\t}\n\tif (!config.region?.trim()) {\n\t\terrors.push('Region/backend code is required');\n\t} else if (isIndiaRegion(config.region)) {\n\t\terrors.push('India TAP connectivity is not implemented yet');\n\t} else if (!resolveSaicRegion(config.region)) {\n\t\terrors.push('Unsupported SAIC region');\n\t}\n\tif (config.accountType !== 'email' && config.accountType !== 'phone') {\n\t\terrors.push('Login type must be email or phone');\n\t}\n\tif (!config.accountIdentifier?.trim()) {\n\t\terrors.push('Email address or phone number is required');\n\t}\n\tif (config.accountType === 'phone' && !config.phoneCountryCode?.trim()) {\n\t\terrors.push('Phone country calling code is required');\n\t}\n\tif (!config.password) {\n\t\terrors.push('Password is required');\n\t}\n\treturn errors;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiD;AAkB1C,MAAM,gCAAgC;AACtC,MAAM,4BAA4B;AAOlC,SAAS,eAAe,QAAgC;AA1B/D;AA2BC,QAAM,SAAmB,CAAC;AAC1B,MACC,OAAO,wBAAwB,WAC9B,CAAC,OAAO,UAAU,OAAO,mBAAmB,KAC5C,OAAO,sBAAsB,MAC7B,OAAO,sBAAsB,4BAC7B;AACD,WAAO,KAAK,sDAAsD,yBAAyB,UAAU;AAAA,EACtG;AACA,MAAI,GAAC,YAAO,WAAP,mBAAe,SAAQ;AAC3B,WAAO,KAAK,iCAAiC;AAAA,EAC9C,eAAW,8BAAc,OAAO,MAAM,GAAG;AACxC,WAAO,KAAK,+CAA+C;AAAA,EAC5D,WAAW,KAAC,kCAAkB,OAAO,MAAM,GAAG;AAC7C,WAAO,KAAK,yBAAyB;AAAA,EACtC;AACA,MAAI,OAAO,gBAAgB,WAAW,OAAO,gBAAgB,SAAS;AACrE,WAAO,KAAK,mCAAmC;AAAA,EAChD;AACA,MAAI,GAAC,YAAO,sBAAP,mBAA0B,SAAQ;AACtC,WAAO,KAAK,2CAA2C;AAAA,EACxD;AACA,MAAI,OAAO,gBAAgB,WAAW,GAAC,YAAO,qBAAP,mBAAyB,SAAQ;AACvE,WAAO,KAAK,wCAAwC;AAAA,EACrD;AACA,MAAI,CAAC,OAAO,UAAU;AACrB,WAAO,KAAK,sBAAsB;AAAA,EACnC;AACA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|