node-red-contrib-knx-ultimate 6.3.22 → 6.3.24

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 CHANGED
@@ -6,6 +6,20 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 6.3.24** - August 2026<br/>
10
+
11
+ - **KNX AI — working Telegram confirmation buttons**: changed the `windkh/node-red-contrib-telegrambot` preset from inline callbacks to a one-time Telegram reply keyboard. **Confirm** and **Cancel** now return as normal localized messages through the already connected `telegram receiver`, eliminating the silent no-op caused by a missing `callback_query` event node. Existing saved preset output mappings are upgraded at runtime, the keyboard is removed after the decision, and legacy callback events remain accepted. The importable direct-chat example no longer requires extra callback wiring; help and wiki documentation were updated in EN, IT, DE, FR, ES and zh-CN.<br/>
12
+ - **KNX AI — native CHAT learning memory**: replaced the verbose Markdown/JSON V2 learning file with the direct line-oriented `knxai-chat-context.knxctx` V3 format. Sessions, instructions, turns and camera watches are stored as editable tab-separated `SESSION`, `INSTRUCTION`, `TURN`, `CAMERA_WATCH` and `END_SESSION` records with escaped text fields, without JSON serialization or a regenerated preview. The Web UI keeps copy, download, restore, revision-safe save and protected reinitialization. Previous `.md` Markdown/JSON V2 and Base64 V1 files are deliberately not read, imported, migrated or deleted; KNX AI starts a new native context instead. Help and wiki documentation were updated in EN, IT, DE, FR, ES and zh-CN.<br/>
13
+ - **KNX AI — compact LLM settings layout**: constrained the assistant connection form to a readable responsive width and removed the fixed 290 px indentation that allowed the local-context hint and status line to widen the complete Node-RED properties panel. The model autocomplete now reopens after mouse release, so the full provider list remains visible after a normal click instead of appearing only while the button is held.<br/>
14
+ - **KNX AI — resettable CHAT learning**: added a protected **Reinitialize Memory** action to **Settings → AI Chat Learning**. After explicit confirmation it atomically replaces the shared learning file with a new empty native context, clears sessions, persistent instructions, camera watches and pending chat confirmations across every KNX AI node using the same storage, and refreshes the editor immediately. Concurrent changes remain protected by the existing content revision check.<br/>
15
+ - **KNX AI — complete model picker**: clicking the model field now opens the complete list returned by the selected provider regardless of the text already present, while typed text can still filter the same list and custom model names remain accepted.<br/>
16
+ - **KNX AI — native compact context archives**: replaced JSONL serialization for KNX telegram and detected-adapter history with KNX AI's direct line-oriented `.knxctx` format. Typed payloads, flags and bounded adapter metadata round-trip without repeated JSON property names, while bus and archive summaries are rendered as compact `key=value` context instead of JSON before reaching the model. Existing JSONL archives are deliberately not read or migrated; new daily files use `YYYY-MM-DD.knxctx`. The user-editable CHAT learning file remains separate because it is also a portable user backup surface. Context cards, editor help and wiki documentation were updated in EN, IT, DE, FR, ES and zh-CN.<br/>
17
+ - **KNX AI — user-selectable local chat context**: added a localized **Chat context amount** selector for Ollama and Bionic LM Studio with 4K, 8K and 16K choices; 16K remains the default. The selected budget proportionally bounds KNX traffic, archives, ETS catalog, Node-RED inventory, memory and adapter context, and is also sent as Ollama's `num_ctx`, while the complete agent tool contract stays available without phrase classifiers, keyword gates or linguistic intent routing. The context overview now reports the configured operational limit. Editor help and wiki documentation were updated in EN, IT, DE, FR, ES and zh-CN.<br/>
18
+ - **KNX AI — reliable conversational recall**: verified that session IDs and recent turns were already persisted correctly, then moved the current session memory next to the current request in the operational prompt so small local models do not lose user-supplied facts inside large KNX context. The structured memory tool now explicitly covers durable user facts such as preferred name and language as well as preferences and instructions, while remaining model-selected with no phrase classifiers or intent routing; credentials, security codes and API keys are excluded.<br/>
19
+ - **KNX AI — editable and portable CHAT learning**: added **Settings → AI Chat Learning** to the Vue web UI for viewing the exact absolute path and editing, copying, downloading or restoring the shared learning file. The **Conversations & home** tab in the Node-RED node configuration includes a localized shortcut that opens the Web UI directly on this editor for the current node. Saves are validated, bounded to 512 KB, written atomically and applied immediately to every KNX AI node sharing the same storage, while revision checks prevent stale editors from overwriting newer learning. UI strings, editor help and wiki documentation were updated in EN, IT, DE, FR, ES and zh-CN.<br/>
20
+ - **KNX AI — intent-free agentic chat tools**: removed hard-coded semantic phrase classifiers from conversational routing. Every Ask/CHAT request now lets the model reason directly over the current goal, persistent user guidance, AI Education and the available structured KNX, camera, TTS Ultimate and memory tools. Routine planning no longer depends on a multilingual keyword list, TTS announcements no longer require an action alias, and durable chat instructions are remembered or forgotten through model-selected structured actions instead of regular-expression intent detection. Runtime argument validation, adapter availability checks, ETS/DPT safeguards and command confirmation remain unchanged.<br/>
21
+ - **KNX AI — learned KNX group-address roles**: a `neutral` GA is now treated as unresolved rather than permanently uncontrollable. The conversational model can learn or forget the exact `command`, `status` or `neutral` role from trusted user teaching, persistent chat guidance, AI Education or unequivocal ETS semantics through the structured `gaRoleActions` tool. Learned role, reason and evidence are persisted per node in `knxai-config-<node-id>.json`, synchronized into bounded semantic home memory and reused after restart. A command role learned in the current answer can validate a write in that same turn, while exact ETS membership, immutable DPT, payload validation and configured confirmation still apply. Help and wiki documentation were aligned in EN, IT, DE, FR, ES and zh-CN.<br/>
22
+
9
23
  **Version 6.3.22** - August 2026<br/>
10
24
 
11
25
  - **KNX AI — visible context size and real prompt weight**: the “Chat context overview” card now shows the current operational context limit and the actual UTF-8 size of the last operational chat prompt. Ollama, Bionic, OpenAI-compatible and Claude token-usage fields are captured when returned by the provider; otherwise the UI clearly labels the token count as an estimate. Local limits reflect the active context without exceeding KNX AI's 16K cap.<br/>
@@ -4,7 +4,7 @@
4
4
  "type": "tab",
5
5
  "label": "KNX AI - Telegrambot direct chat",
6
6
  "disabled": false,
7
- "info": "Direct chat wiring for windkh/node-red-contrib-telegrambot using the KNX AI chat-adapter preset."
7
+ "info": "Direct chat wiring for windkh/node-red-contrib-telegrambot using the KNX AI chat-adapter preset. Confirmation buttons return through the same receiver; no callback event node is required."
8
8
  },
9
9
  {
10
10
  "id": "comment_knx_ai_telegram_setup",
@@ -53,22 +53,6 @@
53
53
  []
54
54
  ]
55
55
  },
56
- {
57
- "id": "telegram_callback_knx_ai",
58
- "type": "telegram event",
59
- "z": "tab_knx_ai_telegram",
60
- "name": "Confirm / Cancel buttons",
61
- "bot": "telegram_bot_knx_ai",
62
- "event": "callback_query",
63
- "autoanswer": true,
64
- "x": 190,
65
- "y": 240,
66
- "wires": [
67
- [
68
- "node_knx_ai_telegram"
69
- ]
70
- ]
71
- },
72
56
  {
73
57
  "id": "node_knx_ai_telegram",
74
58
  "type": "knxUltimateAI",
@@ -5,6 +5,37 @@
5
5
  align-items: flex-start;
6
6
  }
7
7
 
8
+ #knx-ai-llm-connection-settings {
9
+ width: 100%;
10
+ max-width: 720px;
11
+ min-width: 0;
12
+ }
13
+
14
+ #knx-ai-llm-connection-settings .form-row {
15
+ min-width: 0;
16
+ }
17
+
18
+ #knx-ai-local-context-status,
19
+ .knx-ai-prompt-context-hint {
20
+ width: 100%;
21
+ max-width: 720px;
22
+ min-width: 0;
23
+ box-sizing: border-box;
24
+ color: var(--red-ui-secondary-text-color, #777);
25
+ font-size: 12px;
26
+ line-height: 1.4;
27
+ white-space: normal;
28
+ overflow-wrap: break-word;
29
+ }
30
+
31
+ #knx-ai-local-context-status {
32
+ margin: -8px 0 12px;
33
+ }
34
+
35
+ .knx-ai-prompt-context-hint {
36
+ margin: 6px 0 0;
37
+ }
38
+
8
39
  #knx-ai-ollama-install-row>label {
9
40
  padding-top: 6px;
10
41
  }
@@ -138,7 +169,8 @@
138
169
  }
139
170
 
140
171
  #knx-ai-detected-adapters-panel,
141
- #knx-ai-chat-context-panel {
172
+ #knx-ai-chat-context-panel,
173
+ #knx-ai-chat-learning-link-panel {
142
174
  margin: 0 0 18px;
143
175
  padding: 12px 14px;
144
176
  border: 1px solid var(--red-ui-form-input-border-color, #ccc);
@@ -155,7 +187,8 @@
155
187
  }
156
188
 
157
189
  #knx-ai-detected-adapters-panel>h4,
158
- #knx-ai-chat-context-panel>h4 {
190
+ #knx-ai-chat-context-panel>h4,
191
+ #knx-ai-chat-learning-link-panel>h4 {
159
192
  margin: 0 0 9px;
160
193
  font-size: 14px;
161
194
  font-weight: 600;
@@ -189,6 +222,17 @@
189
222
  font-size: 12px;
190
223
  }
191
224
 
225
+ #knx-ai-chat-learning-link-panel {
226
+ margin: 18px 0 0;
227
+ }
228
+
229
+ .knx-ai-chat-learning-link-copy {
230
+ margin: 0 0 10px;
231
+ color: var(--red-ui-secondary-text-color, #777);
232
+ font-size: 12px;
233
+ line-height: 1.45;
234
+ }
235
+
192
236
  .knx-ai-chat-context-metric {
193
237
  margin-top: 6px;
194
238
  font-weight: 600;
@@ -273,6 +317,7 @@
273
317
  llmBaseUrl: { value: "https://api.openai.com/v1/chat/completions" },
274
318
  llmModel: { value: "gpt-5.4" },
275
319
  llmContextLength: { value: 0 },
320
+ llmPromptContextTokens: { value: 16384 },
276
321
  llmAllowKnxCommands: { value: false },
277
322
  llmRequireCommandConfirmation: { value: true },
278
323
  chatAdapterPreset: { value: "none" },
@@ -398,6 +443,13 @@
398
443
  } catch (error) { }
399
444
  delete node[key];
400
445
  });
446
+ try {
447
+ const $model = $("#node-input-llmModel");
448
+ $model.off(".knxUltimateAiModelPicker");
449
+ if (typeof $model.autocomplete === "function" && $model.data("ui-autocomplete")) {
450
+ $model.autocomplete("destroy");
451
+ }
452
+ } catch (error) { }
401
453
  };
402
454
 
403
455
  try {
@@ -658,7 +710,11 @@
658
710
  const currentProvider = String(contextLimit.provider || $("#node-input-llmProvider").val() || "").toLowerCase();
659
711
  let contextLimitTokens = Math.max(0, Number(contextLimit.tokens) || 0);
660
712
  if (!contextLimitTokens && (currentProvider === "lmstudio" || currentProvider === "ollama")) {
661
- contextLimitTokens = Math.min(Math.max(0, Number($("#node-input-llmContextLength").val()) || 16384), 16384);
713
+ contextLimitTokens = Math.min(
714
+ Math.max(0, Number($("#node-input-llmContextLength").val()) || 16384),
715
+ Math.max(0, Number($("#node-input-llmPromptContextTokens").val()) || 16384),
716
+ 16384
717
+ );
662
718
  }
663
719
  const contextLimitValue = contextLimitTokens
664
720
  ? formatCompactTokens(contextLimitTokens) + " " + t("knxUltimateAI.messages.chatContextTokens", "tokens")
@@ -742,7 +798,7 @@
742
798
  });
743
799
 
744
800
  $("#knx-ai-chat-context-pattern")
745
- .text(t("knxUltimateAI.messages.chatContextTelegramPattern", "Daily files") + ": " + String(overview.telegramFilePattern || "YYYY-MM-DD.jsonl"));
801
+ .text(t("knxUltimateAI.messages.chatContextTelegramPattern", "Daily files") + ": " + String(overview.telegramFilePattern || "YYYY-MM-DD.knxctx"));
746
802
  $status.hide();
747
803
  $content.show();
748
804
  };
@@ -763,17 +819,30 @@
763
819
  renderChatContextOverview(null);
764
820
  });
765
821
 
766
- $("#knx-ai-open-web-page-vue").on("click", function (evt) {
767
- evt.preventDefault();
822
+ const openKnxAiWebPage = function (view) {
768
823
  const adminRoot = resolveAdminRoot();
769
824
  const targetBase = adminRoot + "/knxUltimateAI/sidebar/page";
770
825
  const params = new URLSearchParams();
771
826
  if (nodeId) params.set("nodeId", nodeId);
827
+ if (view === "chat-learning") {
828
+ params.set("tab", "settings");
829
+ params.set("settingsTab", "learning");
830
+ }
772
831
  const accessToken = resolveAccessToken();
773
832
  if (accessToken) params.set("access_token", accessToken);
774
833
  const target = targetBase + (params.toString() ? ("?" + params.toString()) : "");
775
834
  const wnd = window.open(target, "_blank", "noopener,noreferrer");
776
835
  try { if (wnd && typeof wnd.focus === "function") wnd.focus(); } catch (e) { }
836
+ };
837
+
838
+ $("#knx-ai-open-web-page-vue").on("click", function (evt) {
839
+ evt.preventDefault();
840
+ openKnxAiWebPage();
841
+ });
842
+
843
+ $("#knx-ai-open-chat-learning").on("click", function (evt) {
844
+ evt.preventDefault();
845
+ openKnxAiWebPage("chat-learning");
777
846
  });
778
847
 
779
848
  const setRefreshModelsBusy = (busy) => {
@@ -788,6 +857,8 @@
788
857
  };
789
858
 
790
859
  let localModelDetailsById = new Map();
860
+ let availableModelItems = [];
861
+ let modelPickerMouseDown = false;
791
862
  let localContextRequestVersion = 0;
792
863
 
793
864
  const formatContextTokens = (value) => {
@@ -823,28 +894,63 @@
823
894
  text += " · " + t("knxUltimateAI.messages.lmStudioContextCurrentlyLoaded", "currently loaded") + ": " + loadedTokens + " token";
824
895
  }
825
896
  if (provider === "lmstudio" || provider === "ollama") {
826
- text += " · " + t("knxUltimateAI.messages.localContextBudget", "KNX AI context budget") + ": 16K";
897
+ const selectedBudget = Math.max(4096, Number($("#node-input-llmPromptContextTokens").val()) || 16384);
898
+ text += " · " + t("knxUltimateAI.messages.localContextBudget", "KNX AI context budget") + ": " + (selectedBudget / 1024) + "K";
827
899
  }
828
900
  $status.text(text).css("color", color).show();
829
901
  };
830
902
 
831
903
  const populateModels = (models, modelDetails) => {
832
- const $dl = $("#knx-ai-llmModels");
833
- if (!$dl || $dl.length === 0) return;
834
904
  localModelDetailsById = new Map();
835
905
  (modelDetails || []).forEach(function (detail) {
836
906
  if (detail && detail.id) localModelDetailsById.set(String(detail.id), detail);
837
907
  });
838
- $dl.empty();
839
- (models || []).forEach(function (m) {
908
+ availableModelItems = (models || []).map(function (m) {
840
909
  const detail = localModelDetailsById.get(String(m));
841
910
  const label = detail
842
911
  ? String(detail.displayName || detail.id) + " · " + formatContextTokens(detail.maxContextLength) + " token"
843
912
  : String(m);
844
- $("<option>").attr("value", m).attr("label", label).appendTo($dl);
913
+ return { label: label, value: String(m) };
845
914
  });
846
915
  };
847
916
 
917
+ const configureModelPicker = () => {
918
+ const $model = $("#node-input-llmModel");
919
+ if (!$model.length || typeof $model.autocomplete !== "function") return;
920
+ $model.autocomplete({
921
+ minLength: 0,
922
+ source: function (request, response) {
923
+ const term = String(request && request.term ? request.term : "").trim().toLowerCase();
924
+ if (!term) {
925
+ response(availableModelItems.slice());
926
+ return;
927
+ }
928
+ response(availableModelItems.filter(function (item) {
929
+ return item.value.toLowerCase().includes(term) || item.label.toLowerCase().includes(term);
930
+ }));
931
+ },
932
+ select: function (event, ui) {
933
+ $(this).val(ui.item.value).trigger("change");
934
+ return false;
935
+ }
936
+ });
937
+ $model.on("mousedown.knxUltimateAiModelPicker", function () {
938
+ modelPickerMouseDown = true;
939
+ }).on("focus.knxUltimateAiModelPicker", function () {
940
+ if (!modelPickerMouseDown) $(this).autocomplete("search", "");
941
+ }).on("click.knxUltimateAiModelPicker", function () {
942
+ modelPickerMouseDown = false;
943
+ const input = this;
944
+ setTimeout(function () {
945
+ try { $(input).autocomplete("search", ""); } catch (error) { }
946
+ }, 0);
947
+ }).on("blur.knxUltimateAiModelPicker", function () {
948
+ modelPickerMouseDown = false;
949
+ });
950
+ };
951
+
952
+ configureModelPicker();
953
+
848
954
  const normalizeUrl = (value) => String(value || "").trim().replace(/\/+$/, "").toLowerCase();
849
955
  const isOpenAiDefaultUrl = (value) => normalizeUrl(value) === normalizeUrl(OPENAI_COMPAT_DEFAULT_CHAT_URL);
850
956
  const isOllamaDefaultUrl = (value) => normalizeUrl(value) === normalizeUrl(OLLAMA_DEFAULT_CHAT_URL);
@@ -1044,7 +1150,9 @@
1044
1150
 
1045
1151
  const toggleProvider = ({ applyDefaults = false, autoLoadModels = false } = {}) => {
1046
1152
  const provider = $("#node-input-llmProvider").val();
1153
+ const localProvider = provider === "lmstudio" || provider === "ollama";
1047
1154
  if (applyDefaults) applyProviderDefaults(provider);
1155
+ $("#knx-ai-prompt-context-row").toggle(localProvider);
1048
1156
  if (provider === "ollama") {
1049
1157
  $("#knx-ai-apikey-row").hide();
1050
1158
  $("#knx-ai-ollama-install-row").show();
@@ -1071,6 +1179,10 @@
1071
1179
  $("#node-input-llmModel").on("change", function () {
1072
1180
  configureSelectedLocalModel();
1073
1181
  });
1182
+ $("#node-input-llmPromptContextTokens").on("change", function () {
1183
+ const detail = localModelDetailsById.get(String($("#node-input-llmModel").val() || "").trim());
1184
+ if (detail) setLocalModelContextStatus(detail, detail.loadedContextLength > 0 ? "configured" : "inactive");
1185
+ });
1074
1186
  $("#knx-ai-downloadOllamaModel").on("click", function (evt) {
1075
1187
  evt.preventDefault();
1076
1188
  openOllamaLibrary();
@@ -1171,6 +1283,13 @@
1171
1283
  <h4><i class="fa fa-home"></i> <span data-i18n="knxUltimateAI.sections.homeIntelligence"></span></h4>
1172
1284
  <div class="knx-ai-accordion-mount" id="knx-ai-mount-home-intelligence"></div>
1173
1285
  </div>
1286
+ <div id="knx-ai-chat-learning-link-panel">
1287
+ <h4><i class="fa fa-graduation-cap"></i> <span data-i18n="knxUltimateAI.sections.chatLearning"></span></h4>
1288
+ <p class="knx-ai-chat-learning-link-copy" data-i18n="knxUltimateAI.messages.chatLearningOpenHint"></p>
1289
+ <button type="button" class="red-ui-button" id="knx-ai-open-chat-learning">
1290
+ <i class="fa fa-external-link"></i> <span data-i18n="knxUltimateAI.buttons.openChatLearning"></span>
1291
+ </button>
1292
+ </div>
1174
1293
  <div id="knx-ai-detected-adapters-panel">
1175
1294
  <h4><i class="fa fa-puzzle-piece"></i> <span data-i18n="knxUltimateAI.sections.detectedAdapters"></span></h4>
1176
1295
  <div id="knx-ai-detected-adapters-status" data-i18n="knxUltimateAI.messages.detectedAdaptersLoading"></div>
@@ -1226,14 +1345,22 @@
1226
1345
 
1227
1346
  <div class="form-row">
1228
1347
  <label style="width:290px" for="node-input-llmModel"><i class="fa fa-cube"></i> <span data-i18n="knxUltimateAI.properties.llmModel"></span></label>
1229
- <input style="width:calc(100% - 110px)" type="text" id="node-input-llmModel" list="knx-ai-llmModels" data-i18n="[placeholder]knxUltimateAI.placeholder.llmModel">
1348
+ <input style="width:calc(100% - 110px)" type="text" id="node-input-llmModel" autocomplete="off" data-i18n="[placeholder]knxUltimateAI.placeholder.llmModel">
1230
1349
  <button type="button" class="red-ui-button" id="knx-ai-refreshModels" style="margin-left:6px;" title="Refresh models">
1231
1350
  <i class="fa fa-refresh"></i> <span data-i18n="knxUltimateAI.buttons.refreshModels"></span>
1232
1351
  </button>
1233
1352
  </div>
1234
- <datalist id="knx-ai-llmModels"></datalist>
1235
1353
  <input type="hidden" id="node-input-llmContextLength">
1236
- <div id="knx-ai-local-context-status" style="display:none; margin:-8px 0 12px 290px; font-size:12px;"></div>
1354
+ <div id="knx-ai-local-context-status" style="display:none;"></div>
1355
+ <div class="form-row" id="knx-ai-prompt-context-row" style="display:none;">
1356
+ <label style="width:290px" for="node-input-llmPromptContextTokens"><i class="fa fa-database"></i> <span data-i18n="knxUltimateAI.properties.llmPromptContextTokens"></span></label>
1357
+ <select style="width:100%" id="node-input-llmPromptContextTokens">
1358
+ <option value="4096" data-i18n="knxUltimateAI.selectlists.promptContext.small"></option>
1359
+ <option value="8192" data-i18n="knxUltimateAI.selectlists.promptContext.medium"></option>
1360
+ <option value="16384" data-i18n="knxUltimateAI.selectlists.promptContext.full"></option>
1361
+ </select>
1362
+ <div class="knx-ai-prompt-context-hint" data-i18n="knxUltimateAI.messages.promptContextHint"></div>
1363
+ </div>
1237
1364
  <div class="form-row">
1238
1365
  <input type="checkbox" id="node-input-llmAllowKnxCommands" style="display:inline-block; width:auto; vertical-align:top;">
1239
1366
  <label style="width:auto" for="node-input-llmAllowKnxCommands">&nbsp;&nbsp;<span data-i18n="knxUltimateAI.properties.llmAllowKnxCommands"></span></label>