node-red-contrib-knx-ultimate 6.3.13 → 6.3.15
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 +11 -0
- package/examples/KNX AI - Telegrambot Direct Chat.json +0 -1
- package/nodes/knxUltimateAI.html +1 -7
- package/nodes/knxUltimateAI.js +265 -29
- package/nodes/knxUltimateMatterBridge.html +19 -2
- package/nodes/knxUltimateMatterBridge.js +18 -3
- package/nodes/locales/de/knxUltimateAI.html +6 -6
- package/nodes/locales/de/knxUltimateAI.json +1 -3
- package/nodes/locales/de/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/de/knxUltimateMatterBridge.json +5 -1
- package/nodes/locales/en/knxUltimateAI.html +6 -6
- package/nodes/locales/en/knxUltimateAI.json +1 -3
- package/nodes/locales/en/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/en/knxUltimateMatterBridge.json +5 -1
- package/nodes/locales/es/knxUltimateAI.html +6 -6
- package/nodes/locales/es/knxUltimateAI.json +1 -3
- package/nodes/locales/es/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/es/knxUltimateMatterBridge.json +5 -1
- package/nodes/locales/fr/knxUltimateAI.html +6 -6
- package/nodes/locales/fr/knxUltimateAI.json +1 -3
- package/nodes/locales/fr/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/fr/knxUltimateMatterBridge.json +5 -1
- package/nodes/locales/it/knxUltimateAI.html +6 -6
- package/nodes/locales/it/knxUltimateAI.json +1 -3
- package/nodes/locales/it/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/it/knxUltimateMatterBridge.json +5 -1
- package/nodes/locales/zh-CN/knxUltimateAI.html +6 -6
- package/nodes/locales/zh-CN/knxUltimateAI.json +1 -3
- package/nodes/locales/zh-CN/knxUltimateMatterBridge.html +3 -1
- package/nodes/locales/zh-CN/knxUltimateMatterBridge.json +5 -1
- package/nodes/utils/knxAiChatContext.js +277 -0
- package/nodes/utils/knxAiHomeMemory.js +2 -2
- package/nodes/utils/matterBridgeDeviceFactory.mjs +130 -65
- package/package.json +1 -1
- package/resources/KNXAIChatAdapterMappings.js +89 -0
|
@@ -14,14 +14,14 @@ Jede an den Ausgängen 3 und 4 ausgegebene Nachricht enthält außerdem eine Kop
|
|
|
14
14
|
## Befehle (Eingang)
|
|
15
15
|
Sende `msg.topic`:
|
|
16
16
|
- `summary` (oder leer): Summary sofort senden
|
|
17
|
-
- `reset`: internen Verlauf, Zähler
|
|
17
|
+
- `reset`: internen Verlauf, Zähler, gelerntes Hausgedächtnis und alle gespeicherten Chat-Kontexte löschen; die KI-Erziehung bleibt unverändert
|
|
18
18
|
- `ask`: Frage an das konfigurierte LLM senden
|
|
19
19
|
- `confirm` / `cancel`: ausstehende KNX-Befehle ohne erneuten LLM-Aufruf bestätigen oder abbrechen
|
|
20
|
-
- `clear_chat`:
|
|
20
|
+
- `clear_chat`: letzte Gesprächsschritte, dauerhafte Anweisungen und ausstehende Befehle der aktuellen Sitzung löschen
|
|
21
21
|
|
|
22
22
|
Für `ask` die Frage in `msg.prompt` (empfohlen), `msg.payload` (String) oder den üblichen Telegram-Feldern `msg.payload.content` / `msg.payload.text` übergeben.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Jede Ask-/Chat-Sitzung speichert ihre letzten 8 Gesprächsschritte und bis zu 20 ausdrücklich langfristige Anweisungen, getrennt nach `msg.knxAi.sessionId`, `msg.sessionId` oder erkannter Telegram-Chat-ID. Aufforderungen wie „Merk dir, den Begriff unknown nicht zu verwenden“ werden dauerhaft gespeichert. Alle KNX-AI-Nodes mit demselben Speicher teilen diesen Kontext live und laden ihn nach einem Node-RED-Neustart aus `knxultimatestorage/knxai/memory/knxai-chat-context.md`. Die atomar geschriebene Datei ist auf 50 Sitzungen und 512 KB begrenzt. Bei aktiviertem KNX-Steuern Ausgang 3 mit dem Chat-Sender und Ausgang 4 mit einem KNX-Ultimate-Node im **Universalmodus** verbinden. Bei aktiver Bestätigung zeigt die erste Antwort GA, DPT und Payload, ohne Schreiboperationen auszugeben; dieselbe Sitzung muss innerhalb von 5 Minuten `BESTÄTIGEN` oder `ABBRECHEN` antworten. Eine neue Anfrage ersetzt einen älteren Plan. Jeder bestätigte Befehl enthält `msg.destination`, `msg.dpt`, `msg.payload` und `msg.event = "GroupValue_Write"`.
|
|
25
25
|
Bei DPT-1.xxx-Schreibvorgängen werden die sicheren KI-Entsprechungen `true`/`false`, `1`/`0` und `on`/`off` vor der lokalen Validierung und Ausgabe in echte Boolesche Werte normalisiert.
|
|
26
26
|
|
|
27
27
|
### Aktuelle KNX-Lesewerte
|
|
@@ -35,12 +35,14 @@ Der Tab **Chat-Adapter** lädt seine auswählbaren Zuordnungen aus `resources/KN
|
|
|
35
35
|
|
|
36
36
|
Die enthaltene Vorlage **windkh/node-red-contrib-telegrambot** folgt dem Receiver-/Sender-Vertrag des Pakets. Verbinden Sie einen `telegram receiver` direkt mit KNX AI und Ausgang 3 direkt mit einem `telegram sender`. Für Inline-Bestätigungsschaltflächen verbinden Sie zusätzlich einen als `callback_query` konfigurierten `telegram event` mit demselben KNX-AI-Eingang. Die Eingangszuordnung liest `msg.payload.content`, `msg.payload.chatId` und die Telegram-Sprache. Die Ausgangszuordnung erstellt `msg.payload.chatId`, `type` und `content` und ergänzt bei ausstehender Schreibbestätigung `options.reply_markup` aus `msg.knxAi.confirmationRequest`. Das Telegram-Paket bleibt eine separate optionale Abhängigkeit.
|
|
37
37
|
|
|
38
|
+
Die enthaltene Vorlage **RedBot / node-red-contrib-chatbot (Telegram)** folgt dem gemeinsamen RedBot-Nachrichtenformat. Verbinden Sie `chatbot-telegram-receive` direkt mit KNX AI und Ausgang 3 direkt mit `chatbot-telegram-send`; ein separater Callback-Node ist nicht erforderlich, da RedBot Postbacks von Inline-Schaltflächen in normale Eingangsnachrichten umwandelt. Die Eingangszuordnung liest `transport`, `chatId`, `type`, `content` und die Telegram-Sprache. Die Ausgangszuordnung bewahrt die RedBot-Trackingdaten `originalMessage`, `chat`, `api` und `client` und erzeugt anschließend entweder einen `message`-Payload oder einen `inline-buttons`-Payload mit `postback`-Aktionen zur Bestätigung. RedBot bleibt eine separate optionale Abhängigkeit.
|
|
39
|
+
|
|
38
40
|
## Proaktive Hausintelligenz und begrenztes Gedächtnis
|
|
39
41
|
Der Unterbereich **Proaktives Zuhause & Gedächtnis** in **Gespräche & Zuhause** aktiviert proaktive Benachrichtigungen auf Wunsch des Benutzers. Aus ETS-Hierarchie, Namen, Rollen und DPTs erstellt der Node ein deterministisches semantisches Modell für Rollläden, Fenster, Türen, Licht, Temperatur, Klima, Anwesenheit und Alarme mit italienischen, englischen, deutschen, französischen, spanischen und chinesischen Begriffen. Der erste proaktive Detektor überwacht nur zuverlässig erkannte Nicht-Befehlszustände von Rollläden/Fenstern/Türen. Nach der konfigurierten Offenzeit und außerhalb der Ruhezeiten gibt Ausgang 3 eine lokalisierte Nachricht mit `msg.knxAi.type = "proactive_notification"` aus. Ausgang 4 wird niemals proaktiv verwendet und KNX wird nicht selbstständig verändert; eine spätere Benutzeranfrage durchläuft weiterhin die normale Validierung und Bestätigung.
|
|
40
42
|
|
|
41
43
|
Die letzte Chat-Sitzung wird als Eigentümer gespeichert; alternativ kann **Hauptempfänger / Chat-ID** sie ausdrücklich festlegen. Ein synthetisches `msg.inputMessage` bewahrt den Empfänger, damit der Telegram-Adapter eine spontane Nachricht senden kann. Cooldown und höchstens drei proaktive Nachrichten pro Stunde verhindern eine Nachrichtenflut.
|
|
42
44
|
|
|
43
|
-
Die gelernte Referenz wird beim Start aus `<userDir>/knxai/memory/knxai-home-memory
|
|
45
|
+
Die gemeinsame gelernte Referenz wird beim Start aus `<userDir>/knxai/memory/knxai-home-memory.md` geladen, alle 15 Minuten atomar neu geschrieben und immer strikt auf 5 MB begrenzt. Sie enthält höchstens 120 wichtige Beobachtungen, 80 aggregierte Gewohnheiten, 80 Benachrichtigungen und 300 semantische ETS-Objekte, niemals einen unbegrenzten Rohtelegrammstrom. Alte Einträge mit niedriger Priorität werden zuerst entfernt. **KI-Erziehung** ist auf 16.000 Zeichen begrenzt und stammt immer aus der Node-Konfiguration: Die KI darf sie als verbindliche Vorgabe lesen, aber weder ändern noch überschreiben. Ist eine Erziehung vorhanden, kann das LLM sie aber nicht auswerten, wird die mögliche Benachrichtigung unterdrückt, statt ihr möglicherweise zu widersprechen.
|
|
44
46
|
|
|
45
47
|
## Praktisches Konfigurationsbeispiel
|
|
46
48
|
Dieses Beispiel erstellt einen knappen Assistenten, der wichtige Öffnungen meldet, aber akzeptiert, dass der Rollladen im Büro offen bleiben darf:
|
|
@@ -52,7 +54,6 @@ Dieses Beispiel erstellt einen knappen Assistenten, der wichtige Öffnungen meld
|
|
|
52
54
|
| **Nach offener Dauer benachrichtigen** (`proactiveOpenMinutes`) | `120` | Nach zwei Stunden wird eine mögliche Meldung bewertet. |
|
|
53
55
|
| **Ruhezeit Beginn / Ende** | `23:00` / `07:00` | Nachts werden keine proaktiven Nachrichten ausgegeben. |
|
|
54
56
|
| **Wiederholungs-Cooldown** (`proactiveCooldownMinutes`) | `360` | Dasselbe Objekt meldet sich sechs Stunden lang nicht erneut. |
|
|
55
|
-
| **Maximale Hausgedächtnis-Datei** (`homeMemoryMaxKb`) | `256` | Die Markdown-Referenz dieses Nodes bleibt unter 256 KB. |
|
|
56
57
|
|
|
57
58
|
Beispiel für **KI-Erziehung** (`aiEducation`):
|
|
58
59
|
|
|
@@ -116,7 +117,6 @@ KNX AI hört automatisch auf `GroupValue_Write`, `GroupValue_Response` und `Grou
|
|
|
116
117
|
- **Ruhezeit Beginn / Ende**: Täglicher Zeitraum, in dem proaktive Nachrichten unterdrückt werden.
|
|
117
118
|
- **KI-Erziehung**: Verbindliche, ausschließlich vom Benutzer verwaltete Hinweise, die die KI lesen, aber nie ändern darf.
|
|
118
119
|
- **Wiederholungs-Cooldown (Minuten)**: Mindestintervall vor einer weiteren Meldung desselben Objekts; standardmäßig 360 Minuten.
|
|
119
|
-
- **Maximale Hausgedächtnis-Datei (KB)**: Harte Grenze von 64 bis 1.024 KB; standardmäßig 256 KB.
|
|
120
120
|
- Wenn das Festplattenarchiv aktiv ist, nutzt **Ask** standardmäßig dieses Archiv: explizite Datumsangaben/Zeitbereiche werden beachtet, sonst durchsucht der Assistent die letzten 24 Stunden plus aktuelle RAM-Events.
|
|
121
121
|
- **Node-RED-Projektinventar einbeziehen**: Nimmt das gesamte Node-RED-Projektinventar in den Prompt auf, einschließlich KNX-Nodes und anderer hilfreicher Nodes wie function/change/inject/template, wenn sie KNX-Logik oder Gruppenadressen enthalten.
|
|
122
122
|
- Relevante Auszüge aus Hilfe, README und Beispielen werden immer automatisch einbezogen.
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"proactiveCooldownMinutes": "Wiederholsperre (Minuten)",
|
|
58
58
|
"proactiveQuietStart": "Beginn der Ruhezeit",
|
|
59
59
|
"proactiveQuietEnd": "Ende der Ruhezeit",
|
|
60
|
-
"homeMemoryMaxKb": "Maximale Hausgedächtnisdatei (KB)",
|
|
61
60
|
"aiEducation": "KI-Erziehung (vom Benutzer verwaltet)",
|
|
62
61
|
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)",
|
|
63
62
|
"llmDocsLanguage": "Docs language"
|
|
@@ -97,8 +96,7 @@
|
|
|
97
96
|
"chatAdapterIntro": "Wählen Sie eine Vorlage, um den Code für Ein- und Ausgang einzufügen. Die Liste wird aus der mitgelieferten Chat-Adapter-Datei geladen; der erzeugte Code bleibt bearbeitbar.",
|
|
98
97
|
"chatAdapterCodeHelp": "Zuordnungen laufen synchron. Geben Sie msg zurück, um fortzufahren, oder keinen Wert, um die Nachricht zu verwerfen. Fehler werden abgefangen und gemeldet, ohne Node-RED anzuhalten.",
|
|
99
98
|
"homeIntelligenceIntro": "Der Node erstellt ein mehrsprachiges semantisches ETS-Modell und kann den Chat benachrichtigen, wenn ein zuverlässig erkannter Rollladen, ein Fenster oder eine Tür offen bleibt. Er sendet niemals selbstständig einen KNX-Befehl.",
|
|
100
|
-
"aiEducationHelp": "Nur der Benutzer kann diesen Abschnitt bearbeiten. Die KI liest ihn als verbindliche Vorgabe; gelernte Erinnerungen können ihn niemals überschreiben. Maximal 16.000 Zeichen."
|
|
101
|
-
"homeMemoryLimitHelp": "Das Markdown-Gedächtnis wird alle 15 Minuten atomar neu geschrieben und bleibt stets auf 64 bis 1.024 KB begrenzt. Alte Beobachtungen werden vor Gewohnheiten und semantischen Objekten entfernt."
|
|
99
|
+
"aiEducationHelp": "Nur der Benutzer kann diesen Abschnitt bearbeiten. Die KI liest ihn als verbindliche Vorgabe; gelernte Erinnerungen können ihn niemals überschreiben. Maximal 16.000 Zeichen."
|
|
102
100
|
},
|
|
103
101
|
"sidebar": {
|
|
104
102
|
"ui": {
|
|
@@ -27,7 +27,9 @@ Das Ändern des Gerätetyps nach der Kopplung der Bridge verändert die Matter-E
|
|
|
27
27
|
| Tunable-White-Licht | + Farbtemperatur Befehls-/Status-GA in Kelvin (DPT 7.600) |
|
|
28
28
|
| Rollladen / Jalousie | Auf/Ab (DPT 1.008), Stopp (DPT 1.017), Position % Befehl/Status (DPT 5.001), optionale Positionsumkehr |
|
|
29
29
|
| Thermostat (Heizung und/oder Kühlung) | GA aktuelle Temperatur, Sollwert Befehls-/Status-GA (DPT 9.001). Mit zusätzlichem Kühl-Sollwert Befehls-/Status-GA wird auch der Kühlmodus (Doppel-Sollwert) bereitgestellt |
|
|
30
|
+
| Raumklimagerät | Ein Matter-Gerät kombiniert Ein/Aus (DPT 1.001), aktuelle Temperatur und Heiz-/Kühl-Sollwerte (DPT 9.001) sowie Lüftergeschwindigkeit % (DPT 5.001), jeweils als Befehls-/Status-GA |
|
|
30
31
|
| Ventilator / Lüftung | Geschwindigkeit % Befehls-/Status-GA (DPT 5.001) |
|
|
32
|
+
| Türschloss | Verriegeln/Entriegeln Befehls-GA und Verriegelt/Entriegelt Status-GA (DPT 1.001; `true` = verriegelt) |
|
|
31
33
|
| Sensoren (Temperatur, Feuchte, Licht, Präsenz, Kontakt) | Je eine Status-GA |
|
|
32
34
|
| Rauch-/CO-Melder | Rauchalarm Status-GA + optionale CO-Alarm Status-GA (DPT 1.005): kritische Benachrichtigungen auf dem Telefon |
|
|
33
35
|
| Wasserleckmelder | Leckage Status-GA (DPT 1.005) |
|
|
@@ -45,7 +47,7 @@ Diese Optionen werden nur angezeigt, wenn sie zum gewählten Typ passen. Dimmbar
|
|
|
45
47
|
|
|
46
48
|
Der PIN-Selektor befindet sich außerhalb der Editor-Tabs. Nach dem Aktivieren erscheint direkt darunter ein kontextbezogener Bereich **Flow-Eingang/-Ausgang** mit kopierbaren Beispielen für den ausgewählten Gerätetyp:
|
|
47
49
|
|
|
48
|
-
- **Input**: aktualisiere den Matter-Zustand aus dem Flow, ohne den KNX-Bus: `msg.payload = { function: "onoff", value: true }` (`function` ist eine von `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `fanspeed`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Nützlich, um im Flow berechnete Werte (z.B. einen virtuellen Sensor) für Alexa & Co. bereitzustellen.
|
|
50
|
+
- **Input**: aktualisiere den Matter-Zustand aus dem Flow, ohne den KNX-Bus: `msg.payload = { function: "onoff", value: true }` (`function` ist eine von `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `coolingsetpoint`, `fanspeed`, `lock`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Nützlich, um im Flow berechnete Werte (z.B. einen virtuellen Sensor) für Alexa & Co. bereitzustellen.
|
|
49
51
|
- **Output**: Jeder von einem Matter-Controller empfangene Befehl wird an den Flow weitergeleitet: `msg.topic` = Gerätename, `msg.payload` = Wert, `msg.matter` = der rohe Befehl. Ein Gerät ohne Befehls-GAs wird zum **Nur-Flow-Gerät**.
|
|
50
52
|
|
|
51
53
|
## Hinweise
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
"fn_leak_ga": "Leckage Status-GA",
|
|
75
75
|
"fn_co2_ga": "CO2 Status-GA (ppm, DPT 9.008)",
|
|
76
76
|
"fn_fanspeed_cmd": "Lüftergeschwindigkeit % Befehls-GA",
|
|
77
|
-
"fn_fanspeed_status": "Lüftergeschwindigkeit % Status-GA"
|
|
77
|
+
"fn_fanspeed_status": "Lüftergeschwindigkeit % Status-GA",
|
|
78
|
+
"fn_lock_cmd": "Verriegeln/Entriegeln Befehls-GA",
|
|
79
|
+
"fn_lock_status": "Verriegelt/Entriegelt Status-GA"
|
|
78
80
|
},
|
|
79
81
|
"types": {
|
|
80
82
|
"onofflight": "Ein/Aus-Licht",
|
|
@@ -89,7 +91,9 @@
|
|
|
89
91
|
"contactsensor": "Kontaktsensor",
|
|
90
92
|
"windowcovering": "Rollladen / Jalousie",
|
|
91
93
|
"thermostat": "Thermostat (Heizung)",
|
|
94
|
+
"roomairconditioner": "Raumklimagerät",
|
|
92
95
|
"fan": "Ventilator / Lüftung",
|
|
96
|
+
"doorlock": "Türschloss",
|
|
93
97
|
"smokecoalarm": "Rauch-/CO-Melder",
|
|
94
98
|
"waterleakdetector": "Wasserleckmelder",
|
|
95
99
|
"airqualitysensor": "Luftqualitätssensor (CO2)",
|
|
@@ -14,14 +14,14 @@ Every message emitted by outputs 3 and 4 also contains a clone of the original i
|
|
|
14
14
|
## Commands (input)
|
|
15
15
|
Send `msg.topic`:
|
|
16
16
|
- `summary` (or empty): emit summary immediately
|
|
17
|
-
- `reset`: clear internal history, counters
|
|
17
|
+
- `reset`: clear internal history, counters, learned home memory, and every persisted chat context; AI Education remains unchanged
|
|
18
18
|
- `ask`: send a question to the configured LLM
|
|
19
19
|
- `confirm` / `cancel`: confirm or cancel pending KNX commands without calling the LLM
|
|
20
|
-
- `clear_chat`: clear
|
|
20
|
+
- `clear_chat`: clear recent turns, persistent instructions, and pending commands for the current session
|
|
21
21
|
|
|
22
22
|
For `ask`, provide the question in `msg.prompt` (preferred), `msg.payload` (string), or the common Telegram fields `msg.payload.content` / `msg.payload.text`.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Every Ask/chat session keeps its last 8 turns and up to 20 explicit long-term instructions, separated by `msg.knxAi.sessionId`, `msg.sessionId`, or a detected Telegram chat ID. Requests such as “Remember not to use the term unknown” become durable instructions. All KNX AI nodes using the same storage share this live context and reload it after Node-RED restarts from `knxultimatestorage/knxai/memory/knxai-chat-context.md`. The atomically written file is bounded to 50 sessions and 512 KB. When KNX control is enabled, wire output 3 back to the chat sender and output 4 to a KNX Ultimate node configured in **Universal mode**. With confirmation enabled, the first reply previews every write GA, DPT, and payload without emitting writes; the same session must then reply `CONFIRM`/`CANCEL` (localized equivalents are accepted) within 5 minutes. A new request replaces any older pending plan. Each confirmed command has `msg.destination`, `msg.dpt`, `msg.payload`, and `msg.event = "GroupValue_Write"`.
|
|
25
25
|
For DPT 1.xxx writes, safe AI equivalents `true`/`false`, `1`/`0`, and `on`/`off` are normalized to a real boolean before local validation and output.
|
|
26
26
|
|
|
27
27
|
### Fresh KNX reads
|
|
@@ -35,12 +35,14 @@ The **Chat adapters** tab loads its selectable mappings from `resources/KNXAICha
|
|
|
35
35
|
|
|
36
36
|
The included **windkh/node-red-contrib-telegrambot** preset follows the package's receiver/sender contract. Connect a `telegram receiver` directly to KNX AI, output 3 directly to a `telegram sender`, and—when inline confirmation buttons are required—connect a `telegram event` configured for `callback_query` to the same KNX AI input. The input mapping extracts `msg.payload.content`, `msg.payload.chatId`, and the Telegram language. The output mapping creates the required `msg.payload.chatId`, `type`, and `content`, adding `options.reply_markup` from `msg.knxAi.confirmationRequest` when writes await confirmation. The Telegram package remains a separate optional dependency.
|
|
37
37
|
|
|
38
|
+
The included **RedBot / node-red-contrib-chatbot (Telegram)** preset follows RedBot's common message contract. Connect `chatbot-telegram-receive` directly to KNX AI and output 3 directly to `chatbot-telegram-send`; no separate callback node is needed because RedBot converts inline-button postbacks into normal inbound messages. The input mapping reads `transport`, `chatId`, `type`, `content`, and the Telegram language. The output mapping preserves RedBot's `originalMessage`, `chat`, `api`, and `client` tracking data, then emits either a `message` payload or an `inline-buttons` payload containing `postback` actions for confirmation. RedBot remains a separate optional dependency.
|
|
39
|
+
|
|
38
40
|
## Proactive home intelligence and bounded memory
|
|
39
41
|
The **Proactive home & memory** subsection inside **Conversations & home** enables opt-in proactive notifications. From ETS hierarchy, names, roles and DPTs, the node builds a deterministic semantic model for covers, windows, doors, lights, temperature, climate, occupancy and alarms using Italian, English, German, French, Spanish and Chinese terms. The first proactive detector watches only reliably recognized non-command cover/window/door states. After the configured open duration and outside quiet hours, output 3 emits a localized message with `msg.knxAi.type = "proactive_notification"`. It never emits output 4 or changes KNX autonomously; a subsequent user request still uses the normal validation and confirmation workflow.
|
|
40
42
|
|
|
41
43
|
The most recent chat session is remembered as the owner, or **Primary recipient / chat ID** can set it explicitly. A synthetic `msg.inputMessage` preserves this recipient so the Telegram adapter can send an unsolicited notification. Cooldown and a maximum of three proactive messages per hour prevent flooding.
|
|
42
44
|
|
|
43
|
-
The learned reference is loaded at startup from `<userDir>/knxai/memory/knxai-home-memory
|
|
45
|
+
The shared learned reference is loaded at startup from `<userDir>/knxai/memory/knxai-home-memory.md`, rewritten atomically every 15 minutes and always hard-capped at 5 MB. It stores at most 120 significant observations, 80 aggregate habits, 80 notifications and 300 semantic ETS objects—never a raw unlimited telegram stream. Older low-priority entries are removed first. **AI Education** is limited to 16,000 characters and always comes from the node configuration: the AI can read it as authoritative guidance but cannot modify or overwrite it. When Education is present but the LLM cannot evaluate it, the candidate notification is suppressed rather than risking a contradiction.
|
|
44
46
|
|
|
45
47
|
## Practical configuration example
|
|
46
48
|
This example creates a concise assistant that notifies the owner about relevant openings but accepts that the office cover may stay open:
|
|
@@ -52,7 +54,6 @@ This example creates a concise assistant that notifies the owner about relevant
|
|
|
52
54
|
| **Notify after open** (`proactiveOpenMinutes`) | `120` | A candidate notification is considered after two hours. |
|
|
53
55
|
| **Quiet hours start / end** | `23:00` / `07:00` | No proactive message is emitted during the night. |
|
|
54
56
|
| **Repeat cooldown** (`proactiveCooldownMinutes`) | `360` | The same object cannot notify again for six hours. |
|
|
55
|
-
| **Maximum home-memory file** (`homeMemoryMaxKb`) | `256` | The per-node Markdown reference can never exceed 256 KB. |
|
|
56
57
|
|
|
57
58
|
Example for **AI Education** (`aiEducation`):
|
|
58
59
|
|
|
@@ -121,7 +122,6 @@ KNX AI automatically listens to `GroupValue_Write`, `GroupValue_Response`, and `
|
|
|
121
122
|
- **Quiet hours start / end**: Daily interval in which proactive messages are suppressed.
|
|
122
123
|
- **AI Education**: User-only, authoritative guidance read by the AI and never modified by it.
|
|
123
124
|
- **Repeat cooldown (minutes)**: Minimum interval before the same object may notify again; 360 minutes by default.
|
|
124
|
-
- **Maximum home-memory file (KB)**: Hard size limit from 64 to 1,024 KB; 256 KB by default.
|
|
125
125
|
- If disk archive is enabled, **Ask** uses the archive by default: explicit dates/ranges are honored, otherwise the assistant searches the last 24 hours plus current RAM events.
|
|
126
126
|
- **Include Node-RED project inventory**: Include the whole Node-RED project inventory in the prompt, including KNX nodes and other useful nodes such as function/change/inject/template when they contain KNX-related logic or group addresses.
|
|
127
127
|
- Relevant help, README, and example snippets are always included automatically.
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"proactiveCooldownMinutes": "Repeat cooldown (minutes)",
|
|
58
58
|
"proactiveQuietStart": "Quiet hours start",
|
|
59
59
|
"proactiveQuietEnd": "Quiet hours end",
|
|
60
|
-
"homeMemoryMaxKb": "Maximum home-memory file (KB)",
|
|
61
60
|
"aiEducation": "AI Education (user managed)",
|
|
62
61
|
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)",
|
|
63
62
|
"llmDocsLanguage": "Docs language"
|
|
@@ -97,8 +96,7 @@
|
|
|
97
96
|
"chatAdapterIntro": "Choose a mapping preset to insert its input and output code. The list is loaded from the packaged chat-adapter mappings file; the generated code remains editable.",
|
|
98
97
|
"chatAdapterCodeHelp": "Mappings run synchronously. Return msg to continue or return no value to discard it. Errors are caught and reported without stopping Node-RED.",
|
|
99
98
|
"homeIntelligenceIntro": "The node builds a multilingual semantic ETS model and can notify the chat when a reliably recognized cover, window, or door remains open. It never sends a KNX command proactively.",
|
|
100
|
-
"aiEducationHelp": "Only the user can edit this section. The AI reads it as authoritative guidance, but learned-memory updates can never overwrite it. Maximum 16,000 characters."
|
|
101
|
-
"homeMemoryLimitHelp": "The Markdown memory is rewritten atomically every 15 minutes and is always capped between 64 and 1,024 KB. Old observations are pruned before habits and semantic objects."
|
|
99
|
+
"aiEducationHelp": "Only the user can edit this section. The AI reads it as authoritative guidance, but learned-memory updates can never overwrite it. Maximum 16,000 characters."
|
|
102
100
|
},
|
|
103
101
|
"placeholder": {
|
|
104
102
|
"llmBaseUrl": "https://api.openai.com/v1/chat/completions (or your compatible endpoint)",
|
|
@@ -27,7 +27,9 @@ Changing the device type after the bridge has been paired changes the Matter end
|
|
|
27
27
|
| Tunable white light | + Color temperature command/status GA in Kelvin (DPT 7.600) |
|
|
28
28
|
| Cover / Shutter | Up/Down (DPT 1.008), Stop (DPT 1.017), Position % command/status (DPT 5.001), optional position inversion |
|
|
29
29
|
| Thermostat (heating and/or cooling) | Current temperature GA, Setpoint command/status GA (DPT 9.001). Optionally add a Cooling setpoint command/status GA to also expose a Cool mode (dual-setpoint) |
|
|
30
|
+
| Room air conditioner | One Matter device combining On/Off (DPT 1.001), current temperature and heating/cooling setpoints (DPT 9.001), and fan speed % (DPT 5.001) command/status GAs |
|
|
30
31
|
| Fan / Ventilation | Fan speed % command/status GA (DPT 5.001) |
|
|
32
|
+
| Door lock | Lock/Unlock command GA and Locked/Unlocked status GA (DPT 1.001; `true` = locked) |
|
|
31
33
|
| Sensors (temperature, humidity, light, occupancy, contact) | One status GA each |
|
|
32
34
|
| Smoke/CO alarm | Smoke alarm status GA + optional CO alarm status GA (DPT 1.005): critical notifications on the phone |
|
|
33
35
|
| Water leak detector | Leak status GA (DPT 1.005) |
|
|
@@ -45,7 +47,7 @@ These options are hidden unless they apply to the selected type. Dimmable device
|
|
|
45
47
|
|
|
46
48
|
The PIN selector is outside the editor tabs. Enabling it reveals a contextual **Flow input/output** section directly below, with copyable examples filtered to the selected device type:
|
|
47
49
|
|
|
48
|
-
- **Input**: update the Matter state from the flow, without the KNX bus: `msg.payload = { function: "onoff", value: true }` (`function` is one of `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `fanspeed`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Useful to expose flow-computed values (e.g. a virtual sensor) to Alexa & Co.
|
|
50
|
+
- **Input**: update the Matter state from the flow, without the KNX bus: `msg.payload = { function: "onoff", value: true }` (`function` is one of `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `coolingsetpoint`, `fanspeed`, `lock`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Useful to expose flow-computed values (e.g. a virtual sensor) to Alexa & Co.
|
|
49
51
|
- **Output**: every command received from a Matter controller is forwarded to the flow: `msg.topic` = device name, `msg.payload` = value, `msg.matter` = the raw command. A device without command GAs becomes a **flow-only device**.
|
|
50
52
|
|
|
51
53
|
## Notes
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
"fn_leak_ga": "Leak status GA",
|
|
75
75
|
"fn_co2_ga": "CO2 status GA (ppm, DPT 9.008)",
|
|
76
76
|
"fn_fanspeed_cmd": "Fan speed % command GA",
|
|
77
|
-
"fn_fanspeed_status": "Fan speed % status GA"
|
|
77
|
+
"fn_fanspeed_status": "Fan speed % status GA",
|
|
78
|
+
"fn_lock_cmd": "Lock/Unlock command GA",
|
|
79
|
+
"fn_lock_status": "Locked/Unlocked status GA"
|
|
78
80
|
},
|
|
79
81
|
"types": {
|
|
80
82
|
"onofflight": "On/Off light",
|
|
@@ -89,7 +91,9 @@
|
|
|
89
91
|
"contactsensor": "Contact sensor",
|
|
90
92
|
"windowcovering": "Cover / Shutter",
|
|
91
93
|
"thermostat": "Thermostat (heating)",
|
|
94
|
+
"roomairconditioner": "Room air conditioner",
|
|
92
95
|
"fan": "Fan / Ventilation",
|
|
96
|
+
"doorlock": "Door lock",
|
|
93
97
|
"smokecoalarm": "Smoke/CO alarm",
|
|
94
98
|
"waterleakdetector": "Water leak detector",
|
|
95
99
|
"airqualitysensor": "Air quality sensor (CO2)",
|
|
@@ -14,14 +14,14 @@ Cada mensaje emitido por las salidas 3 y 4 también contiene una copia del mensa
|
|
|
14
14
|
## Comandos (entrada)
|
|
15
15
|
Envía `msg.topic`:
|
|
16
16
|
- `summary` (o vacío): emite el resumen inmediatamente
|
|
17
|
-
- `reset`: borra el historial, los contadores
|
|
17
|
+
- `reset`: borra el historial, los contadores, la memoria del hogar aprendida y todos los contextos de chat persistentes; la Educación de la IA permanece sin cambios
|
|
18
18
|
- `ask`: envía una pregunta al LLM configurado
|
|
19
19
|
- `confirm` / `cancel`: confirma o cancela los comandos KNX pendientes sin volver a llamar al LLM
|
|
20
|
-
- `clear_chat`: borra
|
|
20
|
+
- `clear_chat`: borra los turnos recientes, las instrucciones persistentes y los comandos pendientes de la sesión actual
|
|
21
21
|
|
|
22
22
|
Para `ask`, envía la pregunta en `msg.prompt` (recomendado), `msg.payload` (string), o los campos comunes de Telegram `msg.payload.content` / `msg.payload.text`.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Cada sesión Ask/chat conserva sus últimos 8 turnos y hasta 20 instrucciones explícitas a largo plazo, separadas por `msg.knxAi.sessionId`, `msg.sessionId` o el ID de chat Telegram detectado. Solicitudes como «Recuerda no usar el término unknown» se convierten en instrucciones persistentes. Todos los nodos KNX AI que usan el mismo almacenamiento comparten este contexto en tiempo real y lo recargan tras reiniciar Node-RED desde `knxultimatestorage/knxai/memory/knxai-chat-context.md`. El archivo se escribe de forma atómica y está limitado a 50 sesiones y 512 KB. Cuando el control KNX está habilitado, conecta la salida 3 al nodo emisor del chat y la salida 4 a un nodo KNX Ultimate en **modo universal**. Con la confirmación activa, la primera respuesta muestra GA, DPT y payload sin emitir escrituras; la misma sesión debe responder `CONFIRMAR` o `CANCELAR` en 5 minutos. Una solicitud nueva sustituye cualquier plan anterior. Cada comando confirmado contiene `msg.destination`, `msg.dpt`, `msg.payload` y `msg.event = "GroupValue_Write"`.
|
|
25
25
|
Para las escrituras DPT 1.xxx, los equivalentes seguros producidos por la IA `true`/`false`, `1`/`0` y `on`/`off` se normalizan a booleanos reales antes de la validación local y la salida.
|
|
26
26
|
|
|
27
27
|
### Lecturas KNX actualizadas
|
|
@@ -35,12 +35,14 @@ La pestaña **Adaptadores de chat** carga sus mapeos seleccionables desde `resou
|
|
|
35
35
|
|
|
36
36
|
El preajuste incluido **windkh/node-red-contrib-telegrambot** sigue el contrato receiver/sender del paquete. Conecta directamente un `telegram receiver` a KNX AI y la salida 3 a un `telegram sender`. Para los botones inline de confirmación, conecta también un `telegram event` configurado como `callback_query` a la misma entrada KNX AI. El mapeo de entrada extrae `msg.payload.content`, `msg.payload.chatId` y el idioma de Telegram. El mapeo de salida crea `msg.payload.chatId`, `type` y `content`, y añade `options.reply_markup` desde `msg.knxAi.confirmationRequest` cuando una escritura espera confirmación. El paquete Telegram sigue siendo una dependencia opcional separada.
|
|
37
37
|
|
|
38
|
+
El preajuste incluido **RedBot / node-red-contrib-chatbot (Telegram)** sigue el formato común de mensajes de RedBot. Conecta directamente `chatbot-telegram-receive` a KNX AI y la salida 3 a `chatbot-telegram-send`; no hace falta un nodo callback separado porque RedBot convierte los postbacks de los botones inline en mensajes de entrada normales. El mapeo de entrada lee `transport`, `chatId`, `type`, `content` y el idioma de Telegram. El mapeo de salida conserva los datos de seguimiento RedBot `originalMessage`, `chat`, `api` y `client`, y después emite un payload `message` o un payload `inline-buttons` con acciones `postback` de confirmación. RedBot sigue siendo una dependencia opcional separada.
|
|
39
|
+
|
|
38
40
|
## Inteligencia doméstica proactiva y memoria limitada
|
|
39
41
|
La subsección **Hogar proactivo y memoria** dentro de **Conversaciones y hogar** activa las notificaciones proactivas de forma opcional. A partir de la jerarquía ETS, nombres, roles y DPT, el nodo crea un modelo semántico determinista para persianas, ventanas, puertas, luces, temperatura, clima, presencia y alarmas usando términos italianos, ingleses, alemanes, franceses, españoles y chinos. El primer detector proactivo vigila únicamente estados que no sean de comando de persianas/ventanas/puertas reconocidos con suficiente fiabilidad. Tras el tiempo abierto configurado y fuera de las horas silenciosas, la salida 3 emite un mensaje localizado con `msg.knxAi.type = "proactive_notification"`. Nunca emite por la salida 4 ni modifica KNX de manera autónoma; una solicitud posterior del usuario sigue pasando por la validación y confirmación normales.
|
|
40
42
|
|
|
41
43
|
La última sesión de chat se recuerda como propietario, o **Destinatario principal / ID de chat** permite definirla explícitamente. Un `msg.inputMessage` sintético conserva el destinatario para que el adaptador de Telegram pueda enviar una notificación espontánea. El tiempo de espera y el máximo de tres notificaciones proactivas por hora evitan inundar el chat.
|
|
42
44
|
|
|
43
|
-
La referencia aprendida se carga al arrancar desde `<userDir>/knxai/memory/knxai-home-memory
|
|
45
|
+
La referencia aprendida compartida se carga al arrancar desde `<userDir>/knxai/memory/knxai-home-memory.md`, se reescribe atómicamente cada 15 minutos y siempre queda estrictamente limitada a 5 MB. Conserva como máximo 120 observaciones importantes, 80 hábitos agregados, 80 notificaciones y 300 objetos ETS semánticos, nunca un flujo ilimitado de telegramas raw. Los elementos antiguos y de menor prioridad se eliminan primero. **Educación IA** está limitada a 16.000 caracteres y siempre procede de la configuración del nodo: la IA puede leerla como instrucción autoritativa, pero no modificarla ni sobrescribirla. Si existe Educación pero el LLM no puede evaluarla, la notificación candidata se suprime en lugar de arriesgarse a contradecirla.
|
|
44
46
|
|
|
45
47
|
## Ejemplo práctico de configuración
|
|
46
48
|
Este ejemplo crea un asistente conciso que avisa sobre aperturas importantes, pero acepta que la persiana del despacho permanezca abierta:
|
|
@@ -52,7 +54,6 @@ Este ejemplo crea un asistente conciso que avisa sobre aperturas importantes, pe
|
|
|
52
54
|
| **Avisar después de abierta** (`proactiveOpenMinutes`) | `120` | Se evalúa una posible notificación después de dos horas. |
|
|
53
55
|
| **Inicio / fin de horas silenciosas** | `23:00` / `07:00` | No se emiten mensajes proactivos durante la noche. |
|
|
54
56
|
| **Tiempo de espera de repetición** (`proactiveCooldownMinutes`) | `360` | El mismo objeto no vuelve a avisar durante seis horas. |
|
|
55
|
-
| **Archivo máximo de memoria del hogar** (`homeMemoryMaxKb`) | `256` | La referencia Markdown de este nodo permanece por debajo de 256 KB. |
|
|
56
57
|
|
|
57
58
|
Ejemplo para **Educación IA** (`aiEducation`):
|
|
58
59
|
|
|
@@ -116,7 +117,6 @@ KNX AI escucha automáticamente los telegramas `GroupValue_Write`, `GroupValue_R
|
|
|
116
117
|
- **Inicio / fin de horas silenciosas**: intervalo diario en el que se suprimen los mensajes proactivos.
|
|
117
118
|
- **Educación de la IA**: instrucciones vinculantes gestionadas solo por el usuario, leídas por la IA y nunca modificadas.
|
|
118
119
|
- **Tiempo de espera de repetición (minutos)**: intervalo mínimo antes de que el mismo objeto pueda volver a avisar; 360 minutos por defecto.
|
|
119
|
-
- **Archivo máximo de memoria del hogar (KB)**: límite estricto de 64 a 1.024 KB; 256 KB por defecto.
|
|
120
120
|
- Si el archivo en disco esta activo, **Ask** lo usa por defecto: respeta fechas/rangos explicitos y, si no los indicas, busca en las ultimas 24 horas mas los eventos actuales en RAM.
|
|
121
121
|
- **Incluir inventario del proyecto Node-RED**: incluye en el prompt el inventario de todo el proyecto Node-RED, con nodos KNX y otros nodos utiles como function/change/inject/template cuando contienen logica KNX o direcciones de grupo.
|
|
122
122
|
- Los fragmentos pertinentes de la ayuda, README y ejemplos se incluyen siempre de forma automática.
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"proactiveCooldownMinutes": "Espera antes de repetir (minutos)",
|
|
58
58
|
"proactiveQuietStart": "Inicio de horas silenciosas",
|
|
59
59
|
"proactiveQuietEnd": "Fin de horas silenciosas",
|
|
60
|
-
"homeMemoryMaxKb": "Tamaño máximo de memoria del hogar (KB)",
|
|
61
60
|
"aiEducation": "Educación IA (gestionada por el usuario)",
|
|
62
61
|
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)",
|
|
63
62
|
"llmDocsLanguage": "Docs language"
|
|
@@ -89,8 +88,7 @@
|
|
|
89
88
|
"chatAdapterIntro": "Elige un preajuste para insertar su código de mapeo de entrada y salida. La lista se carga desde el archivo de adaptadores de chat incluido; el código generado sigue siendo editable.",
|
|
90
89
|
"chatAdapterCodeHelp": "Los mapeos se ejecutan de forma síncrona. Devuelve msg para continuar o ningún valor para descartarlo. Los errores se capturan y notifican sin detener Node-RED.",
|
|
91
90
|
"homeIntelligenceIntro": "El nodo crea un modelo ETS semántico multilingüe y puede avisar al chat cuando una persiana, ventana o puerta reconocida con suficiente fiabilidad permanece abierta. Nunca envía por sí solo un comando KNX.",
|
|
92
|
-
"aiEducationHelp": "Solo el usuario puede editar esta sección. La IA la lee como una instrucción autoritativa, pero la memoria aprendida nunca puede sobrescribirla. Máximo 16.000 caracteres."
|
|
93
|
-
"homeMemoryLimitHelp": "La memoria Markdown se reescribe atómicamente cada 15 minutos y siempre queda limitada entre 64 y 1.024 KB. Las observaciones antiguas se eliminan antes que los hábitos y los objetos semánticos."
|
|
91
|
+
"aiEducationHelp": "Solo el usuario puede editar esta sección. La IA la lee como una instrucción autoritativa, pero la memoria aprendida nunca puede sobrescribirla. Máximo 16.000 caracteres."
|
|
94
92
|
},
|
|
95
93
|
"placeholder": {
|
|
96
94
|
"llmBaseUrl": "https://api.openai.com/v1/chat/completions (or your compatible endpoint)",
|
|
@@ -27,7 +27,9 @@ Cambiar el tipo de dispositivo después de emparejar el bridge modifica la estru
|
|
|
27
27
|
| Luz blanco dinámico | + GA comando/estado temperatura de color en Kelvin (DPT 7.600) |
|
|
28
28
|
| Persiana / Cortina | Subir/Bajar (DPT 1.008), Stop (DPT 1.017), posición % comando/estado (DPT 5.001), inversión de posición opcional |
|
|
29
29
|
| Termostato (calefacción y/o refrigeración) | GA temperatura actual, GA comando/estado consigna (DPT 9.001). Añadiendo también la GA comando/estado consigna de refrigeración se expone también el modo Cool (doble consigna) |
|
|
30
|
+
| Aire acondicionado de habitación | Un dispositivo Matter combina GA comando/estado On/Off (DPT 1.001), temperatura actual y consignas de calefacción/refrigeración (DPT 9.001), y velocidad del ventilador % (DPT 5.001) |
|
|
30
31
|
| Ventilador / VMC | GA comando/estado velocidad % (DPT 5.001) |
|
|
32
|
+
| Cerradura de puerta | GA comando bloqueo/desbloqueo y GA estado bloqueado/desbloqueado (DPT 1.001; `true` = bloqueada) |
|
|
31
33
|
| Sensores (temperatura, humedad, luz, presencia, contacto) | Una GA de estado cada uno |
|
|
32
34
|
| Alarma humo/CO | GA estado alarma de humo + GA estado alarma CO opcional (DPT 1.005): notificaciones críticas en el teléfono |
|
|
33
35
|
| Detector de fugas de agua | GA estado fuga (DPT 1.005) |
|
|
@@ -45,7 +47,7 @@ Estas opciones solo aparecen cuando tienen sentido para el tipo seleccionado. Lo
|
|
|
45
47
|
|
|
46
48
|
El selector de PINes está fuera de las pestañas del editor. Al activarlo aparece justo debajo una sección contextual **Entrada/salida del flow**, con ejemplos copiables filtrados según el tipo de dispositivo:
|
|
47
49
|
|
|
48
|
-
- **Entrada**: actualiza el estado Matter desde el flow, sin pasar por el bus KNX: `msg.payload = { function: "onoff", value: true }` (`function` es una de `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `fanspeed`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Útil para exponer a Alexa y cía. valores calculados en el flow (p.ej. un sensor virtual).
|
|
50
|
+
- **Entrada**: actualiza el estado Matter desde el flow, sin pasar por el bus KNX: `msg.payload = { function: "onoff", value: true }` (`function` es una de `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `coolingsetpoint`, `fanspeed`, `lock`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Útil para exponer a Alexa y cía. valores calculados en el flow (p.ej. un sensor virtual).
|
|
49
51
|
- **Salida**: cada comando recibido de un controlador Matter se reenvía al flow: `msg.topic` = nombre del dispositivo, `msg.payload` = valor, `msg.matter` = el comando en bruto. Un dispositivo sin GA de comando se convierte en un **dispositivo solo-flow**.
|
|
50
52
|
|
|
51
53
|
## Notas
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
"fn_leak_ga": "GA estado fuga de agua",
|
|
75
75
|
"fn_co2_ga": "GA estado CO2 (ppm, DPT 9.008)",
|
|
76
76
|
"fn_fanspeed_cmd": "GA comando velocidad ventilador %",
|
|
77
|
-
"fn_fanspeed_status": "GA estado velocidad ventilador %"
|
|
77
|
+
"fn_fanspeed_status": "GA estado velocidad ventilador %",
|
|
78
|
+
"fn_lock_cmd": "GA comando bloqueo/desbloqueo",
|
|
79
|
+
"fn_lock_status": "GA estado bloqueado/desbloqueado"
|
|
78
80
|
},
|
|
79
81
|
"types": {
|
|
80
82
|
"onofflight": "Luz On/Off",
|
|
@@ -89,7 +91,9 @@
|
|
|
89
91
|
"contactsensor": "Sensor de contacto",
|
|
90
92
|
"windowcovering": "Persiana / Cortina",
|
|
91
93
|
"thermostat": "Termostato (calefacción)",
|
|
94
|
+
"roomairconditioner": "Aire acondicionado de habitación",
|
|
92
95
|
"fan": "Ventilador / VMC",
|
|
96
|
+
"doorlock": "Cerradura de puerta",
|
|
93
97
|
"smokecoalarm": "Alarma humo/CO",
|
|
94
98
|
"waterleakdetector": "Detector de fugas de agua",
|
|
95
99
|
"airqualitysensor": "Sensor de calidad del aire (CO2)",
|
|
@@ -14,14 +14,14 @@ Chaque message émis par les sorties 3 et 4 contient également une copie du mes
|
|
|
14
14
|
## Commandes (entrée)
|
|
15
15
|
Envoyez `msg.topic` :
|
|
16
16
|
- `summary` (ou vide) : envoie le résumé immédiatement
|
|
17
|
-
- `reset` : efface l'historique, les compteurs
|
|
17
|
+
- `reset` : efface l'historique, les compteurs, la mémoire domestique apprise et tous les contextes de chat persistants ; l'Éducation de l'IA reste inchangée
|
|
18
18
|
- `ask` : envoie une question au LLM configuré
|
|
19
19
|
- `confirm` / `cancel` : confirme ou annule les commandes KNX en attente sans rappeler le LLM
|
|
20
|
-
- `clear_chat` : efface
|
|
20
|
+
- `clear_chat` : efface les échanges récents, les instructions persistantes et les commandes en attente de la session courante
|
|
21
21
|
|
|
22
22
|
Pour `ask`, mettez la question dans `msg.prompt` (recommandé), `msg.payload` (chaîne), ou les champs Telegram courants `msg.payload.content` / `msg.payload.text`.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Chaque session Ask/chat conserve ses 8 derniers échanges et jusqu'à 20 instructions explicites à long terme, séparées par `msg.knxAi.sessionId`, `msg.sessionId` ou l’ID de chat Telegram détecté. Les demandes telles que « Souviens-toi de ne pas employer le terme unknown » deviennent des instructions persistantes. Tous les nœuds KNX AI utilisant le même stockage partagent ce contexte en direct et le rechargent après un redémarrage de Node-RED depuis `knxultimatestorage/knxai/memory/knxai-chat-context.md`. Le fichier, écrit de façon atomique, est limité à 50 sessions et 512 Ko. Lorsque le contrôle KNX est activé, reliez la sortie 3 au nœud d'envoi du chat et la sortie 4 à un nœud KNX Ultimate en **mode universel**. Avec la confirmation active, la première réponse affiche GA, DPT et payload sans émettre d’écriture ; la même session doit répondre `CONFIRMER` ou `ANNULER` dans les 5 minutes. Une nouvelle demande remplace tout plan précédent. Chaque commande confirmée contient `msg.destination`, `msg.dpt`, `msg.payload` et `msg.event = "GroupValue_Write"`.
|
|
25
25
|
Pour les écritures DPT 1.xxx, les équivalents sûrs produits par l’IA `true`/`false`, `1`/`0` et `on`/`off` sont normalisés en véritables booléens avant la validation locale et la sortie.
|
|
26
26
|
|
|
27
27
|
### Lectures KNX actualisées
|
|
@@ -35,12 +35,14 @@ L’onglet **Adaptateurs de chat** charge ses mappages sélectionnables depuis `
|
|
|
35
35
|
|
|
36
36
|
Le préréglage inclus **windkh/node-red-contrib-telegrambot** suit le contrat receiver/sender du paquet. Connectez directement un `telegram receiver` à KNX AI et la sortie 3 à un `telegram sender`. Pour les boutons de confirmation inline, connectez aussi un `telegram event` configuré pour `callback_query` à la même entrée KNX AI. Le mappage d’entrée extrait `msg.payload.content`, `msg.payload.chatId` et la langue Telegram. Le mappage de sortie crée `msg.payload.chatId`, `type` et `content`, puis ajoute `options.reply_markup` depuis `msg.knxAi.confirmationRequest` lorsqu’une écriture attend confirmation. Le paquet Telegram reste une dépendance optionnelle distincte.
|
|
37
37
|
|
|
38
|
+
Le préréglage inclus **RedBot / node-red-contrib-chatbot (Telegram)** suit le format de message commun de RedBot. Connectez directement `chatbot-telegram-receive` à KNX AI et la sortie 3 à `chatbot-telegram-send` ; aucun nœud de callback séparé n’est nécessaire, car RedBot convertit les postbacks des boutons inline en messages entrants ordinaires. Le mappage d’entrée lit `transport`, `chatId`, `type`, `content` et la langue Telegram. Le mappage de sortie conserve les données de suivi RedBot `originalMessage`, `chat`, `api` et `client`, puis émet soit un payload `message`, soit un payload `inline-buttons` avec des actions `postback` de confirmation. RedBot reste une dépendance optionnelle distincte.
|
|
39
|
+
|
|
38
40
|
## Intelligence domestique proactive et mémoire limitée
|
|
39
41
|
La sous-section **Maison proactive et mémoire** de **Conversations et maison** active les notifications proactives sur choix de l’utilisateur. À partir de la hiérarchie ETS, des noms, rôles et DPT, le nœud crée un modèle sémantique déterministe pour les volets, fenêtres, portes, éclairages, températures, climat, présence et alarmes avec des termes italiens, anglais, allemands, français, espagnols et chinois. Le premier détecteur proactif surveille uniquement les états hors commande de volets/fenêtres/portes reconnus avec une fiabilité suffisante. Après la durée d’ouverture configurée et hors heures silencieuses, la sortie 3 émet un message localisé avec `msg.knxAi.type = "proactive_notification"`. Il n’émet jamais sur la sortie 4 et ne modifie jamais KNX de façon autonome ; une demande ultérieure de l’utilisateur passe toujours par la validation et la confirmation normales.
|
|
40
42
|
|
|
41
43
|
La dernière session de chat est mémorisée comme propriétaire, ou **Destinataire principal / ID de chat** permet de la définir explicitement. Un `msg.inputMessage` synthétique conserve le destinataire afin que l’adaptateur Telegram puisse envoyer une notification spontanée. Le délai de répétition et la limite de trois notifications proactives par heure évitent les rafales.
|
|
42
44
|
|
|
43
|
-
La référence apprise est chargée au démarrage depuis `<userDir>/knxai/memory/knxai-home-memory
|
|
45
|
+
La référence apprise partagée est chargée au démarrage depuis `<userDir>/knxai/memory/knxai-home-memory.md`, réécrite atomiquement toutes les 15 minutes et toujours strictement limitée à 5 Mo. Elle conserve au maximum 120 observations importantes, 80 habitudes agrégées, 80 notifications et 300 objets ETS sémantiques, jamais un flux illimité de télégrammes bruts. Les éléments anciens et moins prioritaires sont supprimés en premier. **Éducation IA** est limitée à 16 000 caractères et provient toujours de la configuration du nœud : l’IA peut la lire comme une consigne faisant autorité, mais ne peut ni la modifier ni l’écraser. Si cette Éducation est présente mais que le LLM ne peut pas l’évaluer, la notification candidate est supprimée plutôt que de risquer de la contredire.
|
|
44
46
|
|
|
45
47
|
## Exemple pratique de configuration
|
|
46
48
|
Cet exemple crée un assistant concis qui signale les ouvertures importantes, tout en acceptant que le volet du bureau reste ouvert :
|
|
@@ -52,7 +54,6 @@ Cet exemple crée un assistant concis qui signale les ouvertures importantes, to
|
|
|
52
54
|
| **Notifier après ouverture** (`proactiveOpenMinutes`) | `120` | Une notification potentielle est évaluée après deux heures. |
|
|
53
55
|
| **Début / fin des heures silencieuses** | `23:00` / `07:00` | Aucun message proactif n’est émis pendant la nuit. |
|
|
54
56
|
| **Délai de répétition** (`proactiveCooldownMinutes`) | `360` | Le même objet ne peut pas notifier à nouveau pendant six heures. |
|
|
55
|
-
| **Taille maximale du fichier mémoire** (`homeMemoryMaxKb`) | `256` | La référence Markdown de ce nœud reste sous 256 Ko. |
|
|
56
57
|
|
|
57
58
|
Exemple pour **Éducation IA** (`aiEducation`) :
|
|
58
59
|
|
|
@@ -116,7 +117,6 @@ KNX AI écoute automatiquement les télégrammes `GroupValue_Write`, `GroupValue
|
|
|
116
117
|
- **Début / fin des heures silencieuses** : intervalle quotidien pendant lequel les messages proactifs sont supprimés.
|
|
117
118
|
- **Éducation de l’IA** : consignes autoritaires gérées uniquement par l'utilisateur, lues par l'IA et jamais modifiées.
|
|
118
119
|
- **Délai de répétition (minutes)** : intervalle minimal avant qu'un même objet puisse notifier à nouveau ; 360 minutes par défaut.
|
|
119
|
-
- **Taille maximale du fichier mémoire domestique (KB)** : limite stricte de 64 à 1 024 KB ; 256 KB par défaut.
|
|
120
120
|
- Si l'archive disque est active, **Ask** l'utilise par défaut : les dates/plages explicites sont respectées, sinon l'assistant cherche sur les dernières 24 heures plus les événements RAM courants.
|
|
121
121
|
- **Inclure l'inventaire du projet Node-RED** : inclut dans le prompt l'inventaire de tout le projet Node-RED, avec les nœuds KNX et d'autres nœuds utiles comme function/change/inject/template lorsqu'ils contiennent de la logique KNX ou des adresses de groupe.
|
|
122
122
|
- Les extraits pertinents de l’aide, du README et des exemples sont toujours inclus automatiquement.
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"proactiveCooldownMinutes": "Délai avant répétition (minutes)",
|
|
58
58
|
"proactiveQuietStart": "Début des heures silencieuses",
|
|
59
59
|
"proactiveQuietEnd": "Fin des heures silencieuses",
|
|
60
|
-
"homeMemoryMaxKb": "Taille maximale de la mémoire maison (Ko)",
|
|
61
60
|
"aiEducation": "Éducation IA (gérée par l'utilisateur)",
|
|
62
61
|
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)",
|
|
63
62
|
"llmDocsLanguage": "Docs language"
|
|
@@ -89,8 +88,7 @@
|
|
|
89
88
|
"chatAdapterIntro": "Choisissez un préréglage pour insérer son code de mappage d’entrée et de sortie. La liste est chargée depuis le fichier d’adaptateurs de chat fourni ; le code généré reste modifiable.",
|
|
90
89
|
"chatAdapterCodeHelp": "Les mappages s’exécutent de façon synchrone. Renvoyez msg pour continuer ou aucune valeur pour l’écarter. Les erreurs sont interceptées et signalées sans arrêter Node-RED.",
|
|
91
90
|
"homeIntelligenceIntro": "Le nœud crée un modèle ETS sémantique multilingue et peut avertir le chat lorsqu'un volet, une fenêtre ou une porte reconnu avec suffisamment de fiabilité reste ouvert. Il n'envoie jamais de commande KNX de manière autonome.",
|
|
92
|
-
"aiEducationHelp": "Seul l'utilisateur peut modifier cette section. L'IA la lit comme une consigne faisant autorité, mais la mémoire apprise ne peut jamais l'écraser. Maximum 16 000 caractères."
|
|
93
|
-
"homeMemoryLimitHelp": "La mémoire Markdown est réécrite atomiquement toutes les 15 minutes et reste toujours limitée entre 64 et 1 024 Ko. Les anciennes observations sont supprimées avant les habitudes et les objets sémantiques."
|
|
91
|
+
"aiEducationHelp": "Seul l'utilisateur peut modifier cette section. L'IA la lit comme une consigne faisant autorité, mais la mémoire apprise ne peut jamais l'écraser. Maximum 16 000 caractères."
|
|
94
92
|
},
|
|
95
93
|
"placeholder": {
|
|
96
94
|
"llmBaseUrl": "https://api.openai.com/v1/chat/completions (or your compatible endpoint)",
|
|
@@ -27,7 +27,9 @@ Changer le type d'appareil après l'appairage du bridge modifie la structure de
|
|
|
27
27
|
| Lumière blanc dynamique | + GA commande/état température de couleur en Kelvin (DPT 7.600) |
|
|
28
28
|
| Volet / Store | Monter/Descendre (DPT 1.008), Stop (DPT 1.017), position % commande/état (DPT 5.001), inversion de position optionnelle |
|
|
29
29
|
| Thermostat (chauffage et/ou rafraîchissement) | GA température actuelle, GA commande/état consigne (DPT 9.001). En ajoutant aussi la GA commande/état consigne rafraîchissement, le mode Cool (double consigne) est également exposé |
|
|
30
|
+
| Climatiseur individuel | Un appareil Matter combine les GA commande/état On/Off (DPT 1.001), température actuelle et consignes chauffage/rafraîchissement (DPT 9.001), et vitesse ventilateur % (DPT 5.001) |
|
|
30
31
|
| Ventilateur / VMC | GA commande/état vitesse % (DPT 5.001) |
|
|
32
|
+
| Serrure de porte | GA commande verrouillage/déverrouillage et GA état verrouillé/déverrouillé (DPT 1.001 ; `true` = verrouillée) |
|
|
31
33
|
| Capteurs (température, humidité, lumière, présence, contact) | Une GA d'état chacun |
|
|
32
34
|
| Détecteur fumée/CO | GA état alarme fumée + GA état alarme CO optionnelle (DPT 1.005) : notifications critiques sur le téléphone |
|
|
33
35
|
| Détecteur de fuite d'eau | GA état fuite (DPT 1.005) |
|
|
@@ -45,7 +47,7 @@ Ces options ne s'affichent que lorsqu'elles s'appliquent au type sélectionné.
|
|
|
45
47
|
|
|
46
48
|
Le sélecteur de PIN se trouve hors des onglets de l'éditeur. Son activation affiche juste dessous une section contextuelle **Entrée/sortie du flow**, avec des exemples copiables filtrés selon le type d'appareil :
|
|
47
49
|
|
|
48
|
-
- **Entrée** : mettez à jour l'état Matter depuis le flux, sans passer par le bus KNX : `msg.payload = { function: "onoff", value: true }` (`function` est l'une de `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `fanspeed`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Utile pour exposer à Alexa & Co. des valeurs calculées dans le flux (ex. un capteur virtuel).
|
|
50
|
+
- **Entrée** : mettez à jour l'état Matter depuis le flux, sans passer par le bus KNX : `msg.payload = { function: "onoff", value: true }` (`function` est l'une de `onoff`, `level`, `rgb`, `colortemp`, `position`, `temperature`, `humidity`, `illuminance`, `occupancy`, `contact`, `currenttemp`, `setpoint`, `coolingsetpoint`, `fanspeed`, `lock`, `smoke`, `co`, `leak`, `co2`, `rvcstate`, `rvcmode`). Utile pour exposer à Alexa & Co. des valeurs calculées dans le flux (ex. un capteur virtuel).
|
|
49
51
|
- **Sortie** : chaque commande reçue d'un contrôleur Matter est transmise au flux : `msg.topic` = nom de l'appareil, `msg.payload` = valeur, `msg.matter` = la commande brute. Un appareil sans GA de commande devient un **appareil flow uniquement**.
|
|
50
52
|
|
|
51
53
|
## Notes
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
"fn_leak_ga": "GA état fuite d'eau",
|
|
75
75
|
"fn_co2_ga": "GA état CO2 (ppm, DPT 9.008)",
|
|
76
76
|
"fn_fanspeed_cmd": "GA commande vitesse ventilateur %",
|
|
77
|
-
"fn_fanspeed_status": "GA état vitesse ventilateur %"
|
|
77
|
+
"fn_fanspeed_status": "GA état vitesse ventilateur %",
|
|
78
|
+
"fn_lock_cmd": "GA commande verrouillage/déverrouillage",
|
|
79
|
+
"fn_lock_status": "GA état verrouillé/déverrouillé"
|
|
78
80
|
},
|
|
79
81
|
"types": {
|
|
80
82
|
"onofflight": "Lumière On/Off",
|
|
@@ -89,7 +91,9 @@
|
|
|
89
91
|
"contactsensor": "Capteur de contact",
|
|
90
92
|
"windowcovering": "Volet / Store",
|
|
91
93
|
"thermostat": "Thermostat (chauffage)",
|
|
94
|
+
"roomairconditioner": "Climatiseur individuel",
|
|
92
95
|
"fan": "Ventilateur / VMC",
|
|
96
|
+
"doorlock": "Serrure de porte",
|
|
93
97
|
"smokecoalarm": "Détecteur fumée/CO",
|
|
94
98
|
"waterleakdetector": "Détecteur de fuite d'eau",
|
|
95
99
|
"airqualitysensor": "Capteur de qualité d'air (CO2)",
|
|
@@ -14,14 +14,14 @@ Ogni messaggio emesso dalle uscite 3 e 4 contiene anche una copia del messaggio
|
|
|
14
14
|
## Comandi (input)
|
|
15
15
|
Invia `msg.topic`:
|
|
16
16
|
- `summary` (o vuoto): emette subito la summary
|
|
17
|
-
- `reset`: azzera storico, contatori
|
|
17
|
+
- `reset`: azzera storico, contatori, memoria domestica appresa e tutti i context CHAT persistenti; Educazione AI resta invariata
|
|
18
18
|
- `ask`: invia una domanda all'LLM configurato
|
|
19
19
|
- `confirm` / `cancel`: conferma o annulla i comandi KNX in attesa senza richiamare l'LLM
|
|
20
|
-
- `clear_chat`: azzera
|
|
20
|
+
- `clear_chat`: azzera turni recenti, istruzioni persistenti e comandi in attesa per la sessione corrente
|
|
21
21
|
|
|
22
22
|
Per `ask`, passa la domanda in `msg.prompt` (consigliato), in `msg.payload` (stringa), oppure nei comuni campi Telegram `msg.payload.content` / `msg.payload.text`.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Ogni sessione Ask/chat conserva gli ultimi 8 turni e fino a 20 istruzioni esplicite a lungo termine, separate per `msg.knxAi.sessionId`, `msg.sessionId` o chat ID Telegram rilevato. Richieste come «Ricordati di non usare il termine unknown» diventano istruzioni persistenti. Tutti i nodi KNX AI che usano lo stesso storage condividono questo context in tempo reale e lo ricaricano dopo un riavvio di Node-RED da `knxultimatestorage/knxai/memory/knxai-chat-context.md`. Il file, scritto atomicamente, è limitato a 50 sessioni e 512 KB. Quando il controllo KNX è abilitato, collega l'uscita 3 al nodo di risposta della chat e l'uscita 4 a un nodo KNX Ultimate configurato in **Modalità Universale**. Con la conferma attiva, la prima risposta mostra GA, DPT e payload delle scritture senza emetterle; la stessa sessione deve poi rispondere `CONFERMA`/`ANNULLA` entro 5 minuti. Una nuova richiesta sostituisce l'eventuale piano precedente. Ogni comando confermato contiene `msg.destination`, `msg.dpt`, `msg.payload` e `msg.event = "GroupValue_Write"`.
|
|
25
25
|
Per le scritture DPT 1.xxx, gli equivalenti sicuri prodotti dall'AI `true`/`false`, `1`/`0` e `on`/`off` vengono normalizzati in un vero booleano prima della validazione locale e dell'uscita.
|
|
26
26
|
|
|
27
27
|
### Letture KNX aggiornate
|
|
@@ -35,12 +35,14 @@ La tab **Adattatori chat** carica le mappature selezionabili da `resources/KNXAI
|
|
|
35
35
|
|
|
36
36
|
Il preset incluso **windkh/node-red-contrib-telegrambot** segue il contratto receiver/sender del pacchetto. Collega direttamente un `telegram receiver` a KNX AI e l'uscita 3 direttamente a un `telegram sender`; per usare i pulsanti inline di conferma, collega allo stesso ingresso KNX AI anche un `telegram event` configurato come `callback_query`. La mappatura d'ingresso estrae `msg.payload.content`, `msg.payload.chatId` e la lingua Telegram. Quella d'uscita crea i campi richiesti `msg.payload.chatId`, `type` e `content`, aggiungendo `options.reply_markup` da `msg.knxAi.confirmationRequest` quando una scrittura attende conferma. Il pacchetto Telegram resta una dipendenza opzionale separata.
|
|
37
37
|
|
|
38
|
+
Il preset incluso **RedBot / node-red-contrib-chatbot (Telegram)** segue il formato comune dei messaggi RedBot. Collega direttamente `chatbot-telegram-receive` a KNX AI e l'uscita 3 direttamente a `chatbot-telegram-send`; non serve un nodo callback separato perché RedBot converte i postback dei pulsanti inline in normali messaggi in ingresso. La mappatura d'ingresso legge `transport`, `chatId`, `type`, `content` e la lingua Telegram. Quella d'uscita conserva i dati di tracciamento RedBot `originalMessage`, `chat`, `api` e `client`, quindi emette un payload `message` oppure un payload `inline-buttons` con azioni `postback` per la conferma. RedBot resta una dipendenza opzionale separata.
|
|
39
|
+
|
|
38
40
|
## Intelligenza domestica proattiva e memoria limitata
|
|
39
41
|
La sottosezione **Casa proattiva e memoria** dentro **Conversazioni e casa** abilita le notifiche proattive su scelta dell'utente. Da gerarchia ETS, nomi, ruoli e DPT, il nodo crea un modello semantico deterministico per persiane, finestre, porte, luci, temperatura, clima, presenza e allarmi usando termini italiani, inglesi, tedeschi, francesi, spagnoli e cinesi. Il primo rilevatore proattivo osserva soltanto stati non di comando di persiane/finestre/porte riconosciuti con sufficiente affidabilità. Dopo il tempo di apertura configurato e fuori dalle ore silenziose, l'uscita 3 emette un messaggio localizzato con `msg.knxAi.type = "proactive_notification"`. Non emette mai l'uscita 4 e non modifica autonomamente KNX; un'eventuale richiesta successiva dell'utente passa sempre dalla normale validazione e conferma.
|
|
40
42
|
|
|
41
43
|
L'ultima sessione chat viene ricordata come proprietario, oppure **Destinatario principale / chat ID** consente di impostarla esplicitamente. Un `msg.inputMessage` sintetico conserva il destinatario affinché l'adattatore Telegram possa inviare una notifica spontanea. Il cooldown e il limite di tre notifiche proattive all'ora evitano messaggi ripetuti.
|
|
42
44
|
|
|
43
|
-
Il riferimento appreso viene caricato all'avvio da `<userDir>/knxai/memory/knxai-home-memory
|
|
45
|
+
Il riferimento appreso condiviso viene caricato all'avvio da `<userDir>/knxai/memory/knxai-home-memory.md`, riscritto atomicamente ogni 15 minuti e sempre limitato rigidamente a 5 MB. Conserva al massimo 120 osservazioni significative, 80 abitudini aggregate, 80 notifiche e 300 oggetti ETS semantici, mai un flusso illimitato di telegrammi raw. Gli elementi vecchi e meno importanti vengono eliminati per primi. **Educazione AI** è limitata a 16.000 caratteri e proviene sempre dalla configurazione del nodo: l'AI può leggerla come istruzione autorevole, ma non può modificarla o sovrascriverla. Se l'Educazione è presente ma l'LLM non riesce a valutarla, la notifica candidata viene soppressa invece di rischiare di contraddirla.
|
|
44
46
|
|
|
45
47
|
## Esempio pratico di configurazione
|
|
46
48
|
Questo esempio crea un assistente conciso che avvisa il proprietario delle aperture importanti, ma accetta che la persiana dello studio possa rimanere aperta:
|
|
@@ -52,7 +54,6 @@ Questo esempio crea un assistente conciso che avvisa il proprietario delle apert
|
|
|
52
54
|
| **Avvisa dopo apertura** (`proactiveOpenMinutes`) | `120` | Dopo due ore viene valutata una possibile notifica. |
|
|
53
55
|
| **Inizio / fine ore silenziose** | `23:00` / `07:00` | Durante la notte non vengono emessi messaggi proattivi. |
|
|
54
56
|
| **Intervallo prima di ripetere** (`proactiveCooldownMinutes`) | `360` | Lo stesso oggetto non può generare un altro avviso per sei ore. |
|
|
55
|
-
| **Dimensione massima memoria casa** (`homeMemoryMaxKb`) | `256` | Il riferimento Markdown del singolo nodo non può superare 256 KB. |
|
|
56
57
|
|
|
57
58
|
Esempio per **Educazione AI** (`aiEducation`):
|
|
58
59
|
|
|
@@ -121,7 +122,6 @@ KNX AI ascolta automaticamente i telegrammi `GroupValue_Write`, `GroupValue_Resp
|
|
|
121
122
|
- **Inizio / fine ore silenziose**: intervallo giornaliero in cui i messaggi proattivi sono sospesi.
|
|
122
123
|
- **Educazione AI**: istruzioni autorevoli gestite soltanto dall'utente, lette dall'AI e mai modificate.
|
|
123
124
|
- **Cooldown ripetizione (minuti)**: intervallo minimo prima che lo stesso oggetto possa generare un altro avviso; 360 minuti per default.
|
|
124
|
-
- **Dimensione massima memoria domestica (KB)**: limite rigido da 64 a 1.024 KB; 256 KB per default.
|
|
125
125
|
- Se l'archivio su disco e' attivo, **Ask** lo usa di default: rispetta date/intervalli espliciti e, se non presenti, cerca nelle ultime 24 ore piu' gli eventi correnti in RAM.
|
|
126
126
|
- **Includi inventario del progetto Node-RED**: include nel prompt l'inventario dell'intero progetto Node-RED, compresi nodi KNX e altri nodi utili come function/change/inject/template quando contengono logica KNX o group address.
|
|
127
127
|
- Gli estratti pertinenti di help, README ed esempi vengono sempre inclusi automaticamente.
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"proactiveCooldownMinutes": "Intervallo prima di ripetere (minuti)",
|
|
58
58
|
"proactiveQuietStart": "Inizio ore silenziose",
|
|
59
59
|
"proactiveQuietEnd": "Fine ore silenziose",
|
|
60
|
-
"homeMemoryMaxKb": "Dimensione massima memoria casa (KB)",
|
|
61
60
|
"aiEducation": "Educazione AI (gestita dall'utente)",
|
|
62
61
|
"llmIncludeDocsSnippets": "Includi estratti documentazione (help/README/esempi)",
|
|
63
62
|
"llmDocsLanguage": "Lingua documentazione"
|
|
@@ -97,8 +96,7 @@
|
|
|
97
96
|
"chatAdapterIntro": "Scegli un preset per inserire il codice di mappatura in ingresso e in uscita. La lista viene caricata dal file degli adattatori chat incluso nel pacchetto; il codice generato resta modificabile.",
|
|
98
97
|
"chatAdapterCodeHelp": "Le mappature sono sincrone. Restituisci msg per continuare oppure nessun valore per scartarlo. Gli errori vengono intercettati e segnalati senza arrestare Node-RED.",
|
|
99
98
|
"homeIntelligenceIntro": "Il nodo crea un modello ETS semantico multilingue e può avvisare la chat quando una persiana, finestra o porta riconosciuta con sufficiente affidabilità rimane aperta. Non invia mai autonomamente comandi KNX.",
|
|
100
|
-
"aiEducationHelp": "Solo l'utente può modificare questa sezione. L'AI la legge come istruzione autorevole, ma la memoria appresa non può mai sovrascriverla. Massimo 16.000 caratteri."
|
|
101
|
-
"homeMemoryLimitHelp": "La memoria Markdown viene riscritta atomicamente ogni 15 minuti ed è sempre limitata tra 64 e 1.024 KB. Le osservazioni vecchie vengono eliminate prima delle abitudini e degli oggetti semantici."
|
|
99
|
+
"aiEducationHelp": "Solo l'utente può modificare questa sezione. L'AI la legge come istruzione autorevole, ma la memoria appresa non può mai sovrascriverla. Massimo 16.000 caratteri."
|
|
102
100
|
},
|
|
103
101
|
"placeholder": {
|
|
104
102
|
"llmBaseUrl": "https://api.openai.com/v1/chat/completions (o endpoint compatibile)",
|