iobroker.nexowatt-ui 0.7.49 → 0.7.50

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
@@ -1,25 +1,48 @@
1
1
  # NexoWatt UI
2
2
 
3
- Die **NexoWatt UI** ist die responsive Visualisierungsoberfläche (Web-UI) des NexoWatt EMS.
4
- Sie stellt Energieflüsse, Zustände und ausgewählte Steuerfunktionen übersichtlich auf Desktop, Tablet und Smartphone dar.
3
+ NexoWatt UI is the responsive visualization and customer cockpit for the NexoWatt EMS ioBroker adapter.
5
4
 
6
- ## Umfang der Visualisierung
5
+ It provides live energy-flow visualization, historical analysis, SmartHome visualization, installer-controlled EMS applications, and selected customer controls for desktop, tablet, and smartphone use.
7
6
 
8
- Typische Bereiche/Funktionen innerhalb der VIS:
7
+ ## Main features
9
8
 
10
- - **Live-Ansicht**: Aktuelle Energieflüsse (Erzeugung, Speicher, Netz, Verbraucher)
11
- - **E‑Mobilität (EVCS)**: Übersicht und Steuerung von Ladestationen/Wallboxen (inkl. Gesamtleistung)
12
- - **History**: Zeitreihen-/Verlaufsdarstellungen und Auswertungen
13
- - **SmartHome**: Gerätekacheln und Szenen/Automationen (UI‑seitig)
14
- - **Allgemeine UI‑Eigenschaften**: responsives Layout, konsistentes NexoWatt‑Branding (Farben/Icons), Echtzeit‑Aktualisierung
9
+ - **LIVE dashboard** with PV, grid, storage, building load, weather, KPIs, quick actions, and AI advisor cards.
10
+ - **History and reports** for energy flows, storage, grid import/export, tariff costs, EVCS reports, and yearly reports.
11
+ - **SmartHome visualization** with rooms, devices, favorites, and responsive mobile navigation.
12
+ - **Installer App-Center** for datapoint mapping, EMS apps, heating rod control, storage farm setup, EVCS/charging management, tariff logic, and diagnostics.
13
+ - **Responsive frontend** for desktop, tablet, and smartphone.
15
14
 
16
- ## Lizenz
15
+ ## ioBroker compatibility
17
16
 
18
- **Proprietär — ausschließlich zur Nutzung durch NexoWatt.**
17
+ This adapter is maintained for modern ioBroker installations and is prepared for Node.js 22+.
19
18
 
20
- Copyright (c) 2025 NexoWatt. Alle Rechte vorbehalten.
19
+ Recommended runtime baseline:
21
20
 
22
- Dieses Repository ist öffentlich einsehbar, ist jedoch **nicht Open Source**.
23
- Jegliche Nutzung, Vervielfältigung, Änderung, Verbreitung oder Bereitstellung (ganz oder teilweise) ist ohne **ausdrückliche schriftliche** Genehmigung von NexoWatt untersagt.
21
+ - Node.js: `>=22`
22
+ - js-controller: `>=6.0.11`
23
+ - Admin: `>=7.0.0`
24
24
 
25
- Details siehe Datei **LICENSE**.
25
+ Before publishing or submitting the adapter, run:
26
+
27
+ ```bash
28
+ npm run publish:check
29
+ npm run test:package
30
+ ```
31
+
32
+ For repository submission, additionally run the official ioBroker Adapter Checker and fix any reported findings.
33
+
34
+ ## Configuration
35
+
36
+ The basic HTTP port and IP binding are configured through the ioBroker Admin JSONConfig page.
37
+
38
+ The EMS datapoint mapping and installer-specific configuration are handled inside the NexoWatt EMS App-Center.
39
+
40
+ ## License
41
+
42
+ This repository is proprietary and not open source.
43
+
44
+ Copyright (c) 2025 NexoWatt. All rights reserved.
45
+
46
+ Use, copying, modification, distribution, hosting, or sublicensing is not permitted without explicit written permission from NexoWatt.
47
+
48
+ See [LICENSE](LICENSE) for details.
@@ -23,13 +23,15 @@
23
23
  "sm": 12,
24
24
  "md": 6
25
25
  },
26
- "bind": {
26
+ "ip": {
27
27
  "type": "text",
28
- "label": "Bind-Adresse",
29
- "attr": "bind",
28
+ "label": "IP-Adresse / Bind-Adresse",
29
+ "attr": "ip",
30
30
  "xs": 12,
31
31
  "sm": 12,
32
- "md": 6
32
+ "md": 6,
33
+ "help": "ioBroker-konforme IP-Adresse für den eingebauten Webserver. Legacy native.bind wird weiterhin als Fallback gelesen.",
34
+ "default": "0.0.0.0"
33
35
  }
34
36
  }
35
37
  },
package/ems/engine.js CHANGED
@@ -48,6 +48,18 @@ class EmsEngine {
48
48
  this._gridPowerLastTs = 0;
49
49
  }
50
50
 
51
+ _setInterval(fn, ms) {
52
+ const a = this.adapter;
53
+ return (a && typeof a.setInterval === 'function') ? a.setInterval(fn, ms) : setInterval(fn, ms);
54
+ }
55
+
56
+ _clearInterval(timer) {
57
+ if (!timer) return;
58
+ const a = this.adapter;
59
+ if (a && typeof a.clearInterval === 'function') a.clearInterval(timer);
60
+ else clearInterval(timer);
61
+ }
62
+
51
63
  /**
52
64
  * Ensure small internal helper states (derived values) exist.
53
65
  */
@@ -734,8 +746,8 @@ class EmsEngine {
734
746
  try { adapter.subscribeStates('aiAdvisor.*'); } catch (_e) {}
735
747
 
736
748
  // Start scheduler
737
- if (this._timer) clearInterval(this._timer);
738
- this._timer = setInterval(() => {
749
+ if (this._timer) this._clearInterval(this._timer);
750
+ this._timer = this._setInterval(() => {
739
751
  this.tick().catch(err => {
740
752
  try { adapter.log.warn(`[EMS] tick failed: ${err?.message || err}`); } catch (_e) {}
741
753
  });
@@ -940,7 +952,7 @@ class EmsEngine {
940
952
 
941
953
  stop() {
942
954
  if (this._timer) {
943
- clearInterval(this._timer);
955
+ this._clearInterval(this._timer);
944
956
  this._timer = null;
945
957
  }
946
958
  }
@@ -258,7 +258,10 @@ class BhkwControlModule extends BaseModule {
258
258
  if (!objectId) return false;
259
259
  try {
260
260
  await this.adapter.setForeignStateAsync(objectId, true, false);
261
- setTimeout(() => {
261
+ const setTimer = (this.adapter && typeof this.adapter.setTimeout === 'function')
262
+ ? this.adapter.setTimeout.bind(this.adapter)
263
+ : setTimeout;
264
+ setTimer(() => {
262
265
  this.adapter.setForeignStateAsync(objectId, false, false).catch(() => {});
263
266
  }, pulseMs);
264
267
  return true;
@@ -590,6 +590,18 @@ class ChargingManagementModule extends BaseModule {
590
590
  }
591
591
  }
592
592
 
593
+ _setTimeout(fn, ms) {
594
+ const a = this.adapter;
595
+ return (a && typeof a.setTimeout === 'function') ? a.setTimeout(fn, ms) : setTimeout(fn, ms);
596
+ }
597
+
598
+ _clearTimeout(timer) {
599
+ if (!timer) return;
600
+ const a = this.adapter;
601
+ if (a && typeof a.clearTimeout === 'function') a.clearTimeout(timer);
602
+ else clearTimeout(timer);
603
+ }
604
+
593
605
  _schedulePubFlush() {
594
606
  if (this._pubFlushTimer) return;
595
607
 
@@ -598,7 +610,7 @@ class ChargingManagementModule extends BaseModule {
598
610
  const diff = now - last;
599
611
  const delay = diff >= this._pubFlushIntervalMs ? 0 : (this._pubFlushIntervalMs - diff);
600
612
 
601
- this._pubFlushTimer = setTimeout(() => {
613
+ this._pubFlushTimer = this._setTimeout(() => {
602
614
  this._pubFlushTimer = null;
603
615
  this._flushPubQueue().catch(() => {});
604
616
  }, delay);
@@ -258,7 +258,10 @@ class GeneratorControlModule extends BaseModule {
258
258
  if (!objectId) return false;
259
259
  try {
260
260
  await this.adapter.setForeignStateAsync(objectId, true, false);
261
- setTimeout(() => {
261
+ const setTimer = (this.adapter && typeof this.adapter.setTimeout === 'function')
262
+ ? this.adapter.setTimeout.bind(this.adapter)
263
+ : setTimeout;
264
+ setTimer(() => {
262
265
  this.adapter.setForeignStateAsync(objectId, false, false).catch(() => {});
263
266
  }, pulseMs);
264
267
  return true;