node-red-contrib-knx-ultimate 6.3.17 → 6.3.19
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 +12 -0
- package/examples/KNX AI - Conversational Control with Confirmation.json +40 -21
- package/examples/KNX AI - Summary Anomalies and Ask.json +0 -17
- package/examples/KNX AI - Telegrambot Direct Chat.json +3 -29
- package/nodes/knxUltimateAI.html +462 -210
- package/nodes/knxUltimateAI.js +1560 -182
- package/nodes/locales/de/knxUltimateAI.html +37 -48
- package/nodes/locales/de/knxUltimateAI.json +42 -39
- package/nodes/locales/en/knxUltimateAI.html +41 -51
- package/nodes/locales/en/knxUltimateAI.json +42 -39
- package/nodes/locales/es/knxUltimateAI.html +37 -48
- package/nodes/locales/es/knxUltimateAI.json +42 -39
- package/nodes/locales/fr/knxUltimateAI.html +37 -48
- package/nodes/locales/fr/knxUltimateAI.json +42 -39
- package/nodes/locales/it/knxUltimateAI.html +41 -51
- package/nodes/locales/it/knxUltimateAI.json +42 -39
- package/nodes/locales/zh-CN/knxUltimateAI.html +37 -48
- package/nodes/locales/zh-CN/knxUltimateAI.json +42 -39
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script type="text/markdown" data-help-name="knxUltimateAI">
|
|
2
2
|
Dieser Node überwacht **alle KNX-Telegramme** des ausgewählten KNX-Ultimate-Gateways, erstellt Verkehrsstatistiken, erkennt Anomalien und kann optional ein LLM befragen.
|
|
3
3
|
|
|
4
|
-
Der Editor verwendet
|
|
4
|
+
Der Editor verwendet zwei horizontale Registerkarten: **KI-Assistent** enthält Einrichtung, Wissen/Kontext und Anbietergrenzen; **Gespräche & Zuhause** enthält Chat-Kanäle, proaktives Zuhause und begrenztes Gedächtnis.
|
|
5
5
|
|
|
6
6
|
## Ausgänge
|
|
7
7
|
1. **Zusammenfassung/Statistik** (`msg.payload` JSON)
|
|
@@ -21,17 +21,26 @@ Sende `msg.topic`:
|
|
|
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
|
+
Dauert die Verarbeitung länger als 1,2 Sekunden, sendet Ausgang 3 sofort die lokalisierte Zwischenmeldung „Ich denke nach…“ mit `msg.knxAi.type = "thinking"` und `msg.knxAi.transient = true`. Der Chat-Adapter übermittelt sie an denselben Benutzer; die endgültige Antwort folgt wie gewohnt, sobald sie bereit ist. Diese Fortschrittsmeldung wird weder im Gesprächskontext noch im gelernten Gedächtnis gespeichert.
|
|
25
|
+
|
|
26
|
+
Anfragen an Ollama und Bionic LM Studio verwenden automatisch ein Mindest-Timeout von 10 Minuten; Cloud-Anbieter behalten mindestens 2 Minuten. Im Editor muss kein Timeout-Feld gepflegt werden. Wird selbst das lokale Limit erreicht, meldet KNX AI, dass das Modell die Antwort nicht abgeschlossen hat, und empfiehlt einen neuen Versuch oder einen kleineren Prompt-Kontext.
|
|
27
|
+
|
|
28
|
+
Der Node-Status im Canvas ist bewusst ausschließlich für die letzte eingehende Anfrage und den lokalisierten Zustand „Ich denke nach…“ während der LLM-Ausführung reserviert. KNX-Telegramme, Gateway-Aktualisierungen, Verkehrsraten, Bereitschaftsmeldungen und technische Ergebnisse überschreiben ihn nie; sie bleiben über Ausgänge, Logs und Assistentendaten verfügbar.
|
|
29
|
+
|
|
24
30
|
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
31
|
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
32
|
|
|
27
33
|
### Aktuelle KNX-Lesewerte
|
|
28
34
|
Wenn der Benutzer ausdrücklich einen aktuellen oder aktualisierten Zustand anfordert, kann die KI exakte Objekte aus dem importierten ETS-Katalog abfragen, einschließlich Status- und anderer schreibgeschützter Objekte. Ausgang 4 gibt `msg.destination`, `msg.dpt`, `msg.event = "GroupValue_Read"` und `msg.readstatus = true` aus. Der Node wartet bis zu 6 Sekunden auf jede `GroupValue_Response` oder ein aktuelles Write-Telegramm, gibt anschließend die dekodierten Werte an Ausgang 3 zurück und stellt Details in `msg.knxAi.readResults` bereit. Leseoperationen erfordern keine Bestätigung und werden niemals in Schreiboperationen umgewandelt.
|
|
29
35
|
|
|
36
|
+
### Mehrstufige Gesprächsroutinen
|
|
37
|
+
Anfragen wie „Ich gehe“, „Gute Nacht“ oder „Kinomodus“ können ohne neue Editor-Option eine zustandsabhängige Routine koordinieren. Im ersten LLM-Durchlauf werden ausschließlich exakte ETS-Leseoperationen akzeptiert (maximal 20); KNX AI sendet sie und übergibt die aktuellen GA-/DPT-/Wert-Ergebnisse an einen zweiten isolierten Planungsdurchlauf. Dieser darf bis zu 12 validierte Schreiboperationen vorbereiten, aber keinen weiteren Lesezyklus starten. Bei aktivierter Bestätigung benötigt der gesamte Plan eine einzige lokalisierte Bestätigung; vorher werden weder Schreiboperationen noch angeforderte TTS-Ansagen ausgegeben. Nach der Bestätigung wird jede Schreiboperation erneut validiert, in Reihenfolge weitergegeben und bis zu 4 Sekunden auf eine passende unmittelbare Bus-Rückmeldung beobachtet. Die Abschlussmeldung unterscheidet beobachtete Rückmeldungen von Vorgängen ohne unmittelbare Rückmeldung, ohne daraus einen Gerätefehler abzuleiten. Details stehen in `msg.knxAi.routine`, `readResults`, `verifiedCount` und `unverifiedCount`.
|
|
38
|
+
|
|
30
39
|
### Bestätigungsanfrage für Chat-Schaltflächen
|
|
31
40
|
Solange ein Plan aussteht, enthält Ausgang 3 `msg.knxAi.confirmationRequest`. Das Objekt enthält `required`, `status`, `sessionId`, `expiresAt`, `commandCount` und zwei Einträge in `actions`. Verwenden Sie `action.label` als Text der Telegram-Schaltfläche, `action.callbackData` als Callback und senden Sie `action.message` an KNX AI zurück, um ohne Texteingabe zu bestätigen oder abzubrechen.
|
|
32
41
|
|
|
33
42
|
### Chat-Adapter-Vorlagen
|
|
34
|
-
Der Tab **Chat-Adapter** lädt seine auswählbaren Zuordnungen aus `resources/KNXAIChatAdapterMappings.js`. Die Auswahl einer Vorlage
|
|
43
|
+
Der Tab **Chat-Adapter** lädt seine auswählbaren Zuordnungen aus `resources/KNXAIChatAdapterMappings.js`. Die Auswahl einer Vorlage installiert intern zwei vordefinierte synchrone JavaScript-Zuordnungen: eine vor der Verarbeitung des Eingangs durch KNX AI und eine vor der Ausgabe an Ausgang 3. Die Zuordnungen bleiben im Editor verborgen. Syntax- und Laufzeitfehler werden abgefangen und gemeldet, ohne Node-RED anzuhalten.
|
|
35
44
|
|
|
36
45
|
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
46
|
|
|
@@ -42,31 +51,30 @@ Installierte Kamerapakete können KNX AI zur Laufzeit einen Kamera-Adapter berei
|
|
|
42
51
|
|
|
43
52
|
Der Benutzer kann einen aktuellen Snapshot anfordern oder das Vision-Modell nach dem sichtbaren Inhalt fragen. Die Telegram- und RedBot-Vorlagen senden das Bild als natives Foto mit Bildunterschrift. Außerdem lassen sich dauerhafte Benachrichtigungen für Bewegung, das Überqueren einer intelligenten Linie oder das Betreten einer Einbruchs-/Verweilzone erstellen, optional auf erkannte Personen und eine genau benannte Linie oder Zone begrenzt. Diese Regeln werden in derselben Datei `knxai-chat-context.md` gespeichert und nach einem Neustart von Node-RED wiederhergestellt. UniFi-Ereignisse und Snapshot-Anfragen laufen direkt über den erkannten Anbieter; Ausgang 4 von KNX AI und zusätzliche Flow-Verkabelung sind nicht erforderlich.
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
### Ansagen mit TTS Ultimate
|
|
55
|
+
Wenn das optionale Paket `node-red-contrib-tts-ultimate` installiert ist, erscheint es unter den automatisch erkannten Adaptern. Die Auswahl listet alle `ttsultimate`-Nodes in sämtlichen Projekt-Flows mit Flow, Node-Name und konfiguriertem Player auf. Wählen Sie den Node für Chat-Ansagen aus und deployen Sie den Flow.
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
Nur eine ausdrückliche Anfrage in der aktuellen Chat-Nachricht kann eine Ansage erzeugen. KNX AI sendet den exakten Text direkt als `msg.payload` mit `msg.topic = "knx_ai_announcement"` an den ausgewählten Node; eine Zwischenverkabelung im Flow ist nicht erforderlich. TTS Ultimate verwaltet anschließend den konfigurierten Sonos-Player, Stimme, Lautstärke, Hailing und Warteschlange. Persistenter Kontext, KI-Erziehung, Kamerainhalte und abgeleitete Ereignisse lösen niemals selbstständig Sprache aus.
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
### Übersicht des Chat-Kontexts
|
|
60
|
+
Der Node-Editor zeigt eine kompakte Karte mit den für den Chat verfügbaren Quellen: aktuellem KNX-Verkehr, ETS-Semantik und Node-RED-Projekt, Sitzungs- und Hausgedächtnis, KI-Erziehung, erkannten Kameras und relevanter Dokumentation. Außerdem werden `knxai-chat-context.md`, `knxai-home-memory.md` und `knxai-config-<node-id>.json` sowie das absolute Stammverzeichnis des KNX-Telegrammarchivs, das Node-spezifische Verzeichnis und das Tagesdateimuster `YYYY-MM-DD.jsonl` aufgeführt. Die Pfade werden zur Laufzeit aus dem tatsächlich verwendeten Datenverzeichnis des konfigurierten Gateways ermittelt.
|
|
51
61
|
|
|
52
|
-
##
|
|
53
|
-
|
|
62
|
+
## Durch KI-Erziehung gesteuerte proaktive Hausintelligenz und begrenztes Gedächtnis
|
|
63
|
+
Aus ETS-Hierarchie, Namen, Rollen und DPTs erstellt der Node ein deterministisches semantisches Modell. Es gibt keinen separaten Schalter und keine erweiterten proaktiven Einstellungen. Eine Benachrichtigung wird nur bewertet, wenn das LLM aktiv ist und die **KI-Erziehung** sie ausdrücklich verlangt. Ausschließlich die Erziehung bestimmt Bedingungen, Offenzeit, Ruhezeiten und Wiederholung. Ohne eine ausdrückliche Regel oder bei fehlgeschlagener LLM-Auswertung wird nichts gesendet.
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|---|---|---|
|
|
57
|
-
| **Proaktive Hausbenachrichtigungen aktivieren** (`proactiveEnabled`) | aktiv | Zuverlässig erkannte offene Rollladen-/Fenster-/Türzustände werden bewertet. |
|
|
58
|
-
| **Hauptempfänger / Chat-ID** (`proactiveRecipient`) | `123456789` | Spontane Nachrichten gehen an diesen Chat; leer bedeutet: letzte Ask-Sitzung merken. |
|
|
59
|
-
| **Nach offener Dauer benachrichtigen** (`proactiveOpenMinutes`) | `120` | Nach zwei Stunden wird eine mögliche Meldung bewertet. |
|
|
60
|
-
| **Ruhezeit Beginn / Ende** | `23:00` / `07:00` | Nachts werden keine proaktiven Nachrichten ausgegeben. |
|
|
61
|
-
| **Wiederholungs-Cooldown** (`proactiveCooldownMinutes`) | `360` | Dasselbe Objekt meldet sich sechs Stunden lang nicht erneut. |
|
|
65
|
+
Die letzte Chat-Sitzung wird als Eigentümer gespeichert und empfängt spontane Nachrichten. Ausgang 3 gibt `msg.knxAi.type = "proactive_notification"` aus; `msg.inputMessage` bewahrt die Sitzung für den Chat-Adapter. Höchstens drei proaktive Nachrichten pro Stunde verhindern eine Nachrichtenflut. Ausgang 4 wird niemals proaktiv verwendet und KNX wird nicht selbstständig verändert.
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
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.
|
|
68
|
+
|
|
69
|
+
## Praktisches Konfigurationsbeispiel
|
|
70
|
+
Schreiben Sie die vollständige Benachrichtigungsrichtlinie in die **KI-Erziehung** (`aiEducation`):
|
|
64
71
|
|
|
65
72
|
```text
|
|
66
73
|
Nenne mich Alex und antworte in derselben Sprache wie ich.
|
|
67
74
|
Antworte kurz, außer ich bitte um technische Einzelheiten.
|
|
75
|
+
Benachrichtige meinen letzten Chat, wenn ein Rollladen, Fenster oder eine Tür mindestens 120 Minuten offen bleibt.
|
|
76
|
+
Zwischen 23:00 und 07:00 keine Meldungen; dieselbe Meldung frühestens nach sechs Stunden wiederholen.
|
|
68
77
|
Der Büro-Rollladen darf tagsüber offen bleiben: benachrichtige mich nicht.
|
|
69
|
-
Melde andere Rollläden, Fenster oder Türen, die ungewöhnlich lange offen bleiben.
|
|
70
78
|
Wenn „Wohnzimmerlicht“ mehrdeutig ist, frage nach der gemeinten Leuchte.
|
|
71
79
|
Behaupte nie eine Aktoränderung, bevor ein KNX-Statusobjekt sie bestätigt.
|
|
72
80
|
```
|
|
@@ -93,46 +101,20 @@ Hier sind alle Felder aufgeführt, wie sie im KNX-AI-Editor sichtbar sind.
|
|
|
93
101
|
- **Topic**: Basis-Topic der Node-Ausgänge.
|
|
94
102
|
- Button **Open KNX AI Web**: Öffnet das Web-Dashboard (`/knxUltimateAI/sidebar/page`).
|
|
95
103
|
|
|
96
|
-
KNX AI hört automatisch auf `GroupValue_Write`, `GroupValue_Response` und `GroupValue_Read`. Die Muster- und Anomalieanalyse wird immer mit den integrierten Standardwerten initialisiert; Busereignisse und Erkennung müssen daher nicht konfiguriert werden.
|
|
97
|
-
|
|
98
|
-
### Analysis
|
|
99
|
-
- **Analysis window (seconds)**: Hauptfenster für Summary/Rate-Berechnung.
|
|
100
|
-
- **History window (seconds)**: Aufbewahrungsfenster der internen Telegramm-Historie.
|
|
101
|
-
- **Captured telegrams also on disk archivieren**: Speichert Telegramme zusätzlich zu RAM in `knxultimatestorage/knxai/history/<node-id>/YYYY-MM-DD.jsonl`.
|
|
102
|
-
- **Aufbewahrung des Festplattenarchivs (Tage)**: Anzahl Tage, die Archivdateien auf Platte behalten werden, bevor sie automatisch gelöscht werden.
|
|
103
|
-
- **Max stored events**: Maximale Anzahl Telegramme im Speicher.
|
|
104
|
-
- **Auto emit summary (seconds, 0=off)**: Periodisches Summary-Intervall.
|
|
105
|
-
- **Top list size**: Anzahl Top-Gruppenadressen/Quellen in der Summary.
|
|
106
|
-
|
|
107
104
|
### KI-Assistent
|
|
108
105
|
- **Enable LLM assistant**: Aktiviert Ask/Chat-Funktionen.
|
|
109
|
-
- **Provider**: LLM-Backend (OpenAI-compatible oder
|
|
106
|
+
- **Provider**: LLM-Backend (OpenAI-compatible, Anthropic, Ollama oder Bionic LM Studio).
|
|
110
107
|
- **Endpoint URL**: URL des Chat/Completions-Endpunkts.
|
|
111
|
-
- **API key**: API-Schlüssel (für lokales Ollama nicht erforderlich).
|
|
108
|
+
- **API key**: API-Schlüssel (für lokales Ollama nicht erforderlich; für Bionic LM Studio optional, sofern die Serverauthentifizierung deaktiviert ist).
|
|
112
109
|
- **Model**: Modell-ID/Name.
|
|
113
110
|
- **Chatmodell-Kompatibilität**: Das ausgewählte Modell muss den konfigurierten Chat-Completions-Endpunkt unterstützen. Ältere reine Completions-Modelle wie `gpt-3.5-turbo-instruct` werden beim Aktualisieren der Modellliste ausgeschlossen. Lehnt der Anbieter einen benutzerdefinierten Temperaturwert oder den Token-Limit-Parameter ab, wiederholt KNX AI die Anfrage und entfernt oder ersetzt nur das inkompatible Feld.
|
|
114
111
|
- **KI darf KNX-Zustände lesen und Aktoren steuern**: Aktiviert Ausgang 4 und ist standardmäßig aus. Exakte ETS-Katalogobjekte dürfen gelesen werden; Schreiboperationen werden ausschließlich für Objekte mit Rolle `command` akzeptiert. Unbekannte, DPT-falsche, ungültige oder überzählige Operationen sowie Schreiboperationen auf Status-/Neutralobjekte werden lokal abgewiesen.
|
|
115
112
|
- **Vor dem Senden von KNX-Befehlen bestätigen lassen**: Standardmäßig aktiv. Zeigt zuerst die validierten Änderungen und sendet nichts, bis dieselbe Chat-Sitzung bestätigt. Wenn Befehle auf Bestätigung warten, fügt die Antwort immer die genauen Anweisungen zum Bestätigen oder Abbrechen in der Sprache der aktuellen Anfrage hinzu. Vor der Ausgabe werden die Befehle erneut validiert.
|
|
116
|
-
- **Adapter-Vorlage**: Standardmäßig ist **Kein Adapter** gewählt. Die
|
|
117
|
-
- **
|
|
118
|
-
-
|
|
119
|
-
- **Proaktive Hausbenachrichtigungen aktivieren**: Optionaler Detektor für zuverlässig erkannte offene Rollladen-/Fenster-/Türzustände; er schreibt nie selbstständig auf KNX.
|
|
120
|
-
- **Hauptempfänger / Chat-ID**: Optionales Ziel für unaufgeforderte Chatnachrichten; andernfalls wird die letzte Ask-Sitzung gespeichert.
|
|
121
|
-
- **Nach offener Dauer benachrichtigen (Minuten)**: Schwelle, bevor eine proaktive Nachricht erwogen wird; standardmäßig 120 Minuten.
|
|
122
|
-
- **Ruhezeit Beginn / Ende**: Täglicher Zeitraum, in dem proaktive Nachrichten unterdrückt werden.
|
|
123
|
-
- **KI-Erziehung**: Verbindliche, ausschließlich vom Benutzer verwaltete Hinweise, die die KI lesen, aber nie ändern darf.
|
|
124
|
-
- **Wiederholungs-Cooldown (Minuten)**: Mindestintervall vor einer weiteren Meldung desselben Objekts; standardmäßig 360 Minuten.
|
|
125
|
-
- 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.
|
|
126
|
-
- **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.
|
|
127
|
-
- Relevante Auszüge aus Hilfe, README und Beispielen werden immer automatisch einbezogen.
|
|
128
|
-
- **Docs language**: Bevorzugte Sprache der automatisch einbezogenen Dokumentationsauszüge.
|
|
113
|
+
- **Adapter-Vorlage**: Standardmäßig ist **Kein Adapter** gewählt. Die Auswahl lädt das vordefinierte Paar aus Ein- und Ausgangszuordnung; beide bleiben im Editor verborgen.
|
|
114
|
+
- **KI-Erziehung**: Verbindliche, ausschließlich vom Benutzer verwaltete Hinweise, die die KI lesen, aber nie ändern darf. Nur hier werden proaktive Benachrichtigungen mit Bedingungen, Dauer, Ruhezeiten und Wiederholung angefordert.
|
|
115
|
+
- Relevante Auszüge aus Hilfe, README und Beispielen werden immer automatisch einbezogen; ihre Sprache wird aus der Benutzeranfrage erkannt, mit automatischen Rückgriffen auf alle unterstützten Sprachen.
|
|
129
116
|
- Button **Refresh**: Fragt den Provider ab und lädt verfügbare Modelle. Währenddessen dreht sich das Symbol; ein erfolgreicher Abschluss bleibt absichtlich ohne Meldung.
|
|
130
117
|
|
|
131
|
-
### Advanced
|
|
132
|
-
- **Analysis window (seconds)**: Hauptfenster für Summary/Rate-Berechnung.
|
|
133
|
-
- **Max stored events**: Maximale Anzahl Telegramme im Speicher.
|
|
134
|
-
- **Top list size**: Anzahl Top-Gruppenadressen/Quellen in der Summary.
|
|
135
|
-
|
|
136
118
|
### Ollama Schnellstart (lokal)
|
|
137
119
|
- **Provider = Ollama** auswählen.
|
|
138
120
|
- Standard-Endpoint: `http://localhost:11434/api/chat`.
|
|
@@ -143,6 +125,13 @@ KNX AI hört automatisch auf `GroupValue_Write`, `GroupValue_Response` und `Grou
|
|
|
143
125
|
- Bei Installationsfehlern mit Verbindungsproblem prüfen, ob Ollama läuft (Desktop-App oder `ollama serve`).
|
|
144
126
|
- Wenn Node-RED in Docker läuft, im Endpoint `host.docker.internal` statt `localhost` verwenden.
|
|
145
127
|
|
|
128
|
+
### Bionic LM Studio Schnellstart (lokal)
|
|
129
|
+
- **Provider = Bionic LM Studio** auswählen.
|
|
130
|
+
- Den LM-Studio-API-Server auf der Seite **Developer** oder mit `lms server start` starten.
|
|
131
|
+
- Standard-Endpoint: `http://localhost:1234/v1/chat/completions`.
|
|
132
|
+
- Mit **Refresh** alle von `/v1/models` bereitgestellten Modelle laden; ist kein Modell konfiguriert, wird das erste ausgewählt.
|
|
133
|
+
- Der API-Schlüssel ist optional, sofern die Authentifizierung in den LM-Studio-Servereinstellungen nicht aktiviert ist. In Docker `localhost` durch `host.docker.internal` ersetzen.
|
|
134
|
+
|
|
146
135
|
## Sicherheitshinweis
|
|
147
136
|
Bei aktiviertem LLM kann KNX-Traffic-Kontext an den konfigurierten Endpoint gesendet werden. Für striktes On-Premise lokale Provider verwenden. Ein Befehl an Ausgang 4 hat die lokale Validierung bestanden und wurde an den Flow weitergegeben; dies bestätigt nicht die Ausführung durch den Aktor. Dafür eine KNX-Status-GA verwenden.
|
|
148
137
|
</script>
|
|
@@ -5,40 +5,17 @@
|
|
|
5
5
|
"groupAssistant": "KI-Assistent",
|
|
6
6
|
"groupChatHome": "Gespräche & Zuhause",
|
|
7
7
|
"detectedAdapters": "Automatisch erkannte Adapter",
|
|
8
|
-
"
|
|
8
|
+
"chatContextOverview": "Übersicht des Chat-Kontexts",
|
|
9
9
|
"quickSetup": "Assistent einrichten",
|
|
10
|
-
"capture": "Bus-Telegrammeingang",
|
|
11
|
-
"storage": "KNX-Verlauf & Zusammenfassungen",
|
|
12
|
-
"detection": "Anomalien & Muster",
|
|
13
10
|
"llmConnection": "KI-Assistent-Verbindung",
|
|
14
|
-
"llmContext": "KI-Wissen & Kontext",
|
|
15
11
|
"chatAdapter": "Chat-Kanäle",
|
|
16
|
-
"homeIntelligence": "
|
|
17
|
-
"homeIntelligenceAdvanced": "Erweiterte proaktive Einstellungen",
|
|
12
|
+
"homeIntelligence": "KI-Erziehung & Gedächtnis",
|
|
18
13
|
"advanced": "Anbieter & Grenzen"
|
|
19
14
|
},
|
|
20
15
|
"properties": {
|
|
21
16
|
"server": "Gateway",
|
|
22
17
|
"name": "Name",
|
|
23
18
|
"topic": "Topic",
|
|
24
|
-
"notifywrite": "Capture GroupValue_Write",
|
|
25
|
-
"notifyresponse": "Capture GroupValue_Response",
|
|
26
|
-
"notifyreadrequest": "Capture GroupValue_Read",
|
|
27
|
-
"analysisWindowSec": "Analysis window (seconds)",
|
|
28
|
-
"historyWindowSec": "History window (seconds)",
|
|
29
|
-
"historyStoreToDisk": "Captured telegrams also on disk archivieren",
|
|
30
|
-
"historyStoreRetentionDays": "Aufbewahrung des Festplattenarchivs (Tage)",
|
|
31
|
-
"maxEvents": "Max stored events",
|
|
32
|
-
"emitIntervalSec": "Auto emit summary (seconds, 0=off)",
|
|
33
|
-
"topN": "Top list size",
|
|
34
|
-
"enablePattern": "Detect simple patterns (A -> B)",
|
|
35
|
-
"patternMaxLagMs": "Pattern max lag (ms)",
|
|
36
|
-
"patternMinCount": "Pattern min occurrences",
|
|
37
|
-
"rateWindowSec": "Rate window (seconds)",
|
|
38
|
-
"maxTelegramPerSecOverall": "Max overall telegrams/sec (0=off)",
|
|
39
|
-
"maxTelegramPerSecPerGA": "Max telegrams/sec per GA (0=off)",
|
|
40
|
-
"flapWindowSec": "Flap window (seconds)",
|
|
41
|
-
"flapMaxChanges": "Max changes per GA in window (0=off)",
|
|
42
19
|
"llmEnabled": "Enable LLM assistant",
|
|
43
20
|
"llmProvider": "Provider",
|
|
44
21
|
"llmBaseUrl": "Endpoint URL",
|
|
@@ -46,21 +23,14 @@
|
|
|
46
23
|
"llmModel": "Model",
|
|
47
24
|
"llmSystemPrompt": "System prompt",
|
|
48
25
|
"llmIncludeRaw": "Include raw payload hex",
|
|
49
|
-
"llmIncludeFlowContext": "Node-RED-Projektinventar einbeziehen",
|
|
50
26
|
"llmAllowKnxCommands": "KI darf KNX-Zustände lesen und Aktoren steuern",
|
|
51
27
|
"llmRequireCommandConfirmation": "Vor dem Senden von KNX-Befehlen bestätigen lassen",
|
|
52
28
|
"chatAdapterPreset": "Adapter-Vorlage",
|
|
53
29
|
"chatInputCode": "Eingangszuordnung (Chat → KNX AI)",
|
|
54
30
|
"chatOutputCode": "Ausgangszuordnung (KNX AI → Chat)",
|
|
55
|
-
"
|
|
56
|
-
"proactiveRecipient": "Hauptempfänger / Chat-ID",
|
|
57
|
-
"proactiveOpenMinutes": "Nach Offenstand benachrichtigen (Minuten)",
|
|
58
|
-
"proactiveCooldownMinutes": "Wiederholsperre (Minuten)",
|
|
59
|
-
"proactiveQuietStart": "Beginn der Ruhezeit",
|
|
60
|
-
"proactiveQuietEnd": "Ende der Ruhezeit",
|
|
31
|
+
"ttsUltimateNodeId": "TTS-Ultimate-Node für Ansagen",
|
|
61
32
|
"aiEducation": "KI-Erziehung (vom Benutzer verwaltet)",
|
|
62
|
-
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)"
|
|
63
|
-
"llmDocsLanguage": "Docs language"
|
|
33
|
+
"llmIncludeDocsSnippets": "Include documentation snippets (help/README/examples)"
|
|
64
34
|
},
|
|
65
35
|
"outputs": {
|
|
66
36
|
"summary": "Zusammenfassung/Statistik",
|
|
@@ -72,10 +42,15 @@
|
|
|
72
42
|
"llmProvider": {
|
|
73
43
|
"openai_compat": "OpenAI-compatible (chat/completions)",
|
|
74
44
|
"anthropic": "Anthropic (Claude)",
|
|
75
|
-
"ollama": "Ollama (
|
|
45
|
+
"ollama": "Ollama (lokal)",
|
|
46
|
+
"lmstudio": "Bionic LM Studio"
|
|
76
47
|
},
|
|
77
48
|
"chatAdapter": {
|
|
78
49
|
"none": "Kein Adapter"
|
|
50
|
+
},
|
|
51
|
+
"ttsUltimate": {
|
|
52
|
+
"select": "TTS-Ultimate-Node auswählen",
|
|
53
|
+
"none": "Kein TTS-Ultimate-Node gefunden"
|
|
79
54
|
}
|
|
80
55
|
},
|
|
81
56
|
"placeholder": {
|
|
@@ -83,10 +58,14 @@
|
|
|
83
58
|
"llmApiKey": "Paste API key (starts with sk-)",
|
|
84
59
|
"llmModel": "e.g. gpt-4o-mini",
|
|
85
60
|
"llmSystemPrompt": "Optional. Leave empty for default.",
|
|
86
|
-
"
|
|
87
|
-
"aiEducation": "Beispiel: Zwischen 23:00 und 07:00 nicht benachrichtigen. Der Rollladen im Büro darf nachts offen bleiben."
|
|
61
|
+
"aiEducation": "Beispiel: Benachrichtige meinen letzten Chat, wenn ein Fenster 30 Minuten offen bleibt. Zwischen 23:00 und 07:00 keine Meldungen."
|
|
88
62
|
},
|
|
89
63
|
"messages": {
|
|
64
|
+
"lmStudioContextAvailable": "Maximaler Modellkontext",
|
|
65
|
+
"lmStudioContextLoading": "Modell wird mit maximalem Kontext geladen",
|
|
66
|
+
"lmStudioContextConfigured": "Maximaler Modellkontext konfiguriert",
|
|
67
|
+
"lmStudioContextFailed": "Der Modellkontext konnte nicht konfiguriert werden",
|
|
68
|
+
"lmStudioContextCurrentlyLoaded": "derzeit geladen",
|
|
90
69
|
"ollamaNotSupported": "Ollama local mode: API key not required. Default endpoint is http://localhost:11434/api/chat.",
|
|
91
70
|
"ollamaNoModels": "No local Ollama model found. Install one or pick one from the library.",
|
|
92
71
|
"installingOllamaModel": "Starting Ollama and installing model…",
|
|
@@ -100,10 +79,34 @@
|
|
|
100
79
|
"detectedAdapterDetected": "Erkannt",
|
|
101
80
|
"detectedAdapterControllers": "Controller",
|
|
102
81
|
"detectedAdapterCameras": "Kameras",
|
|
82
|
+
"detectedAdapterNodes": "Nodes",
|
|
83
|
+
"ttsUltimateUnknownFlow": "Flow ohne Namen",
|
|
84
|
+
"ttsUltimateUnavailable": "TTS-Ultimate-Node nicht verfügbar",
|
|
85
|
+
"ttsUltimateHint": "Explizite Ansagen aus dem Chat werden direkt an den ausgewählten Node gesendet; eine Flow-Verkabelung ist nicht erforderlich.",
|
|
86
|
+
"chatContextLoading": "Zusammenfassung des Chat-Kontexts wird geladen…",
|
|
87
|
+
"chatContextUnavailable": "Die Zusammenfassung des Chat-Kontexts ist vorübergehend nicht verfügbar.",
|
|
88
|
+
"chatContextIntro": "Der Chat erhält diese Quellen automatisch. Die folgenden Pfade werden von dieser Node-RED-Installation tatsächlich verwendet.",
|
|
89
|
+
"chatContextSourcesTitle": "Enthaltene Quellen",
|
|
90
|
+
"chatContextFilesTitle": "Dauerhafte Kontextdateien",
|
|
91
|
+
"chatContextDirectoriesTitle": "KNX-Telegrammarchiv",
|
|
92
|
+
"chatContextSourceKnxTraffic": "Aktuelle KNX-Zusammenfassung, Anomalien, Topologie und ausgewählte Telegramme.",
|
|
93
|
+
"chatContextSourceEtsProject": "ETS-Semantik und vollständiges Inventar des Node-RED-Projekts.",
|
|
94
|
+
"chatContextSourceMemoryEducation": "Sitzungskontext, KI-Erziehung und begrenztes Hausgedächtnis.",
|
|
95
|
+
"chatContextSourceCamerasDocs": "Erkannte Kameras und relevante Auszüge aus Hilfe, README und Beispielen.",
|
|
96
|
+
"chatContextSourceTtsUltimate": "Ausgewählter TTS-Ultimate-Node für Ansagen.",
|
|
97
|
+
"chatContextSourceBadge": "Quelle",
|
|
98
|
+
"chatContextFileChatContext": "Dauerhafte Gesprächsverläufe, Anweisungen und Regeln für Kamerabenachrichtigungen.",
|
|
99
|
+
"chatContextFileHomeMemory": "KI-Erziehung und begrenztes gelerntes Hausgedächtnis.",
|
|
100
|
+
"chatContextFileAssistantConfig": "Dauerhafte Konfiguration des Web-Assistenten und semantische Bereiche dieses Nodes.",
|
|
101
|
+
"chatContextFileBadge": "Datei",
|
|
102
|
+
"chatContextDirectoryRoot": "Stammverzeichnis des Telegrammarchivs",
|
|
103
|
+
"chatContextDirectoryNode": "Telegrammarchiv dieses Nodes",
|
|
104
|
+
"chatContextDirectoryBadge": "KNX",
|
|
105
|
+
"chatContextTelegramPattern": "Tagesdateien",
|
|
103
106
|
"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.",
|
|
104
107
|
"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.",
|
|
105
|
-
"homeIntelligenceIntro": "Der Node erstellt ein mehrsprachiges semantisches ETS-Modell
|
|
106
|
-
"aiEducationHelp": "Nur der Benutzer kann diesen Abschnitt bearbeiten. Die KI liest
|
|
108
|
+
"homeIntelligenceIntro": "Der Node erstellt ein mehrsprachiges semantisches ETS-Modell. Proaktive Benachrichtigungen werden nur berücksichtigt, wenn die KI-Erziehung sie ausdrücklich verlangt; der Node sendet niemals selbstständig einen KNX-Befehl.",
|
|
109
|
+
"aiEducationHelp": "Nur der Benutzer kann diesen Abschnitt bearbeiten. Definieren Sie hier alle Regeln für proaktive Benachrichtigungen, einschließlich Bedingungen, Dauer, Ruhezeiten und Wiederholung. Die KI liest sie als verbindliche Vorgabe und das gelernte Gedächtnis kann sie niemals überschreiben. Maximal 16.000 Zeichen."
|
|
107
110
|
},
|
|
108
111
|
"sidebar": {
|
|
109
112
|
"ui": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script type="text/markdown" data-help-name="knxUltimateAI">
|
|
2
2
|
This node listens to **all KNX telegrams** from the selected KNX Ultimate gateway, builds traffic statistics, detects anomalies, and can optionally query an LLM.
|
|
3
3
|
|
|
4
|
-
The editor uses
|
|
4
|
+
The editor uses two horizontal tabs: **AI assistant** contains setup, knowledge/context and provider limits; **Conversations & home** contains chat channels, proactive home and bounded memory.
|
|
5
5
|
|
|
6
6
|
## Outputs
|
|
7
7
|
1. **Summary/Stats** (`msg.payload` JSON)
|
|
@@ -21,17 +21,26 @@ Send `msg.topic`:
|
|
|
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
|
+
If processing takes longer than 1.2 seconds, output 3 emits the localized intermediate message “I’m thinking…” with `msg.knxAi.type = "thinking"` and `msg.knxAi.transient = true`. The chat adapter sends it immediately to the same user, while the final answer follows normally. This progress message is never stored in conversation context or learned memory.
|
|
25
|
+
|
|
26
|
+
Ollama and Bionic LM Studio requests automatically use a minimum timeout of 10 minutes; cloud providers retain a 2-minute minimum. There is no timeout field to maintain in the editor. If even the local limit is reached, KNX AI reports that the model did not finish and suggests retrying or reducing the prompt context.
|
|
27
|
+
|
|
28
|
+
The node's canvas status is deliberately reserved for the latest incoming request and the localized “I’m thinking…” state while the LLM is running. KNX telegrams, gateway updates, traffic rates, ready messages and technical results never overwrite it; they remain available through the node outputs, logs and Assistant data.
|
|
29
|
+
|
|
24
30
|
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
31
|
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
32
|
|
|
27
33
|
### Fresh KNX reads
|
|
28
34
|
When the user explicitly asks for a fresh/current state, the AI may query exact objects from the imported ETS catalog, including status and other read-only objects. Output 4 emits `msg.destination`, `msg.dpt`, `msg.event = "GroupValue_Read"`, and `msg.readstatus = true`. The node waits up to 6 seconds for each `GroupValue_Response` or fresh write, then returns the decoded values on output 3 and exposes details in `msg.knxAi.readResults`. Reads never require confirmation and never become writes.
|
|
29
35
|
|
|
36
|
+
### Conversational multi-step routines
|
|
37
|
+
Requests such as “I’m leaving”, “Good night”, or “Cinema mode” can coordinate a state-aware routine without a new editor option. In the first LLM pass, only exact ETS reads are accepted (up to 20); KNX AI sends them and supplies the fresh GA/DPT/value results to a second isolated planning pass. That pass may prepare up to 12 validated writes, but cannot request another read cycle. With confirmation enabled, the complete plan has one localized confirmation and no write or requested TTS announcement is emitted beforehand. After confirmation every write is revalidated, forwarded in order, and observed for up to 4 seconds for matching immediate bus feedback. The final reply distinguishes observed feedback from operations without immediate feedback—absence of feedback is not reported as device failure. Routine details are exposed in `msg.knxAi.routine`, `readResults`, `verifiedCount`, and `unverifiedCount`.
|
|
38
|
+
|
|
30
39
|
### Confirmation request for chat buttons
|
|
31
40
|
While a plan is pending, output 3 contains `msg.knxAi.confirmationRequest`. The object includes `required`, `status`, `sessionId`, `expiresAt`, `commandCount`, and two entries in `actions`. Use `action.label` as the Telegram button text, `action.callbackData` as its callback, and send `action.message` back to KNX AI to confirm or cancel without typed text.
|
|
32
41
|
|
|
33
42
|
### Chat adapter presets
|
|
34
|
-
The **Chat adapters** tab loads its selectable mappings from `resources/KNXAIChatAdapterMappings.js`. Selecting a preset
|
|
43
|
+
The **Chat adapters** tab loads its selectable mappings from `resources/KNXAIChatAdapterMappings.js`. Selecting a preset installs two predefined synchronous JavaScript mappings internally: one before KNX AI processes an input and one before output 3 is emitted. The mappings remain hidden in the editor. Syntax and execution failures are caught and reported without stopping Node-RED.
|
|
35
44
|
|
|
36
45
|
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
46
|
|
|
@@ -42,38 +51,39 @@ Installed camera packages can publish a camera adapter to KNX AI at runtime. The
|
|
|
42
51
|
|
|
43
52
|
The user can ask for a current snapshot or ask the vision model what is visible. Telegram and RedBot presets emit the returned image as a native photo with a caption. The user can also create persistent notifications for motion, a smart line crossing or entry into an intrusion/loiter zone, optionally limited to detected people and to an exact named line or zone. These rules are stored in the same `knxai-chat-context.md` file and are restored after Node-RED restarts. UniFi event subscriptions and snapshot requests are made directly through the detected provider; KNX AI output 4 is not involved and no intermediate flow wiring is required.
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
### TTS Ultimate announcements
|
|
55
|
+
When the optional `node-red-contrib-tts-ultimate` package is installed, it appears among the automatically detected adapters. The selector lists every `ttsultimate` node in all project flows, with its flow, node name and configured player. Choose the node that must handle chat announcements and deploy the flow.
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
Only an explicit request in the current chat message can create an announcement. KNX AI sends the exact text directly to the selected node as `msg.payload`, with `msg.topic = "knx_ai_announcement"`; no intermediate flow wiring is required. TTS Ultimate then handles the configured Sonos player, voice, volume, hailing and queue. Persistent context, AI Education, camera content and inferred events never trigger speech by themselves.
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
### Chat context overview
|
|
60
|
+
The node editor shows a compact card summarizing the sources available to the chat: live KNX traffic, ETS semantics and the Node-RED project, session and home memory, AI Education, detected cameras and relevant documentation. It also lists `knxai-chat-context.md`, `knxai-home-memory.md` and `knxai-config-<node-id>.json`, together with the absolute KNX telegram archive root, the node-specific archive directory and the `YYYY-MM-DD.jsonl` daily-file pattern. The paths are resolved at runtime from the data directory actually used by the configured gateway.
|
|
51
61
|
|
|
52
|
-
##
|
|
53
|
-
|
|
62
|
+
## Education-driven proactive home intelligence and bounded memory
|
|
63
|
+
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. Its proactive detector watches only reliably recognized non-command cover/window/door states.
|
|
64
|
+
|
|
65
|
+
There is no separate switch or advanced proactive configuration. A candidate is evaluated only when the LLM is enabled and **AI Education** explicitly requests that notification. Education is the sole policy for conditions, open duration, quiet hours and repetition. The AI receives the current duration, local date/time and recent notification history; it decides whether to notify and when to reconsider the same open condition. Without an explicit Education rule, or when the LLM cannot evaluate it, no notification is sent.
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|---|---|---|
|
|
57
|
-
| **Enable proactive home notifications** (`proactiveEnabled`) | enabled | The node evaluates reliably recognized open cover/window/door states. |
|
|
58
|
-
| **Primary recipient / chat ID** (`proactiveRecipient`) | `123456789` | Unsolicited messages go to this chat. Leave it empty to remember the most recent Ask session. |
|
|
59
|
-
| **Notify after open** (`proactiveOpenMinutes`) | `120` | A candidate notification is considered after two hours. |
|
|
60
|
-
| **Quiet hours start / end** | `23:00` / `07:00` | No proactive message is emitted during the night. |
|
|
61
|
-
| **Repeat cooldown** (`proactiveCooldownMinutes`) | `360` | The same object cannot notify again for six hours. |
|
|
67
|
+
The most recent chat session is remembered as the owner and receives spontaneous messages. Output 3 emits a localized message with `msg.knxAi.type = "proactive_notification"`; a synthetic `msg.inputMessage` preserves the session for the chat adapter. A hard safety limit of three proactive messages per hour prevents flooding. The node never emits output 4 or changes KNX autonomously; a subsequent user request still uses the normal validation and confirmation workflow.
|
|
62
68
|
|
|
63
|
-
|
|
69
|
+
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.
|
|
70
|
+
|
|
71
|
+
## Practical configuration example
|
|
72
|
+
Put the complete notification policy in **AI Education** (`aiEducation`):
|
|
64
73
|
|
|
65
74
|
```text
|
|
66
75
|
Call me Alex and answer in the same language I use.
|
|
67
76
|
Keep replies short unless I ask for technical details.
|
|
77
|
+
Notify my most recent chat when a cover, window, or door remains open for at least 120 minutes.
|
|
78
|
+
Do not notify me between 23:00 and 07:00 and do not repeat the same alert within six hours.
|
|
68
79
|
The office cover may remain open during the day: do not notify me about it.
|
|
69
|
-
Notify me when another cover, window, or door remains open unusually long.
|
|
70
80
|
When "living-room light" is ambiguous, ask which light I mean.
|
|
71
81
|
Never say that an actuator changed until a KNX status object confirms it.
|
|
72
82
|
```
|
|
73
83
|
|
|
74
|
-
With
|
|
84
|
+
With this Education:
|
|
75
85
|
|
|
76
|
-
1. If the living-room cover status remains open for 120 minutes outside quiet hours, output 3 can emit a localized `proactive_notification
|
|
86
|
+
1. If the living-room cover status remains open for 120 minutes outside the stated quiet hours, output 3 can emit a localized `proactive_notification` to the most recent chat session.
|
|
77
87
|
2. If the office cover remains open, the LLM reads Education and suppresses that candidate notification.
|
|
78
88
|
3. If Alex later asks to close the living-room cover, KNX AI prepares the exact ETS command and still follows normal validation and confirmation before output 4.
|
|
79
89
|
|
|
@@ -97,47 +107,20 @@ All fields exposed in the KNX AI editor are listed below.
|
|
|
97
107
|
- **Topic**: Base topic used in node outputs.
|
|
98
108
|
- **Open KNX AI Web** button: Opens the full KNX AI web dashboard (`/knxUltimateAI/sidebar/page`).
|
|
99
109
|
|
|
100
|
-
### Capture
|
|
101
|
-
KNX AI automatically listens to `GroupValue_Write`, `GroupValue_Response`, and `GroupValue_Read` telegrams. Pattern and anomaly analysis is always initialized with the built-in defaults, so no bus-event or detection setup is required.
|
|
102
|
-
|
|
103
|
-
### Analysis
|
|
104
|
-
- **Analysis window (seconds)**: Main analysis window used for summaries/rates.
|
|
105
|
-
- **History window (seconds)**: Retention window for internal telegram history.
|
|
106
|
-
- **Also archive captured telegrams to disk**: Stores captured telegrams in `knxultimatestorage/knxai/history/<node-id>/YYYY-MM-DD.jsonl` in addition to RAM.
|
|
107
|
-
- **Disk archive retention (days)**: Number of days kept on disk before old archive files are deleted automatically.
|
|
108
|
-
- **Max stored events**: Maximum number of telegrams kept in memory.
|
|
109
|
-
- **Auto emit summary (seconds, 0=off)**: Periodic summary output interval.
|
|
110
|
-
- **Top list size**: Number of top group addresses/sources in summary.
|
|
111
|
-
|
|
112
110
|
### AI Assistant
|
|
113
111
|
- **Enable LLM assistant**: Enable Ask/chat assistant features.
|
|
114
|
-
- **Provider**: Select LLM backend (OpenAI-compatible or
|
|
112
|
+
- **Provider**: Select the LLM backend (OpenAI-compatible, Anthropic, Ollama or Bionic LM Studio).
|
|
115
113
|
- **Endpoint URL**: Chat/completions endpoint URL.
|
|
116
|
-
- **API key**: API key (not required for local Ollama).
|
|
114
|
+
- **API key**: API key (not required for local Ollama; optional for Bionic LM Studio unless server authentication is enabled).
|
|
117
115
|
- **Model**: Model ID/name.
|
|
118
116
|
- **Chat model compatibility**: The selected model must support the configured Chat Completions endpoint. Legacy completion-only models such as `gpt-3.5-turbo-instruct` are excluded when the model list is refreshed. If the provider rejects a custom temperature or token-limit parameter, KNX AI retries after removing or replacing only that incompatible field.
|
|
119
117
|
- **Allow AI to read KNX states and control actuators**: Enables output 4 and is off by default. Exact ETS catalog objects may be read; writes are accepted only for objects classified as `command`. Unknown, DPT-mismatched, invalid, or excessive operations and writes to status/neutral objects are rejected locally.
|
|
120
118
|
- **Ask for confirmation before sending KNX commands**: Enabled by default. Shows the validated changes first and emits no KNX command until the same chat session confirms them. Whenever commands are awaiting confirmation, the response always appends the exact confirmation/cancellation instructions in the language of the current request. Commands are validated again immediately before output.
|
|
121
|
-
- **Adapter preset**: Defaults to **No adapter**.
|
|
122
|
-
- **
|
|
123
|
-
-
|
|
124
|
-
- **Enable proactive home notifications**: Opt-in detector for reliably recognized open cover/window/door states; it never writes autonomously to KNX.
|
|
125
|
-
- **Primary recipient / chat ID**: Optional destination for unsolicited chat messages; otherwise the most recent Ask session is remembered.
|
|
126
|
-
- **Notify after open (minutes)**: Open-duration threshold before a proactive notification can be considered; 120 minutes by default.
|
|
127
|
-
- **Quiet hours start / end**: Daily interval in which proactive messages are suppressed.
|
|
128
|
-
- **AI Education**: User-only, authoritative guidance read by the AI and never modified by it.
|
|
129
|
-
- **Repeat cooldown (minutes)**: Minimum interval before the same object may notify again; 360 minutes by default.
|
|
130
|
-
- 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.
|
|
131
|
-
- **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.
|
|
132
|
-
- Relevant help, README, and example snippets are always included automatically.
|
|
133
|
-
- **Docs language**: Preferred language for the automatically included documentation snippets.
|
|
119
|
+
- **Adapter preset**: Defaults to **No adapter**. Selecting a preset loads its predefined input/output mapping pair; both mappings remain hidden in the editor.
|
|
120
|
+
- **AI Education**: User-only, authoritative guidance read by the AI and never modified by it. It is also the sole place to request proactive notifications and define their conditions, duration, quiet hours and repetition.
|
|
121
|
+
- Relevant help, README, and example snippets are always included automatically; their language is selected from the user request, with automatic fallbacks across all supported languages.
|
|
134
122
|
- **Refresh** button: Queries the provider and loads available model IDs. Its icon spins while loading; successful completion is intentionally silent.
|
|
135
123
|
|
|
136
|
-
### Advanced
|
|
137
|
-
- **Analysis window (seconds)**: Main analysis window used for summaries/rates.
|
|
138
|
-
- **Max stored events**: Maximum number of telegrams kept in memory.
|
|
139
|
-
- **Top list size**: Number of top group addresses/sources in summary.
|
|
140
|
-
|
|
141
124
|
### Ollama quick setup (local)
|
|
142
125
|
- Choose **Provider = Ollama**.
|
|
143
126
|
- Default endpoint: `http://localhost:11434/api/chat`.
|
|
@@ -148,6 +131,13 @@ KNX AI automatically listens to `GroupValue_Write`, `GroupValue_Response`, and `
|
|
|
148
131
|
- If install fails with connection errors, ensure Ollama is running (desktop app or `ollama serve`).
|
|
149
132
|
- If Node-RED runs in Docker, use `host.docker.internal` instead of `localhost` in the endpoint URL.
|
|
150
133
|
|
|
134
|
+
### Bionic LM Studio quick setup (local)
|
|
135
|
+
- Choose **Provider = Bionic LM Studio**.
|
|
136
|
+
- Start the LM Studio API server from the **Developer** page or with `lms server start`.
|
|
137
|
+
- Default endpoint: `http://localhost:1234/v1/chat/completions`.
|
|
138
|
+
- Click **Refresh** to load all models exposed by `/v1/models`; the first model is selected when none is configured.
|
|
139
|
+
- An API key is optional unless authentication is enabled in the LM Studio server settings. In Docker, replace `localhost` with `host.docker.internal`.
|
|
140
|
+
|
|
151
141
|
## Security note
|
|
152
142
|
If LLM is enabled, KNX traffic context can be sent to the configured endpoint. Use local providers if you need strict on-prem data handling. A command emitted on output 4 passed local validation and was forwarded to the flow; it is not proof that the actuator executed it. Use a KNX status GA when confirmation is required.
|
|
153
143
|
</script>
|