From 92a6f6672caececd3385c908b32bd3283b46260a Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 21 Aug 2019 15:31:31 +0100 Subject: [PATCH] Tuya Fix: Dimmer doesn't switch on from HASS Tuya serial dimmer doesn't switch on from HASS because when powered off, HASS sends dimmer command. Internally, dimmer update and power command are sent too quickly to serial out and switch doesn't turn on. Adding a delay fixes things. --- sonoff/xdrv_16_tuyadimmer.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/sonoff/xdrv_16_tuyadimmer.ino b/sonoff/xdrv_16_tuyadimmer.ino index 6a916bd0f..a74e418f9 100644 --- a/sonoff/xdrv_16_tuyadimmer.ino +++ b/sonoff/xdrv_16_tuyadimmer.ino @@ -139,6 +139,7 @@ bool TuyaSetPower(void) bool TuyaSetChannels(void) { LightSerialDuty(((uint8_t*)XdrvMailbox.data)[0]); + delay(20); // Hack when power is off and dimmer is set then both commands go too soon to Serial out. return true; }