From 76cffab6a4651579f97abe8a4bca1bc712cfa9a5 Mon Sep 17 00:00:00 2001 From: mikep1998 <44448320+mikep1998@users.noreply.github.com> Date: Tue, 9 Feb 2021 09:45:30 -0800 Subject: [PATCH 1/3] Update xdrv_27_shutter.ino --- tasmota/xdrv_27_shutter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 4b7836452..e35a09e1c 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -458,7 +458,7 @@ void ShutterPowerOff(uint8_t i) { switch (ShutterGlobal.position_mode) { case SHT_PWM_VALUE: char scmnd[20]; - snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM " %d" ),Shutter[i].pwm_value); + snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ),i ,Shutter[i].pwm_value); // Add device number to PWM command ExecuteCommand(scmnd, SRC_BUTTON); break; } From e086c62fbb15fe14245c3fccde2780a12eb16c55 Mon Sep 17 00:00:00 2001 From: mikep1998 <44448320+mikep1998@users.noreply.github.com> Date: Tue, 9 Feb 2021 09:55:13 -0800 Subject: [PATCH 2/3] Update xdrv_27_shutter.ino Fix shutter pwm command to include device number and update loggin information. --- tasmota/xdrv_27_shutter.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index e35a09e1c..589355075 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -429,7 +429,7 @@ void ShutterDecellerateForStop(uint8_t i) } void ShutterPowerOff(uint8_t i) { - AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i,Shutter[i].switch_mode); + AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i+1,Shutter[i].switch_mode); // fix log to indicate correct shutter number ShutterDecellerateForStop(i); switch (Shutter[i].switch_mode) { case SHT_SWITCH: @@ -458,7 +458,8 @@ void ShutterPowerOff(uint8_t i) { switch (ShutterGlobal.position_mode) { case SHT_PWM_VALUE: char scmnd[20]; - snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ),i ,Shutter[i].pwm_value); // Add device number to PWM command + AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Setting PWM%d. value: %d"), i+1,Shutter[i].pwm_value); + snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ),i+1 ,Shutter[i].pwm_value); // Add device number to PWM command ExecuteCommand(scmnd, SRC_BUTTON); break; } From 212ea2717078af5a921592a68e2aa5e95a3ea60f Mon Sep 17 00:00:00 2001 From: mikep1998 <44448320+mikep1998@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:51:38 -0800 Subject: [PATCH 3/3] Update xdrv_27_shutter.ino Add #define to turn off servo in ShutterPowerOff. --- tasmota/xdrv_27_shutter.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 589355075..b99499165 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -458,8 +458,12 @@ void ShutterPowerOff(uint8_t i) { switch (ShutterGlobal.position_mode) { case SHT_PWM_VALUE: char scmnd[20]; - AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Setting PWM%d. value: %d"), i+1,Shutter[i].pwm_value); - snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ),i+1 ,Shutter[i].pwm_value); // Add device number to PWM command +#ifdef SHUTTER_CLEAR_PWM_ONSTOP + // free the PWM servo lock on stop. + snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d 0" ), i+1); +#else + snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ), i+1,Shutter[i].pwm_value); +#endif ExecuteCommand(scmnd, SRC_BUTTON); break; }