diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c6461e85..5c9b3d2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ All notable changes to this project will be documented in this file. - Berry `int64` added `low32()` and `high32()` methods, used in Matter (#21728) - Matter support for 'Generic Switch' based on Tasmota Buttons (#21731) - Berry cam module and img class (#21743) +- Skip MQTT response if command is prefixed with underscore (#21740) +- Skip MQTT response if commands are executed prefixed with ``Backlog2`` (no delay) or ``Backlog3`` (#21740) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 11bb5e919..075953155 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -124,6 +124,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Support for QMP6988 temperature and pressure sensor - Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3`` - Support for Sonoff POWCT Ring [#21131](https://github.com/arendst/Tasmota/issues/21131) +- Skip MQTT response if command is prefixed with underscore [#21740](https://github.com/arendst/Tasmota/issues/21740) +- Skip MQTT response if commands are executed prefixed with ``Backlog2`` (no delay) or ``Backlog3`` [#21740](https://github.com/arendst/Tasmota/issues/21740) - Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages [#21574](https://github.com/arendst/Tasmota/issues/21574) - NeoPool data validation and communication statistics default enabled for ESP32 only [#21721](https://github.com/arendst/Tasmota/issues/21721) - ESP32 support for power and energy limit checks, like ``MaxEnergy2`` per phase [#21695](https://github.com/arendst/Tasmota/issues/21695) diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 19aca977b..b227ce596 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -374,7 +374,7 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) { } char stemp1[TOPSZ]; - GetFallbackTopic_P(stemp1, ""); // Full Fallback topic = cmnd/DVES_xxxxxxxx_fb/ + GetFallbackTopic_P(stemp1, ""); // Full Fallback topic = cmnd/DVES_xxxxxxxx_fb/ TasmotaGlobal.fallback_topic_flag = (!strncmp(topicBuf, stemp1, strlen(stemp1))); char *type = strrchr(topicBuf, '/'); // Last part of received topic is always the command (type) @@ -384,13 +384,13 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) { if (type != nullptr) { type++; uint32_t i; - int nLen; // strlen(type) + int nLen; // strlen(type) char *s = type; for (nLen = 0; *s; s++, nLen++) { *s=toupper(*s); } i = nLen; - if (i > 0) { // may be 0 + if (i > 0) { // may be 0 while (isdigit(type[i-1])) { i--; } @@ -400,13 +400,17 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) { user_index = true; } type[i] = '\0'; + if ((i > 1) && ('_' == type[0])) { + type++; // Skip leading _ in command + TasmotaGlobal.no_mqtt_response = true; + } - bool binary_data = (index > 299); // Suppose binary data on topic index > 299 + bool binary_data = (index > 299); // Suppose binary data on topic index > 299 if (!binary_data) { bool keep_spaces = ((strstr_P(type, PSTR("SERIALSEND")) != nullptr) && (index > 9)); // Do not skip leading spaces on (s)serialsend10 and up if (!keep_spaces) { while (*dataBuf && isspace(*dataBuf)) { - dataBuf++; // Skip leading spaces in data + dataBuf++; // Skip leading spaces in data data_len--; } }