diff --git a/CHANGELOG.md b/CHANGELOG.md index 92266e07b..899e2be95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,13 @@ All notable changes to this project will be documented in this file. ### Added - Milliseconds to console output (#10152) - Support for P9813 RGB Led MOSFET controller (#10104) +- Support for GPIO option selection +- Gpio ``Option_a1`` enabling PWM1 high impedance if powered off and no fading as used by Wyze bulbs (#10196) ### Fixed - Redesign syslog and mqttlog using log buffer (#10164) - Shelly Dimmer power on state (#10154, #10182) +- Wemo emulation for single devices (#10165, #10194) ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9bbab68dd..44a355d7a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -60,7 +60,10 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota ### Added - Milliseconds to console output (#10152) - Support for P9813 RGB Led MOSFET controller (#10104) +- Support for GPIO option selection +- Gpio ``Option_a1`` enabling PWM1 high impedance if powered off and no fading as used by Wyze bulbs (#10196) ### Fixed - Redesign syslog and mqttlog using log buffer (#10164) - Shelly Dimmer power on state (#10154, #10182) +- Wemo emulation for single devices (#10165, #10194) diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index eb9f244b2..ad6fc6c04 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Няма" #define D_SENSOR_USER "Потребит." +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index f10a5f992..8b9ce3f26 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Není" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 6d03bd326..bc3e948bf 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "None" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 4fadbb25b..760dd4d20 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Κανένα" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index b1ecc40fa..92879c024 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "None" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 659cff6a6..1e8ffed22 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Ninguno" #define D_SENSOR_USER "Por Usuario" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index 46bc1a483..8133ef1f9 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -557,6 +557,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Aucun" #define D_SENSOR_USER "Utilisateur" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index 3b6ee9a76..04a4cb63d 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "None" #define D_SENSOR_USER "משתמש" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 1ec91f25b..deea51f5c 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Nincs" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index ccf015303..6d0e77e44 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Nessuno" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index db4d10ed0..10a25cdfc 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "없음" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 8b5634e8a..ba8a3498b 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Geen" #define D_SENSOR_USER "Gebruiker" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index 5c26e5ecb..fe11f8d3d 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Brak" #define D_SENSOR_USER "Użytkownik" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index cd521e2e4..22ef232ce 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Nenhum" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 1f15bb866..f72072461 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Nenhum" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 12035b0ae..335853c3e 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Fără" #define D_SENSOR_USER "Utilizator" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 2581bf066..017ab3c02 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "-нет-" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 55793792c..9914326e8 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Žiaden" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 74cb68450..14b1e615c 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Ingen" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 37bfeffb4..84d45c7bf 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "None" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 29b563563..e45043689 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Немає" #define D_SENSOR_USER "Користувач" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index bccb901b3..c8386cfd6 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "Không dùng" #define D_SENSOR_USER "Người Dùng" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 3f2143bb7..25b5c807c 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "无" #define D_SENSOR_USER "User" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 9807689ac..13c199320 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -561,6 +561,7 @@ // tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box #define D_SENSOR_NONE "無" #define D_SENSOR_USER "使用者" +#define D_SENSOR_OPTION "Option" #define D_SENSOR_DHT11 "DHT11" #define D_SENSOR_AM2301 "AM2301" #define D_SENSOR_SI7021 "SI7021" diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 38a8f2547..f9a501b39 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1534,7 +1534,11 @@ void GpioInit(void) XdrvMailbox.index = mpin; XdrvMailbox.payload = i; - if ((mpin >= AGPIO(GPIO_SWT1_NP)) && (mpin < (AGPIO(GPIO_SWT1_NP) + MAX_SWITCHES))) { + if ((mpin >= AGPIO(GPIO_OPTION_A)) && (mpin < (AGPIO(GPIO_OPTION_A) + MAX_OPTIONS_A))) { + bitSet(TasmotaGlobal.gpio_optiona.data, mpin - AGPIO(GPIO_OPTION_A)); + mpin = GPIO_NONE; + } + else if ((mpin >= AGPIO(GPIO_SWT1_NP)) && (mpin < (AGPIO(GPIO_SWT1_NP) + MAX_SWITCHES))) { SwitchPullupFlag(mpin - AGPIO(GPIO_SWT1_NP)); mpin -= (AGPIO(GPIO_SWT1_NP) - AGPIO(GPIO_SWT1)); } diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 2cb0eebd1..300c09b68 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -88,6 +88,7 @@ struct { uint32_t loop_load_avg; // Indicative loop load average uint32_t log_buffer_pointer; // Index in log buffer uint32_t uptime; // Counting every second until 4294967295 = 130 year + GpioOptionABits gpio_optiona; // GPIO Option_A flags power_t power; // Current copy of Settings.power power_t rel_inverted; // Relay inverted flag (1 = (0 = On, 1 = Off)) @@ -196,6 +197,7 @@ void setup(void) { memset(&TasmotaGlobal, 0, sizeof(TasmotaGlobal)); TasmotaGlobal.baudrate = APP_BAUDRATE; TasmotaGlobal.seriallog_timer = SERIALLOG_TIMER; + TasmotaGlobal.gpio_optiona.data = 0; TasmotaGlobal.temperature_celsius = NAN; TasmotaGlobal.blinks = 201; TasmotaGlobal.wifi_state_flag = WIFI_RESTART; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 3023fbf0c..2eefcf4a7 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -130,6 +130,7 @@ enum UserSelectablePins { GPIO_SHELLY_DIMMER_BOOT0, GPIO_SHELLY_DIMMER_RST_INV, GPIO_RC522_RST, // RC522 reset GPIO_P9813_CLK, GPIO_P9813_DAT, // P9813 Clock and Data + GPIO_OPTION_A, // Specific device options to be served in code GPIO_SENSOR_END }; enum ProgramSelectablePins { @@ -137,6 +138,46 @@ enum ProgramSelectablePins { GPIO_USER, // User configurable needs to be 2047 GPIO_MAX }; +#define MAX_OPTIONS_A 2 // Increase if more bits are used from GpioOptionABits + +typedef union { // Restricted by MISRA-C Rule 18.4 but so useful... + uint32_t data; // Allow bit manipulation using SetOption + struct { // GPIO Option_A1 .. Option_A32 + uint32_t pwm1_input : 1; // bit 0 (v9.2.0.1) - Option_A1 - (Light) Change PWM1 to input on power off and no fade running (1) + uint32_t spare01 : 1; // bit 1 + uint32_t spare02 : 1; // bit 2 + uint32_t spare03 : 1; // bit 3 + uint32_t spare04 : 1; // bit 4 + uint32_t spare05 : 1; // bit 5 + uint32_t spare06 : 1; // bit 6 + uint32_t spare07 : 1; // bit 7 + uint32_t spare08 : 1; // bit 8 + uint32_t spare09 : 1; // bit 9 + uint32_t spare10 : 1; // bit 10 + uint32_t spare11 : 1; // bit 11 + uint32_t spare12 : 1; // bit 12 + uint32_t spare13 : 1; // bit 13 + uint32_t spare14 : 1; // bit 14 + uint32_t spare15 : 1; // bit 15 + uint32_t spare16 : 1; // bit 16 + uint32_t spare17 : 1; // bit 17 + uint32_t spare18 : 1; // bit 18 + uint32_t spare19 : 1; // bit 19 + uint32_t spare20 : 1; // bit 20 + uint32_t spare21 : 1; // bit 21 + uint32_t spare22 : 1; // bit 22 + uint32_t spare23 : 1; // bit 23 + uint32_t spare24 : 1; // bit 24 + uint32_t spare25 : 1; // bit 25 + uint32_t spare26 : 1; // bit 26 + uint32_t spare27 : 1; // bit 27 + uint32_t spare28 : 1; // bit 28 + uint32_t spare29 : 1; // bit 29 + uint32_t spare30 : 1; // bit 30 + uint32_t spare31 : 1; // bit 31 + }; +} GpioOptionABits; + // Text in webpage Module Parameters and commands GPIOS and GPIO const char kSensorNames[] PROGMEM = D_SENSOR_NONE "|" @@ -239,7 +280,8 @@ const char kSensorNames[] PROGMEM = D_SENSOR_AS608_TX "|" D_SENSOR_AS608_RX "|" D_SENSOR_SHELLY_DIMMER_BOOT0 "|" D_SENSOR_SHELLY_DIMMER_RST_INV "|" D_SENSOR_RC522_RST "|" - D_SENSOR_P9813_CLK "|" D_SENSOR_P9813_DAT + D_SENSOR_P9813_CLK "|" D_SENSOR_P9813_DAT "|" + D_SENSOR_OPTION "_a|" ; const char kSensorNamesFixed[] PROGMEM = @@ -253,6 +295,7 @@ const char kSensorNamesFixed[] PROGMEM = const uint16_t kGpioNiceList[] PROGMEM = { GPIO_NONE, // Not used + AGPIO(GPIO_OPTION_A) + MAX_OPTIONS_A, // Device specific options AGPIO(GPIO_KEY1) + MAX_KEYS, // Buttons AGPIO(GPIO_KEY1_NP) + MAX_KEYS, AGPIO(GPIO_KEY1_INV) + MAX_KEYS, diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 9af684987..e89db84cc 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -2072,6 +2072,10 @@ void LightAnimate(void) // If the power is off and the fade is done, turn the relay off. if (PWM_DIMMER == TasmotaGlobal.module_type && !Light.power && !Light.fade_running) PWMDimmerSetPower(); #endif // USE_PWM_DIMMER + // For WYZE bulbs we must set the CT pin to INPUT to fully turn it off + if (TasmotaGlobal.gpio_optiona.pwm1_input && !Light.power && !Light.fade_running) { // GPIO Option_A1 + if (PinUsed(GPIO_PWM1)) { pinMode(Pin(GPIO_PWM1), INPUT); } + } } }