From 031422f783e775c5766ac4decc5953721705be01 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 25 Sep 2025 12:20:31 +0200 Subject: [PATCH] Show error when unknown data was received (#1013) --- lib/SvelteUi/app/translations.json | 1 + src/AmsToMqttBridge.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/SvelteUi/app/translations.json b/lib/SvelteUi/app/translations.json index 27239af6..43ae0915 100644 --- a/lib/SvelteUi/app/translations.json +++ b/lib/SvelteUi/app/translations.json @@ -324,6 +324,7 @@ "-51" : "Authentication failed", "-52" : "Decryption failed", "-53" : "Encryption key invalid", + "89" : "Unrecognized data received from meter", "90" : "No HAN data received for at least 30s", "91" : "Serial break", "92" : "Serial buffer full", diff --git a/src/AmsToMqttBridge.cpp b/src/AmsToMqttBridge.cpp index 988a9c70..84418300 100644 --- a/src/AmsToMqttBridge.cpp +++ b/src/AmsToMqttBridge.cpp @@ -46,6 +46,7 @@ ADC_MODE(ADC_VCC); #define METER_PARSER_PULSE 2 #define METER_PARSER_KAMSTRUP 9 +#define METER_ERROR_UNKNOWN_DATA 89 #define METER_ERROR_NO_DATA 90 #define METER_ERROR_BREAK 91 #define METER_ERROR_BUFFER 92 @@ -1345,6 +1346,8 @@ bool readHanPort() { if(data != NULL) { if(data->getListType() > 0) { handleDataSuccess(data); + } else { + meterState.setLastError(METER_ERROR_UNKNOWN_DATA); } delete data; }