diff --git a/BUILDS.md b/BUILDS.md
index aa1834061..88ee58cd0 100644
--- a/BUILDS.md
+++ b/BUILDS.md
@@ -62,6 +62,7 @@
| USE_DDS2382 | - | - | - | - | x | - | - |
| USE_DDSU666 | - | - | - | - | x | - | - |
| USE_SOLAX_X1 | - | - | - | - | - | - | - |
+| USE_LE01MR | - | - | - | - | - | - | - |
| | | | | | | | |
| USE_ADC_VCC | x | x | - | - | - | - | - |
| USE_COUNTER | - | - | x | x | x | x | x |
@@ -109,6 +110,8 @@
| USE_HIH6 | - | - | - | - | x | - | - |
| USE_DHT12 | - | - | - | - | x | - | - |
| USE_DS1624 | - | - | - | - | x | - | - |
+| USE_AHT1x | - | - | - | - | - | - | - |
+| USE_WEMOS_MOTOR_V1 | - | - | - | - | x | - | - |
| | | | | | | | |
| Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks
| USE_SPI | - | - | - | - | - | - | x |
@@ -124,6 +127,10 @@
| USE_RDM6300 | - | - | - | - | x | - | - |
| USE_IBEACON | - | - | - | - | x | - | - |
| USE_GPS | - | - | - | - | - | - | - |
+| USE_HM10 | - | - | - | - | x | - | - |
+| | | | | | | | |
+| USE_NRF24 | - | - | - | - | - | - | - |
+| USE_MIBLE | - | - | - | - | - | - | - |
| USE_ZIGBEE | - | - | - | - | - | - | - |
| | | | | | | | |
| USE_IR_REMOTE | - | - | x | x | x | x | x |
diff --git a/I2CDEVICES.md b/I2CDEVICES.md
index b607b3241..f9cf5b0e3 100644
--- a/I2CDEVICES.md
+++ b/I2CDEVICES.md
@@ -65,3 +65,4 @@ Index | Define | Driver | Device | Address(es) | Description
42 | USE_DS1624 | xsns_59 | DS1621 | 0x48 - 0x4F | Temperature sensor
42 | USE_DS1624 | xsns_59 | DS1624 | 0x48 - 0x4F | Temperature sensor
43 | USE_AHT1x | xsns_63 | AHT10/15 | 0x38 | Temperature and humidity sensor
+ 44 | USE_WEMOS_MOTOR_V1 | xdrv_34 | | 0x2D - 0x30 | WEMOS motor shield v1.0.0 (6612FNG)
diff --git a/MODULES.md b/MODULES.md
index bb02bfe73..be1d5d110 100644
--- a/MODULES.md
+++ b/MODULES.md
@@ -76,5 +76,6 @@ Module | Description
70 Sonoff L1 | Sonoff L1 light strip
71 Sonoff iFan03 | Sonoff iFan03 Wifi Smart Ceiling Fan with Light
72 EXS Dimmer | EXS Wifi Dimmer v4
+73 PWM Dimmer | Martin Jerry/acenx/Tessan/NTONPOWER SD0x PWM Dimmer Switches
Over 600 additional devices are supported using [templates](TEMPLATES.md).
diff --git a/PWM_Dimmer.md b/PWM_Dimmer.md
new file mode 100644
index 000000000..528b3f9fb
--- /dev/null
+++ b/PWM_Dimmer.md
@@ -0,0 +1,197 @@
+# PWM Dimmer
+
+The PWM Dimmer module adds support for Martin Jerry/acenx/Tessan/NTONPOWER SD0x PWM dimmer switches. The brightness of the load for these dimmers is controlled by a PWM GPIO pin. They typically have power, up and down buttons, a powered-on LED, five brightness LEDs and another status LED. Examples are:[ https://www.amazon.com/dp/B07FXYSVR1](https://www.amazon.com/dp/B07FXYSVR1),[ https://www.amazon.com/dp/B07V26Q3VD](https://www.amazon.com/dp/B07V26Q3VD),[ https://www.amazon.com/dp/B07K67D43J](https://www.amazon.com/dp/B07K67D43J),[ https://www.amazon.com/dp/B07TTGFWFM](https://www.amazon.com/dp/B07TTGFWFM)
+
+To include PWM dimmer support in the build, define USE_PWM_DIMMER in your user_config_override. This adds 4.5K to the code size. The light module is not required for PWM dimmer operation so you can #undef USE_LIGHT to reduce the firmware bin size.
+
+To enable PWM dimmer operation, select the PWM Dimmer module.
+
+
+## PWM Dimmer Operation
+
+Pressing and releasing the power button toggles the power on/off. If the toggle turns the power on, the load is returned to the last brightness it was adjusted to. If Fade is enabled, the load is faded on/off at the rate defined by the Speed setting.
+
+When the power is on, holding the down or up button decreases/increases the brightness (PWM value). The brightness is changed faster as higher brightnesses. The BriMin command defines the lowest value the brightness can be decreased to.
+
+The brightness can also be changed using just the power button. When the power is on, holding the power button alternately increases or decreases the brightness. Initially, holding the power button increases the brightness. Releasing and then holding the power button again decreases the brightness.
+
+When the power is off, holding the down or up button turns the power on at a temporary brightness of the low/high levels set by the BriPreset command (default =10,255). Turning the power on at the low preset can also be accomplished by holding the power button while the power is off. The brightness presets are intended to enable quickly turning on a light to a dim or bright level without changing the normal desired brightness. Turning the power on to a preset does not change the brightness the load will be set to when the switch is turned on the next time. For example, if the light is on and you adjust the brightness to 80 and then turn the light off, when you turn it back on, the brightness will return to 80. If you turn the power off again and then press the down button, the light will be turned on with a brightness of the low preset. If you then turn the light off and on again, the brightness will return to 80.
+
+If there are LED’s defined in the template, they are turned on to indicate the current brightness. More LEDs are turned on at higher brightnesses. The LedTimeout command enables/disables an LED timeout. If LED timeout is enabled, the LED’s turn off five seconds after the last change in brightness. Note that the lowest LED and the blue power LED are always on when the power is on.
+
+The LEDLink LED can be used as a nightlight/powered-off indicator. The PoweredOffLed command enables/disables turning the LEDLink LED on when the power is off.
+
+Tapping (pressing and releasing quickly) the down or up buttons a given number of times and then holding the down or up button decreases or increases settings according to the table below. For example, tapping the down button once and then holding the up button sets all RGB lights in the device group to the next fixed color. Tapping the up button three times and then holding the down button decreases the high brightness preset.
+
+
+
+
+ Taps
+ |
+ Down Button
+ |
+ Up Button
+ |
+
+
+ 1
+ |
+ Set fixed color1
+ |
+ Publish MQTT event2
+ |
+
+
+ 2
+ |
+ Adjust minimum brightness
+ |
+ Adjust fade speed
+ |
+
+
+ 3
+ |
+ Adjust low brightness preset
+ |
+ Adjust high brightness preset
+ |
+
+
+
+
+1. Setting the previous/next color only functions when remote device mode is enabled (see below) and only when the switch is in a device group with an RGB light. The color sequence as defined by the Light module is red, green, blue, orange, light green, light blue, amber, cyan, purple, yellow, pink, white using RGB channels, white using CT channels.
+
+2. The MQTT topic has the format %group-topic%/cmnd/Event, where %group-topic% is the group topic set by the GroupTopic command. The MQTT payload is SwitchTrigger#, where # is 1 if the down button is held or 2 if the up button is held. These triggers can be used in rules on remote devices (ON Event#SwitchTrigger1) or by automation software to trigger automations such as scene changes. For example, the Event topic SwitchTrigger1 payload could trigger the automation software to turn on the previous scene in a list and the SwitchTrigger2 payload could trigger the automation software to turn on the next scene in a list.
+
+Holding the power button, pressing the down/up buttons a given number of times and then releasing the power button toggles options according to the table below. Note that you must press a down or up button within 0.5 seconds to prevent the power button hold action from taking place.
+
+
+
+
+ Presses
+ |
+ Down Button
+ |
+ Up Button
+ |
+
+
+ 1
+ |
+ Toggle powered-off LED
+ |
+ Toggle brightness LED timeout
+ |
+
+
+ 2
+ |
+ Toggle fading
+ |
+
+ |
+
+
+
+
+Holding any button for over 10 seconds executes the WiFiConfig 2 command.
+
+When Device Groups are enabled, the PWM Dimmer minimum brightness and brightness presets are kept in sync across all switches in the group. The powered-off LED and LED timeout settings are specific to each switch. Changing them does not replicate the change to the other switches in the group.
+
+
+### Commands
+
+
+
+
+ Command
+ |
+ Parameters
+ |
+
+
+ BriMin
+ |
+ 1..255 = set minimum brightness
+
++ = increase minimum brightness
+
+- = decrease minimum brightness
+ |
+
+
+ BriPreset
+ |
+ ,<high> = set brightness low and high presets
+
+1..255 = set brightness preset
+
++ = increase brightness preset
+
+- = decrease brightness preset
+ |
+
+
+ Dimmer
+ |
+ 0..100 = set dimmer value from 0 to 100%
+
++ = increase by 10
+
+- = decrease by 10
+ |
+
+
+ Fade
+ |
+ 0 = do not use fade (default)
+
+1 = use fade
+ |
+
+
+ LedTimeout
+ |
+ 0 = disable LED timeout
+
+1 = enable LED timeout
+ |
+
+
+ PoweredOffLed
+ |
+ 0 = disable powered-off LED
+
+1 = disable powered-off LED
+ |
+
+
+ Speed
+ |
+ 1..20 = set fade speed from fast 1 to very slow 20
+
++ = increase speed
+
+- = decrease speed
+ |
+
+
+
+
+
+### Remote Device Mode
+
+Remote device mode allows PWM Dimmer switches to control remote devices. With remote device mode enabled, each button controls a different device. Note that dimmer switches with toggle-style down/up buttons have limited functionality as remote device mode switches because you can not push the down and up buttons simultaneously.
+
+To include remote device mode support in the build, define USE_PWM_DIMMER_REMOTE in your user_config_override. Remote device mode support requires device group support so USE_DEVICE_GROUPS is automatically defined if USE_PWM_DIMMER_REMOTE is defined. Remote device mode support adds 0.7K to the code size in addition to the code size required for device groups support.
+
+To enable remote device mode, set Option71 to 1. Each remote device must be running firmware with device group support and have remote device support enabled. The remote devices do not need to be built with PWM dimmer support nor do they need to be switches.
+
+If a remote device is a PWM dimmer, the device acts like a 3-way dimmer switch would and may or may not have a load connected to it. It’s also possible to use a PWM dimmer switch without a load to act as a wall switch to control the power, brightness and color of one or more smart lights with Tasmota with device group support loaded on them.
+
+With remote device mode enabled, button 1 is the power button for the local device while buttons 2 and 3 are the power buttons for remote devices. Group names for buttons 2 and 3 are set by the GroupTopic2 and GroupTopic3 commands respectively. Note that the button numbers are defined by the module template and can be in any physical order on the switch (button 1 can be defined as the top button, the middle button or the bottom button).
+
+Pressing and releasing a power button toggles the power on all devices in the group assigned to the button. When the power is on, holding the button alternately increases or decreases the brightness. When the power is off, holding the button turns the power on at a temporary brightness of the low level set by the BriPreset command (default =10).
+
+While holding a power button, the other two buttons act like the down and up buttons for the remote device. All the functions performed by the down and up buttons in non-remote device mode are available in remote device mode. While holding button 1, button 2 performs the functions of the down button and button 3 performs the functions of the up button. While holding button 2, button 1 performs the functions of the down button and button 3 performs the functions of the up button. While holding button 3, button 1 performs the functions of the down button and button 2 performs the functions of the up button.
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index dba7abeed..e5e08674c 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -103,4 +103,5 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for FiF LE-01MR energy meter by saper-2 (#7584)
- Add new DHT driver. The old driver can still be used using define USE_DHT_OLD (#7468)
- Add another new DHT driver based on ESPEasy. The old driver can still be used using define USE_DHT_OLD. The previous new driver can be used with define USE_DHT_V2 (#7717)
-- Add initial support for Sensors AHT10 and AHT15 by Martin Wagner (#7596)
\ No newline at end of file
+- Add initial support for Sensors AHT10 and AHT15 by Martin Wagner (#7596)
+- Add support for Wemos Motor Shield V1 by Denis Sborets (#7764)
diff --git a/TEMPLATES.md b/TEMPLATES.md
index 2cb5b4773..d922a4174 100644
--- a/TEMPLATES.md
+++ b/TEMPLATES.md
@@ -130,6 +130,7 @@ Kingart Touch {"NAME":"PS-16-DZ","GPIO":[255,148,255,149,255,255,0,0,255
Moes DS01 {"NAME":"MOES - DS01","GPIO":[255,255,255,255,255,255,0,0,255,108,255,107,255],"FLAG":0,"BASE":54}
Moes QS-WiFi-D01 Dimmer 150W {"NAME":"WiFi-Dimmer","GPIO":[0,148,0,149,0,0,0,0,0,42,37,0,0],"FLAG":0,"BASE":18}
PS-16-DZ {"NAME":"PS-16-DZ","GPIO":[255,148,255,149,255,255,0,0,255,52,255,255,255],"FLAG":0,"BASE":58}
+PWM Dimmer {"NAME":"PWM Dimmer","GPIO":[19,18,0,59,158,58,0,0,57,37,56,122,29],"FLAG":0,"BASE":73}
Zemismart KS-7011 {"NAME":"KS-7011 Dimmer","GPIO":[255,107,255,108,255,255,0,0,255,255,255,255,255],"FLAG":0,"BASE":54}
```
diff --git a/platformio.ini b/platformio.ini
index 16553f0d6..552408790 100755
--- a/platformio.ini
+++ b/platformio.ini
@@ -56,6 +56,7 @@ default_envs =
framework = arduino
board = esp01_1m
board_build.flash_mode = dout
+board_build.ldscript = eagle.flash.1m.ld
platform = ${core_active.platform}
platform_packages = ${core_active.platform_packages}
diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini
index 93bbbb5ba..0c63c6e8f 100644
--- a/platformio_override_sample.ini
+++ b/platformio_override_sample.ini
@@ -135,10 +135,9 @@ build_flags = ${esp82xx_defaults.build_flags}
[core_2_6_3]
; *** Esp8266 core for Arduino version 2.6.3
-platform = espressif8266@2.3.2
+platform = espressif8266@2.3.3
platform_packages =
build_flags = ${esp82xx_defaults.build_flags}
- -Wl,-Teagle.flash.1m.ld
-DBEARSSL_SSL_BASIC
; NONOSDK221
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221
@@ -180,12 +179,10 @@ build_flags = ${esp82xx_defaults.build_flags}
[tasmota_core_stage]
; *** Esp8266 core for Arduino version stable beta
-platform = espressif8266@2.3.2
+platform = espressif8266@2.3.3
platform_packages = framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git#6be561617f645f6a2ae82b8211f6af8c43e834cf
build_flags = ${esp82xx_defaults.build_flags}
- -Wl,-Teagle.flash.1m.ld
-DBEARSSL_SSL_BASIC
- -DNOPRINTFLOAT
; NONOSDK221
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221
; NONOSDK22x_190313
@@ -226,12 +223,10 @@ build_flags = ${esp82xx_defaults.build_flags}
[core_stage]
; *** Esp8266 core for Arduino version latest beta
-platform = espressif8266@2.3.2
+platform = espressif8266@2.3.3
platform_packages = framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
-board_build.ldscript = eagle.flash.1m.ld
build_flags = ${esp82xx_defaults.build_flags}
-DBEARSSL_SSL_BASIC
- -DNOPRINTFLOAT
; NONOSDK221
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221
; NONOSDK22x_190313
diff --git a/platformio_tasmota_env.ini b/platformio_tasmota_env.ini
index 2a26ba4d2..cfcd53686 100644
--- a/platformio_tasmota_env.ini
+++ b/platformio_tasmota_env.ini
@@ -3,6 +3,7 @@ platform = ${common.platform}
platform_packages = ${common.platform_packages}
framework = ${common.framework}
board = ${common.board}
+board_build.ldscript = ${common.board_build.ldscript}
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
build_unflags = ${common.build_unflags}
diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md
index 2689a7222..ef9ce17f4 100644
--- a/tasmota/CHANGELOG.md
+++ b/tasmota/CHANGELOG.md
@@ -4,6 +4,9 @@
- Revert most wifi connectivity changes introduced in 8.1.0.5 (#7746, #7602, #7621)
- Add initial support for Sensors AHT10 and AHT15 by Martin Wagner (#7596)
+- Add support for Wemos Motor Shield V1 by Denis Sborets (#7764)
+- Fix Zigbee auto-increment transaction number (#7757)
+- Add Zigbee enhanced commands decoding, added ``ZbPing``
### 8.1.0.8 20200212
diff --git a/tasmota/i18n.h b/tasmota/i18n.h
index cb9bb1196..630da2f6f 100644
--- a/tasmota/i18n.h
+++ b/tasmota/i18n.h
@@ -532,6 +532,14 @@
// Commands xdrv_32_hotplug.ino
#define D_CMND_HOTPLUG "HotPlug"
+// Commands xdrv_34_pwm_dimmer.ino
+#ifdef USE_PWM_DIMMER
+#define D_CMND_BRI_MIN "BriMin"
+#define D_CMND_BRI_PRESET "BriPreset"
+#define D_CMND_LED_TIMEOUT "LedTimeout"
+#define D_CMND_POWERED_OFF_LED "PoweredOffLed"
+#endif
+
// Commands xsns_02_analog.ino
#define D_CMND_ADCPARAM "AdcParam"
diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h
index 57e10c955..0d43b9489 100644
--- a/tasmota/my_user_config.h
+++ b/tasmota/my_user_config.h
@@ -415,7 +415,9 @@
//#define USE_EXS_DIMMER // Add support for ES-Store WiFi Dimmer (+1k5 code)
// #define EXS_MCU_CMNDS // Add command to send MCU commands (+0k8 code)
//#define USE_HOTPLUG // Add support for sensor HotPlug
-// #define USE_DEVICE_GROUPS // Add support for device groups (+4k code)
+// #define USE_DEVICE_GROUPS // Add support for device groups (+3k5 code)
+// #define USE_PWM_DIMMER // Add support for MJ-SD01/acenx/NTONPOWER PWM dimmers (+4k5 code)
+// #define USE_PWM_DIMMER_REMOTE // Add support for remote switches to PWM Dimmer, also adds device groups support (+0k7 code, also includes device groups)
// -- Optional light modules ----------------------
#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
diff --git a/tasmota/settings.h b/tasmota/settings.h
index 972af6974..88862f090 100644
--- a/tasmota/settings.h
+++ b/tasmota/settings.h
@@ -578,4 +578,18 @@ typedef union {
#define device_group_share_in domoticz_sensor_idx[0] // Bitmask of device group items imported
#define device_group_share_out domoticz_sensor_idx[1] // Bitmask of device group items exported
+// Settings re-purposed for the PWM_DIMMER module
+#ifdef USE_PWM_DIMMER
+#define led_timeout light_signal // SetOption18 - Turn brightness LED's off 5 seconds after last change
+#define powered_off_led buzzer_enable // SetOption67 - Turn red LED on when powered off
+#define bri_power_on pcf8574_config[0] // Brightness when next powered-on
+#define bri_min pcf8574_config[1] // Minimum brightness
+#define bri_preset_low pcf8574_config[2] // Bri preset low
+#define bri_preset_high pcf8574_config[3] // Bri preset high
+#define button_devices pcf8574_config[4] // Button-device map
+#ifdef USE_PWM_DIMMER_REMOTE
+#define remote_device_mode dds2382_model // SetOption71 - Buttons control remote devices
+#endif // USE_PWM_DIMMER_REMOTE
+#endif // USE_PWM_DIMMER
+
#endif // _SETTINGS_H_
diff --git a/tasmota/settings.ino b/tasmota/settings.ino
index 33da93562..c2ddc6607 100644
--- a/tasmota/settings.ino
+++ b/tasmota/settings.ino
@@ -277,6 +277,23 @@ bool RtcRebootValid(void)
/*********************************************************************************************\
* Config - Flash
+ *
+ * Tasmota 1M flash usage
+ * 0x00000000 - Unzipped binary bootloader
+ * 0x00001000 - Unzipped binary code start
+ * ::::
+ * 0x000xxxxx - Unzipped binary code end
+ * 0x000x1000 - First page used by Core OTA
+ * ::::
+ * 0x000F3000 - Tasmota Quick Power Cycle counter (SETTINGS_LOCATION - CFG_ROTATES) - First four bytes only
+ * 0x000F4000 - First Tasmota rotating settings page
+ * ::::
+ * 0x000FA000 - Last Tasmota rotating settings page = Last page used by Core OTA
+ * 0x000FB000 - Core SPIFFS end = Core EEPROM = Tasmota settings page during OTA and when no flash rotation is active (SETTINGS_LOCATION)
+ * 0x000FC000 - SDK - Uses first 128 bytes for phy init data mirrored by Core in RAM. See core_esp8266_phy.cpp phy_init_data[128] = Core user_rf_cal_sector
+ * 0x000FD000 - SDK - Uses scattered bytes from 0x340 (iTead use as settings storage from 0x000FD000)
+ * 0x000FE000 - SDK - Uses scattered bytes from 0x340 (iTead use as mirrored settings storage from 0x000FE000)
+ * 0x000FF000 - SDK - Uses at least first 32 bytes of this page - Tasmota Zigbee persistence from 0x000FF800 to 0x000FFFFF
\*********************************************************************************************/
extern "C" {
@@ -745,8 +762,17 @@ void SettingsErase(uint8_t type)
_sectorStart = SETTINGS_LOCATION - CFG_ROTATES; // Tasmota and SDK parameter area (0x0F3xxx - 0x0FFFFF)
_sectorEnd = ESP.getFlashChipSize() / SPI_FLASH_SEC_SIZE; // Flash size as seen by SDK
}
-
- AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_ERASE " %d " D_UNIT_SECTORS), _sectorEnd - _sectorStart);
+#ifdef USE_WIFI_SDK_ERASE
+ else if (4 == type) {
+ _sectorStart = SETTINGS_LOCATION +1; // SDK phy area and Core calibration sector (0x0FC000)
+ _sectorEnd = _sectorStart +1; // SDK end of phy area and Core calibration sector (0x0FCFFF)
+ }
+ else if (5 == type) {
+ _sectorStart = (ESP.getFlashChipRealSize() / SPI_FLASH_SEC_SIZE) -4; // SDK phy area and Core calibration sector (0xxFC000)
+ _sectorEnd = _sectorStart +1; // SDK end of phy area and Core calibration sector (0xxFCFFF)
+ }
+#endif // USE_WIFI_SDK_ERASE
+ AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_ERASE " from 0x%08X to 0x%08X"), _sectorStart * SPI_FLASH_SEC_SIZE, (_sectorEnd * SPI_FLASH_SEC_SIZE) -1);
// EspErase(_sectorStart, _sectorEnd); // Arduino core and SDK - erases flash as seen by SDK
EsptoolErase(_sectorStart, _sectorEnd); // Esptool - erases flash completely
@@ -755,11 +781,21 @@ void SettingsErase(uint8_t type)
void SettingsSdkErase(void)
{
- WiFi.disconnect(true); // Delete SDK wifi config
+ WiFi.disconnect(false); // Delete SDK wifi config
SettingsErase(1);
delay(1000);
}
+#ifdef USE_WIFI_SDK_ERASE
+void SettingsSdkWifiErase(void)
+{
+ WiFi.disconnect(false); // Delete SDK wifi config
+ SettingsErase(4);
+ SettingsErase(5);
+ delay(200);
+}
+#endif // USE_WIFI_SDK_ERASE
+
/********************************************************************************************/
void SettingsDefault(void)
diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino
index ba1a2e465..b6101b1cf 100644
--- a/tasmota/support_features.ino
+++ b/tasmota/support_features.ino
@@ -516,7 +516,10 @@ void GetFeatures(void)
#ifdef USE_AHT1x
feature5 |= 0x10000000; // xsns_63_aht1x.ino
#endif
-// feature5 |= 0x20000000;
+#ifdef USE_WEMOS_MOTOR_V1
+ feature5 |= 0x20000000; // xdrv_34_wemos_motor_v1.ino
+#endif
+
// feature5 |= 0x40000000;
// feature5 |= 0x80000000;
diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino
index b4d699cb6..ad9b38165 100644
--- a/tasmota/support_tasmota.ino
+++ b/tasmota/support_tasmota.ino
@@ -640,6 +640,12 @@ void MqttShowState(void)
break;
}
#endif // USE_SONOFF_IFAN
+#ifdef USE_PWM_DIMMER
+ if (PWM_DIMMER == my_module_type) {
+ ResponseAppend_P(PSTR(",\"" D_CMND_DIMMER "\":%d,\"" D_CMND_FADE "\":\"%s\",\"" D_CMND_SPEED "\":%d"),
+ Settings.light_dimmer, GetStateText(Settings.light_fade), Settings.light_speed);
+ }
+#endif // USE_PWM_DIMMER
#ifdef USE_LIGHT
}
#endif
diff --git a/tasmota/tasmota_post.h b/tasmota/tasmota_post.h
index fc94e5167..a8ff65967 100644
--- a/tasmota/tasmota_post.h
+++ b/tasmota/tasmota_post.h
@@ -708,6 +708,16 @@ const char kDeviceGroupMessage[] PROGMEM = DEVICE_GROUP_MESSAGE;
uint8_t device_group_count = 1;
#endif // USE_DEVICE_GROUPS
+#ifdef USE_PWM_DIMMER_REMOTE
+#ifdef USE_PWM_DIMMER
+#ifndef USE_DEVICE_GROUPS
+#define USE_DEVICE_GROUPS
+#endif // USE_DEVICE_GROUPS
+#else // USE_PWM_DIMMER
+#undef USE_PWM_DIMMER_REMOTE
+#endif // USE_PWM_DIMMER
+#endif // USE_PWM_DIMMER_REMOTE
+
#ifdef DEBUG_TASMOTA_CORE
#define DEBUG_CORE_LOG(...) AddLog_Debug(__VA_ARGS__)
#else
diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h
index c4ee7b19d..6f5aa0f8c 100644
--- a/tasmota/tasmota_template.h
+++ b/tasmota/tasmota_template.h
@@ -418,6 +418,7 @@ enum SupportedModules {
SONOFF_L1,
SONOFF_IFAN03,
EXS_DIMMER,
+ PWM_DIMMER,
MAXMODULE};
#define USER_MODULE 255
@@ -864,6 +865,9 @@ const uint8_t kModuleNiceList[] PROGMEM = {
#endif
#ifdef USE_EXS_DIMMER
EXS_DIMMER,
+#endif
+#ifdef USE_PWM_DIMMER
+ PWM_DIMMER,
#endif
H801, // Light Devices
MAGICHOME,
@@ -2204,6 +2208,33 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_USER, // GPIO14
0, // GPIO15
0, 0
+ },
+ { "PWM Dimmer", // PWM_DIMMER - Support for Martin Jerry/acenx/Tessan/NTONPOWER SD0x PWM
+ // dimmer switches. The brightness of the load for these dimmers is
+ // controlled by a PWM GPIO pin. There are typically power, up & down
+ // buttons and 4 LED's. Examples are:
+ // https://www.amazon.com/dp/B07FXYSVR1
+ // https://www.amazon.com/dp/B07V26Q3VD
+ // https://www.amazon.com/dp/B07K67D43J
+ // https://www.amazon.com/dp/B07TTGFWFM
+ GPIO_KEY3, // GPIO00 Up button
+ GPIO_KEY2, // GPIO01 Down button
+ 0, // GPIO02
+ GPIO_LED4_INV, // GPIO03 Level 5 LED
+ GPIO_LEDLNK_INV, // GPIO04 LED Link
+ GPIO_LED3_INV, // GPIO05 Level 4 LED
+ // GPIO06 (SD_CLK Flash)
+ // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT)
+ // GPIO08 (SD_DATA1 Flash QIO/DIO/DOUT)
+ 0, // GPIO09 (SD_DATA2 Flash QIO or ESP8285)
+ 0, // GPIO10 (SD_DATA3 Flash QIO or ESP8285)
+ // GPIO11 (SD_CMD Flash)
+ GPIO_LED2_INV, // GPIO12 Level 3 LED
+ GPIO_PWM1, // GPIO13 Dimmer PWM
+ GPIO_LED1_INV, // GPIO12 Level 2 LED
+ GPIO_KEY1_INV, // GPIO15 Power button
+ GPIO_REL1_INV, // GPIO16 Power relay/Level 1 LED
+ 0
}
};
diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino
index 3eaa24ef5..377799a72 100644
--- a/tasmota/xdrv_01_webserver.ino
+++ b/tasmota/xdrv_01_webserver.ino
@@ -1123,6 +1123,17 @@ void HandleRoot(void)
} // Settings.flag3.pwm_multi_channels
}
#endif // USE_LIGHT
+#ifdef USE_PWM_DIMMER
+ if (PWM_DIMMER == my_module_type) {
+ WSContentSend_P(HTTP_MSG_SLIDER_GRADIENT, // Brightness - Black to White
+ "c", // c - Unique HTML id
+ "#000", "#fff", // Black to White
+ 4, // sl4 - Unique range HTML id - Used as source for Saturation begin color
+ Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100%
+ Settings.light_dimmer,
+ 'd', 0); // d0 - Value id is related to lc("d0", value) and WebGetArg("d0", tmp, sizeof(tmp));
+ }
+#endif // USE_PWM_DIMMER
#ifdef USE_SHUTTER
if (Settings.flag3.shutter_mode) { // SetOption80 - Enable shutter support
for (uint32_t i = 0; i < shutters_present; i++) {
diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino
index baaf2b7a7..d54598077 100644
--- a/tasmota/xdrv_04_light.ino
+++ b/tasmota/xdrv_04_light.ino
@@ -2588,6 +2588,8 @@ void CmndRgbwwTable(void)
ResponseCmndChar(scolor);
}
+#endif // USE_LIGHT
+#if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
void CmndFade(void)
{
// Fade - Show current Fade state
@@ -2606,7 +2608,9 @@ void CmndFade(void)
#ifdef USE_DEVICE_GROUPS
if (XdrvMailbox.payload >= 0 && XdrvMailbox.payload <= 2) SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_LIGHT_FADE, Settings.light_fade);
#endif // USE_DEVICE_GROUPS
+#ifdef USE_LIGHT
if (!Settings.light_fade) { Light.fade_running = false; }
+#endif // USE_LIGHT
ResponseCmndStateText(Settings.light_fade);
}
@@ -2632,6 +2636,8 @@ void CmndSpeed(void)
}
ResponseCmndNumber(Settings.light_speed);
}
+#endif // #if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
+#ifdef USE_LIGHT
void CmndWakeupDuration(void)
{
@@ -2664,7 +2670,10 @@ bool Xdrv04(uint8_t function)
bool result = false;
if (FUNC_MODULE_INIT == function) {
- return LightModuleInit();
+#ifdef USE_PWM_DIMMER
+ if (PWM_DIMMER != my_module_type)
+#endif // USE_PWM_DIMMER
+ return LightModuleInit();
}
else if (light_type) {
switch (function) {
diff --git a/tasmota/xdrv_07_domoticz.ino b/tasmota/xdrv_07_domoticz.ino
index 49e546b65..90563eeed 100644
--- a/tasmota/xdrv_07_domoticz.ino
+++ b/tasmota/xdrv_07_domoticz.ino
@@ -296,6 +296,7 @@ bool DomoticzMqttData(void)
found = true;
} else
#endif // USE_SHUTTER
+#ifdef USE_LIGHT
if (iscolordimmer && 10 == nvalue) { // Color_SetColor
// https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Set_a_light_to_a_certain_color_or_color_temperature
JsonObject& color = domoticz["Color"];
@@ -333,8 +334,9 @@ bool DomoticzMqttData(void)
snprintf_P(XdrvMailbox.topic, XdrvMailbox.index, PSTR("/" D_CMND_DIMMER));
snprintf_P(XdrvMailbox.data, XdrvMailbox.data_len, PSTR("%d"), nvalue);
found = true;
- }
- else if (1 == nvalue || 0 == nvalue) {
+ } else
+#endif // USE_LIGHT
+ if (1 == nvalue || 0 == nvalue) {
if (((power >> i) &1) == (power_t)nvalue) {
return true; // Stop loop
}
diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino
index 7396694af..fde47a623 100644
--- a/tasmota/xdrv_12_home_assistant.ino
+++ b/tasmota/xdrv_12_home_assistant.ino
@@ -200,8 +200,8 @@ void HAssAnnounceRelayLight(void)
TryResponseAppend_P(HASS_DISCOVER_RELAY, command_topic, value_template, SettingsText(SET_STATE_TXT1), SettingsText(SET_STATE_TXT2));
TryResponseAppend_P(HASS_DISCOVER_DEVICE_INFO_SHORT, unique_id, ESP.getChipId(), WiFi.macAddress().c_str());
-#ifdef USE_LIGHT
- if (is_light)
+#if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
+ if (is_light || PWM_DIMMER == my_module_type)
{
char *brightness_command_topic = stemp1;
@@ -209,6 +209,7 @@ void HAssAnnounceRelayLight(void)
strncpy_P(stemp3, Settings.flag.not_power_linked ? PSTR("last") : PSTR("brightness"), sizeof(stemp3)); // SetOption20 - Control power in relation to Dimmer/Color/Ct changes
TryResponseAppend_P(HASS_DISCOVER_LIGHT_DIMMER, brightness_command_topic, state_topic, stemp3);
+#ifdef USE_LIGHT
if (Light.subtype >= LST_RGB)
{
char *rgb_command_topic = stemp1;
@@ -234,8 +235,9 @@ void HAssAnnounceRelayLight(void)
GetTopic_P(color_temp_command_topic, CMND, mqtt_topic, D_CMND_COLORTEMPERATURE);
TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic);
}
+#endif // USE_LIGHT
}
-#endif // USE_LIGHT
+#endif // defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
TryResponseAppend_P(PSTR("}"));
}
MqttPublish(stopic, true);
diff --git a/tasmota/xdrv_23_zigbee_1_headers.ino b/tasmota/xdrv_23_zigbee_1_headers.ino
index 101d5703d..0bc592266 100644
--- a/tasmota/xdrv_23_zigbee_1_headers.ino
+++ b/tasmota/xdrv_23_zigbee_1_headers.ino
@@ -21,7 +21,7 @@
// contains some definitions for functions used before their declarations
-void ZigbeeZCLSend(uint16_t dtsAddr, uint16_t clusterId, uint8_t endpoint, uint8_t cmdId, bool clusterSpecific, const uint8_t *msg, size_t len, bool disableDefResp = true, uint8_t transacId = 1);
+void ZigbeeZCLSend(uint16_t dtsAddr, uint16_t clusterId, uint8_t endpoint, uint8_t cmdId, bool clusterSpecific, const uint8_t *msg, size_t len, bool needResponse, uint8_t transacId);
// Get an JSON attribute, with case insensitive key search
diff --git a/tasmota/xdrv_23_zigbee_3_devices.ino b/tasmota/xdrv_23_zigbee_3_devices.ino
index 4814bdb8a..71752f4e3 100644
--- a/tasmota/xdrv_23_zigbee_3_devices.ino
+++ b/tasmota/xdrv_23_zigbee_3_devices.ino
@@ -19,6 +19,10 @@
#ifdef USE_ZIGBEE
+#ifndef ZIGBEERECEIVED
+#define ZIGBEERECEIVED 1
+#endif
+
#include
#include