Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages (#21574)

This commit is contained in:
Theo Arends 2024-06-14 11:23:03 +02:00
parent 9451f20b43
commit 75c47b6948
7 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -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) {

View File

@ -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();

View File

@ -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));