diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6c3f32e..c614b47cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3`` - Berry `classof` extended to class methods (#21615) +- Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages (#21574) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8053c289e..6d2fd35b1 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -123,6 +123,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Added - Support for QMP6988 temperature and pressure sensor - Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3`` +- Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages [#21574](https://github.com/arendst/Tasmota/issues/21574) - Berry solidification of `bytes` instances [#21558](https://github.com/arendst/Tasmota/issues/21558) - Berry automatic rounding of float to int when calling C mapped functions [#21601](https://github.com/arendst/Tasmota/issues/21601) - Berry add `math.round` [#21602](https://github.com/arendst/Tasmota/issues/21602) diff --git a/tasmota/include/tasmota_types.h b/tasmota/include/tasmota_types.h index df628c1d4..cd5325aff 100755 --- a/tasmota/include/tasmota_types.h +++ b/tasmota/include/tasmota_types.h @@ -180,7 +180,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t data; // Allow bit manipulation using SetOption struct { // SetOption146 .. SetOption177 uint32_t use_esp32_temperature : 1; // bit 0 (v12.1.1.1) - SetOption146 - (ESP32) Show ESP32 internal temperature sensor - uint32_t mqtt_disable_sserialrec : 1; // bit 1 (v12.1.1.2) - SetOption147 - (MQTT) Disable publish SSerialReceived MQTT messages, you must use event trigger rules instead. + uint32_t mqtt_disable_publish : 1; // bit 1 (v12.1.1.2) - SetOption147 - (MQTT) Disable publish SSerialReceived/IRReceived MQTT messages, you must use event trigger rules instead. uint32_t artnet_autorun : 1; // bit 2 (v12.2.0.4) - SetOption148 - (Light) start DMX ArtNet at boot, listen to UDP port as soon as network is up uint32_t dns_ipv6_priority : 1; // bit 3 (v12.2.0.6) - SetOption149 - (Wifi) prefer IPv6 DNS resolution to IPv4 address when available. Requires `#define USE_IPV6` uint32_t no_voltage_common : 1; // bit 4 (v12.3.1.5) - SetOption150 - (Energy) Force no voltage/frequency common diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index e3b2e144c..3a77bfda0 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1137,7 +1137,7 @@ void SettingsDefaultSet2(void) { flag5.mqtt_status_retain |= MQTT_STATUS_RETAIN; flag5.mqtt_switches |= MQTT_SWITCHES; flag5.mqtt_persistent |= ~MQTT_CLEAN_SESSION; - flag6.mqtt_disable_sserialrec |= MQTT_DISABLE_SSERIALRECEIVED; + flag6.mqtt_disable_publish |= MQTT_DISABLE_SSERIALRECEIVED; flag6.mqtt_disable_modbus |= MQTT_DISABLE_MODBUSRECEIVED; // flag.mqtt_serial |= 0; flag.device_index_enable |= MQTT_POWER_FORMAT; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino index 271a34b9d..c64cfa5e9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino @@ -296,7 +296,11 @@ void IrReceiveCheck(void) } ResponseJsonEndEnd(); - MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED)); + if (Settings->flag6.mqtt_disable_publish ) { // SetOption147 - If it is activated, Tasmota will not publish IRReceived MQTT messages, but it will proccess event trigger rules + XdrvRulesProcess(0); + } else { + MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED)); + } #ifdef USE_DOMOTICZ if (iridx) { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino index e0f6da521..5b761eb73 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino @@ -375,7 +375,11 @@ void IrReceiveCheck(void) { } ResponseJsonEndEnd(); - MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED)); + if (Settings->flag6.mqtt_disable_publish ) { // SetOption147 - If it is activated, Tasmota will not publish IRReceived MQTT messages, but it will proccess event trigger rules + XdrvRulesProcess(0); + } else { + MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED)); + } } irrecv->resume(); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino index b4462e174..938194fc2 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino @@ -205,8 +205,7 @@ void SerialBridgeInput(void) { ResponseAppend_P(PSTR("\"")); } ResponseJsonEnd(); - - if (Settings->flag6.mqtt_disable_sserialrec ) { // SetOption147 If it is activated, Tasmota will not publish SSerialReceived MQTT messages, but it will proccess event trigger rules + if (Settings->flag6.mqtt_disable_publish ) { // SetOption147 - If it is activated, Tasmota will not publish SSerialReceived MQTT messages, but it will proccess event trigger rules XdrvRulesProcess(0); } else { MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));