Skip to content

Commit 75c47b6

Browse files
committed
Extend command SetOption147 1 to disable publish of IRReceived MQTT messages (#21574)
1 parent 9451f20 commit 75c47b6

File tree

7 files changed

+15
-6
lines changed

7 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Added
88
- Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3``
99
- Berry `classof` extended to class methods (#21615)
10+
- Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages (#21574)
1011

1112
### Breaking Changed
1213

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
123123
### Added
124124
- Support for QMP6988 temperature and pressure sensor
125125
- Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3``
126+
- Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages [#21574](https://github.com/arendst/Tasmota/issues/21574)
126127
- Berry solidification of `bytes` instances [#21558](https://github.com/arendst/Tasmota/issues/21558)
127128
- Berry automatic rounding of float to int when calling C mapped functions [#21601](https://github.com/arendst/Tasmota/issues/21601)
128129
- Berry add `math.round` [#21602](https://github.com/arendst/Tasmota/issues/21602)

tasmota/include/tasmota_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
180180
uint32_t data; // Allow bit manipulation using SetOption
181181
struct { // SetOption146 .. SetOption177
182182
uint32_t use_esp32_temperature : 1; // bit 0 (v12.1.1.1) - SetOption146 - (ESP32) Show ESP32 internal temperature sensor
183-
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.
183+
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.
184184
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
185185
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`
186186
uint32_t no_voltage_common : 1; // bit 4 (v12.3.1.5) - SetOption150 - (Energy) Force no voltage/frequency common

tasmota/tasmota_support/settings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ void SettingsDefaultSet2(void) {
11371137
flag5.mqtt_status_retain |= MQTT_STATUS_RETAIN;
11381138
flag5.mqtt_switches |= MQTT_SWITCHES;
11391139
flag5.mqtt_persistent |= ~MQTT_CLEAN_SESSION;
1140-
flag6.mqtt_disable_sserialrec |= MQTT_DISABLE_SSERIALRECEIVED;
1140+
flag6.mqtt_disable_publish |= MQTT_DISABLE_SSERIALRECEIVED;
11411141
flag6.mqtt_disable_modbus |= MQTT_DISABLE_MODBUSRECEIVED;
11421142
// flag.mqtt_serial |= 0;
11431143
flag.device_index_enable |= MQTT_POWER_FORMAT;

tasmota/tasmota_xdrv_driver/xdrv_05_irremote.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@ void IrReceiveCheck(void)
296296
}
297297

298298
ResponseJsonEndEnd();
299-
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
299+
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
300+
XdrvRulesProcess(0);
301+
} else {
302+
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
303+
}
300304

301305
#ifdef USE_DOMOTICZ
302306
if (iridx) {

tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ void IrReceiveCheck(void) {
375375
}
376376

377377
ResponseJsonEndEnd();
378-
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
378+
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
379+
XdrvRulesProcess(0);
380+
} else {
381+
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
382+
}
379383
}
380384

381385
irrecv->resume();

tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ void SerialBridgeInput(void) {
205205
ResponseAppend_P(PSTR("\""));
206206
}
207207
ResponseJsonEnd();
208-
209-
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
208+
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
210209
XdrvRulesProcess(0);
211210
} else {
212211
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));

0 commit comments

Comments
 (0)