iobroker.luxtronik2-controller 0.19.6 → 0.20.0

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 CHANGED
@@ -90,8 +90,15 @@ You might see red error messages in the installation log related to `node-gyp`,
90
90
  [Info English](documentation/readme_en.md)
91
91
 
92
92
  ## Changelog
93
+ ### 0.20.0 (2026-10-22)
94
+
95
+ **🚀 Features & Enhancements**
96
+
97
+ - **Automatic Firmware Update Check:** Added a background service to automatically check the official AIT download portal for new heat pump firmware updates.
98
+ - **Update Notifications:** Added a new configuration tab to set a custom cron schedule and enable optional Telegram notifications when a new firmware version is released.
99
+ - **New Update Datapoints:** Added `firmware_available`, `firmware_update_available`, and `firmware_changelog` to the system info tree to directly expose update states and release notes in ioBroker.
100
+ - **Manual Trigger Button:** Added a `check_firmware` button to manually initiate the update check process at any time.
93
101
 
94
- // ### **WORK IN PROGRESS**
95
102
  ### 0.19.6 (2026-10-22)
96
103
 
97
104
  **🚀 Features & Enhancements**
@@ -119,15 +126,6 @@ You might see red error messages in the installation log related to `node-gyp`,
119
126
  - **Broader Node.js Compatibility:** Adjusted Node.js engine requirement from `>=22` down to `>=18.0.0` in `package.json` and added `{ "node": ">=18.0.0" }` to `dependencies` in `io-package.json`. This enables full compatibility with widely used Long-Term Support (LTS) releases (Node.js 18 and 20) while preventing installation on deprecated runtimes.
120
127
  - **Hybrid Modbus Value Persistence:** Prevented native 3003 telemetry polling (EEPROM) from overwriting volatile parameters actively managed via Modbus TCP (RAM) in the ioBroker object tree.
121
128
 
122
- ### 0.19.1 (2026-10-20)
123
-
124
- **📝 Documentation & Guide Overhaul**
125
-
126
- - **Complete Alignment of Documentation (`README.md` & `documentation/readme_de.md` & `documentation/readme_en.md`):**
127
- - Restructured and synchronized both German and English documentation to accurately match all **11 configuration tabs** of the Admin UI in sequential order:
128
- - **Hardware Protection Architecture:** Added an explicit section explaining Read-Before-Write protection (`writePumpSafe`), daily and total flash cycle counters, and the vendor firmware `.90` crash shield.
129
- - **Troubleshooting & ARM Compatibility:** Added troubleshooting documentation regarding harmless `node-gyp` / `serialport` / `usocket` compilation warnings on Raspberry Pi / ARM systems, alongside step-by-step guidance for running the raw TCP diagnostic script (`Test_Script.ts`).
130
-
131
129
  ## License
132
130
 
133
131
  MIT License
@@ -4022,6 +4022,62 @@
4022
4022
  "lg": 3,
4023
4023
  "xl": 3
4024
4024
  },
4025
+ "sync_check_firmware": {
4026
+ "type": "checkbox",
4027
+ "label": {
4028
+ "en": "Check for firmware update",
4029
+ "de": "Manuell nach Firmware-Update suchen"
4030
+ },
4031
+ "default": true,
4032
+ "disabled": "!data.sync_category_information_12_systeminfo",
4033
+ "xs": 12,
4034
+ "sm": 6,
4035
+ "md": 3,
4036
+ "lg": 3,
4037
+ "xl": 3
4038
+ },
4039
+ "sync_firmware_available": {
4040
+ "type": "checkbox",
4041
+ "label": {
4042
+ "en": "Available firmware version (System critical)",
4043
+ "de": "Verfügbare Firmware Version (Systemrelevant)"
4044
+ },
4045
+ "default": true,
4046
+ "disabled": true,
4047
+ "xs": 12,
4048
+ "sm": 6,
4049
+ "md": 3,
4050
+ "lg": 3,
4051
+ "xl": 3
4052
+ },
4053
+ "sync_firmware_update_available": {
4054
+ "type": "checkbox",
4055
+ "label": {
4056
+ "en": "Firmware update available (System critical)",
4057
+ "de": "Firmware Update verfügbar (Systemrelevant)"
4058
+ },
4059
+ "default": true,
4060
+ "disabled": true,
4061
+ "xs": 12,
4062
+ "sm": 6,
4063
+ "md": 3,
4064
+ "lg": 3,
4065
+ "xl": 3
4066
+ },
4067
+ "sync_firmware_changelog": {
4068
+ "type": "checkbox",
4069
+ "label": {
4070
+ "en": "Firmware changelog (System critical)",
4071
+ "de": "Firmware Changelog (Systemrelevant)"
4072
+ },
4073
+ "default": true,
4074
+ "disabled": true,
4075
+ "xs": 12,
4076
+ "sm": 6,
4077
+ "md": 3,
4078
+ "lg": 3,
4079
+ "xl": 3
4080
+ },
4025
4081
  "sync_model_code": {
4026
4082
  "type": "checkbox",
4027
4083
  "label": {
@@ -10912,6 +10968,104 @@
10912
10968
  }
10913
10969
  }
10914
10970
  },
10971
+ "tab_updates": {
10972
+ "type": "panel",
10973
+ "label": {
10974
+ "en": "Updates",
10975
+ "de": "Updates"
10976
+ },
10977
+ "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0ibTE4IDIybDMtM2wtLjctLjdsLTEuOCAxLjhWMTZoLTF2NC4xbC0xLjgtMS44bC0uNy43ek0xMiA0TDYuMDc1IDcuNDI1TDEyIDEwLjg1bDUuOTI1LTMuNDI1ek0zIDE1Ljk3NXYtNy45NXEwLS41NS4yNjMtMVQ0IDYuM2w3LTQuMDI1cS4yNS0uMTI1LjQ4OC0uMlQxMiAydC41MjUuMDc1dC40NzUuMkwyMCA2LjNxLjQ3NS4yNzUuNzM4LjcyNXQuMjYyIDFWMTJoLTJWOS4xbC03LjAyNSA0LjA1TDUgOS4xdjYuODVsNiAzLjQ3NXYyLjNMNCAxNy43cS0uNDc1LS4yNzUtLjczNy0uNzI1dC0uMjYzLTFtMTEuNDYzIDYuNTYzUTEzIDIxLjA3NSAxMyAxOXQxLjQ2My0zLjUzN1QxOCAxNHQzLjUzOCAxLjQ2M1QyMyAxOXQtMS40NjMgMy41MzhUMTggMjR0LTMuNTM3LTEuNDYzTTEyIDExLjcyNiIgLz4KPC9zdmc+Cg==",
10978
+ "items": {
10979
+ "update_check_active": {
10980
+ "type": "checkbox",
10981
+ "label": {
10982
+ "en": "Check for firmware updates automatically",
10983
+ "de": "Automatisch nach Firmware-Updates suchen"
10984
+ },
10985
+ "newLine": true,
10986
+ "default": false
10987
+ },
10988
+ "update_check_cron": {
10989
+ "type": "cron",
10990
+ "label": {
10991
+ "en": "Update check schedule",
10992
+ "de": "Zeitplan für automatische Prüfung"
10993
+ },
10994
+ "default": "0 12 * * *",
10995
+ "hidden": "!data.update_check_active"
10996
+ },
10997
+ "update_check_timeout": {
10998
+ "type": "number",
10999
+ "label": {
11000
+ "en": "Network timeout (seconds)",
11001
+ "de": "Netzwerk-Timeout (Sekunden)"
11002
+ },
11003
+ "default": 120,
11004
+ "min": 10,
11005
+ "max": 600,
11006
+ "hidden": "!data.update_check_active"
11007
+ },
11008
+ "update_timeout_info": {
11009
+ "type": "staticText",
11010
+ "text": {
11011
+ "en": "⚠️ <b>Note:</b> The official Alpha Innotec server is currently responding extremely slowly. A timeout of at least 120 seconds is highly recommended to prevent aborted checks.",
11012
+ "de": "⚠️ <b>Hinweis:</b> Der offizielle Alpha Innotec Server (heatpump24) antwortet aktuell extrem langsam. Ein Timeout von mindestens 120 Sekunden wird dringend empfohlen, damit die Prüfung nicht abbricht."
11013
+ },
11014
+ "style": {
11015
+ "color": "#ff9800",
11016
+ "marginBottom": "15px",
11017
+ "fontSize": "12px"
11018
+ },
11019
+ "hidden": "!data.update_check_active"
11020
+ },
11021
+ "divider_notifications": {
11022
+ "type": "divider",
11023
+ "color": "primary",
11024
+ "hidden": "!data.update_check_active",
11025
+ "style": {
11026
+ "marginBottom": "15px",
11027
+ "marginTop": "15px"
11028
+ },
11029
+ "xs": 12,
11030
+ "sm": 12,
11031
+ "md": 12,
11032
+ "lg": 12,
11033
+ "xl": 12
11034
+ },
11035
+ "headerNotifications": {
11036
+ "type": "header",
11037
+ "text": {
11038
+ "en": "Notification channels for new updates",
11039
+ "de": "Benachrichtigungswege bei neuen Updates"
11040
+ },
11041
+ "size": 5,
11042
+ "hidden": "!data.update_check_active",
11043
+ "xs": 12,
11044
+ "sm": 12,
11045
+ "md": 12,
11046
+ "lg": 12,
11047
+ "xl": 12
11048
+ },
11049
+ "update_check_telegram": {
11050
+ "type": "checkbox",
11051
+ "label": {
11052
+ "en": "Send Telegram message",
11053
+ "de": "Telegram-Nachricht senden"
11054
+ },
11055
+ "default": false,
11056
+ "hidden": "!data.update_check_active"
11057
+ },
11058
+ "update_check_notification": {
11059
+ "type": "checkbox",
11060
+ "label": {
11061
+ "en": "Show as ioBroker notification (Bell)",
11062
+ "de": "Als ioBroker-Benachrichtigung (Glocke) zeigen"
11063
+ },
11064
+ "default": false,
11065
+ "hidden": "!data.update_check_active"
11066
+ }
11067
+ }
11068
+ },
10915
11069
  "customValuesTab": {
10916
11070
  "type": "panel",
10917
11071
  "label": {
package/build/main.js CHANGED
@@ -21,6 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
+ var schedule = __toESM(require("node-schedule"));
24
25
  var utils = __toESM(require("@iobroker/adapter-core"));
25
26
  var import_actionHandlers = require("./actionHandlers");
26
27
  var import_backupManager = require("./backupManager");
@@ -34,6 +35,7 @@ var import_objectManager = require("./objectManager");
34
35
  var import_rawFunctions = require("./rawFunctions");
35
36
  var import_stateMapping = require("./stateMapping");
36
37
  var import_svgGenerator = require("./svgGenerator");
38
+ var import_updateManager = require("./updateManager");
37
39
  var import_virtualStates = require("./virtualStates");
38
40
  var import_zipManager = require("./zipManager");
39
41
  class Luxtronik2Controller extends utils.Adapter {
@@ -76,6 +78,8 @@ class Luxtronik2Controller extends utils.Adapter {
76
78
  zipCountdownInterval;
77
79
  /** Target timestamp when the current ZIP run finishes */
78
80
  zipEndTime;
81
+ /** Cron-Job Handle für die Firmware-Update-Prüfung */
82
+ updateCronJob;
79
83
  /**
80
84
  * Initializes a new instance of the Luxtronik2Controller class.
81
85
  *
@@ -188,6 +192,7 @@ class Luxtronik2Controller extends utils.Adapter {
188
192
  await (0, import_objectManager.ensureAllObjectsExist)(this);
189
193
  await (0, import_objectManager.ensureCustomObjectsExist)(this);
190
194
  (0, import_backupManager.initAutoBackup)(this);
195
+ await this.subscribeStatesAsync("Information.12_SystemInfo.check_firmware");
191
196
  await this.setState((0, import_stateMapping.getDpPath)("Regelung_Aktiv"), { val: config.regelung_aktiv === true, ack: true });
192
197
  const debugState = await this.getStateAsync((0, import_stateMapping.getDpPath)("Schreibe_Debug_Log"));
193
198
  this.isDebugLogActive = (debugState == null ? void 0 : debugState.val) === true;
@@ -237,6 +242,39 @@ class Luxtronik2Controller extends utils.Adapter {
237
242
  "warn"
238
243
  );
239
244
  }
245
+ for (const [key, stateDef] of Object.entries(import_stateMapping.STATE_MAPPING)) {
246
+ if (stateDef.isVirtual) {
247
+ await this.setObjectNotExistsAsync(`${stateDef.folder}.${key}`, {
248
+ type: "state",
249
+ common: {
250
+ name: stateDef.name,
251
+ type: stateDef.type,
252
+ role: stateDef.role,
253
+ read: true,
254
+ write: stateDef.write || false,
255
+ def: stateDef.def !== void 0 ? stateDef.def : null
256
+ },
257
+ native: {
258
+ luxWriteId: stateDef.luxWriteId || null,
259
+ dataSource: stateDef.dataSource || null
260
+ }
261
+ });
262
+ }
263
+ }
264
+ if (config.update_check_active === true) {
265
+ this.setTimeout(() => {
266
+ void (0, import_updateManager.checkFirmwareUpdate)(this);
267
+ }, 15e3);
268
+ const cronString = config.update_check_cron || "0 12 * * *";
269
+ try {
270
+ this.updateCronJob = schedule.scheduleJob(cronString, () => {
271
+ this.log.info("F\xFChre geplante Firmware-Update-Pr\xFCfung aus (Cron)...");
272
+ void (0, import_updateManager.checkFirmwareUpdate)(this);
273
+ });
274
+ } catch (err) {
275
+ this.log.error(`Fehler beim Einrichten des Firmware-Update-Crons (${cronString}): ${err.message}`);
276
+ }
277
+ }
240
278
  this.pollingInterval = this.setInterval(async () => {
241
279
  try {
242
280
  await this.updateData();
@@ -784,6 +822,9 @@ class Luxtronik2Controller extends utils.Adapter {
784
822
  if (this.zipCountdownInterval) {
785
823
  this.clearInterval(this.zipCountdownInterval);
786
824
  }
825
+ if (this.updateCronJob) {
826
+ this.updateCronJob.cancel();
827
+ }
787
828
  (0, import_backupManager.stopAutoBackup)(this);
788
829
  if (this.midnightTimer) {
789
830
  this.clearTimeout(this.midnightTimer);
@@ -816,6 +857,12 @@ class Luxtronik2Controller extends utils.Adapter {
816
857
  if (state.ack) {
817
858
  return;
818
859
  }
860
+ if (id.endsWith("check_firmware") && state.val === true) {
861
+ this.log.info("Manuelle Firmware-Update-Pr\xFCfung durch Benutzer gestartet...");
862
+ void this.setState(id, false, true);
863
+ void (0, import_updateManager.checkFirmwareUpdate)(this);
864
+ return;
865
+ }
819
866
  if (id.startsWith(`${this.namespace}.Custom.`)) {
820
867
  try {
821
868
  const obj = await this.getObjectAsync(id);