diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 97fba4b6c..10bbcc495 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -565,7 +565,7 @@ bool SendKey(uint32_t key, uint32_t device, uint32_t state) result = XdrvRulesProcess(0); } #ifdef USE_PWM_DIMMER - if (PWM_DIMMER != TasmotaGlobal.module_type || !result) { + if (PWM_DIMMER != TasmotaGlobal.module_type || (!result && !Settings->flag3.mqtt_buttons)) { #endif // USE_PWM_DIMMER int32_t payload_save = XdrvMailbox.payload; XdrvMailbox.payload = device_save << 24 | key << 16 | state << 8 | device; diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index 261caa0c7..4b5101818 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -758,7 +758,7 @@ bool Xdrv35(uint8_t function) case FUNC_BUTTON_PRESSED: // If the button is pressed or was just released, ... - if (!XdrvMailbox.payload || button_pressed[XdrvMailbox.index]) { + if (!Settings->flag3.mqtt_buttons && (!XdrvMailbox.payload || button_pressed[XdrvMailbox.index])) { uint32_t button_index = XdrvMailbox.index; uint32_t now = millis();