diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
index 2a962ecb7..1e29983f7 100644
--- a/.github/ISSUE_TEMPLATE/Bug_report.md
+++ b/.github/ISSUE_TEMPLATE/Bug_report.md
@@ -8,11 +8,11 @@ about: Create a report to help us improve
> This BUG issue template is meant to REPORT Tasmota software BUGS ONLY>
>
> Please DO NOT OPEN AN ISSUE:
-> - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/>
-> - If your issue is a flashing issue, please address it to the Tasmota Support Chat>
-> - If your issue is compilation problem, please address it to the Tasmota Support Chat>
-> - If your issue has been addresed before (duplicated issue), please ask in the original issue>
-> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the FAQ and troubleshooting wiki articles>
+> - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/
+> - If your issue is a flashing issue, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
+> - If your issue is compilation problem, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
+> - If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue
+> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the [FAQ](https://github.com/arendst/Sonoff-Tasmota/wiki/FAQ) and troubleshooting wiki articles
>
> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
@@ -26,33 +26,35 @@ _Make sure your have performed every step and checked the applicable boxes befor
**FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED**
- [ ] Read the [Contributing Guide and Policy](https://github.com/arendst/Sonoff-Tasmota/blob/development/CONTRIBUTING.md) and [the Code of Conduct](https://github.com/arendst/Sonoff-Tasmota/blob/development/CODE_OF_CONDUCT.md)
-- [ ] Searched the problem in issues (https://github.com/arendst/Sonoff-Tasmota/issues)
-- [ ] Searched the problem in the wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting)
-- [ ] Searched the problem in the forum (https://groups.google.com/d/forum/sonoffusers)
-- [ ] Searched the problem in the chat (https://discord.gg/Ks2Kzd4)
+- [ ] Searched the problem in [issues](https://github.com/arendst/Sonoff-Tasmota/issues)
+- [ ] Searched the problem in the [wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting)
+- [ ] Searched the problem in the [forum](https://groups.google.com/d/forum/sonoffusers)
+- [ ] Searched the problem in the [chat](https://discord.gg/Ks2Kzd4)
- [ ] Device used (e.g., Sonoff Basic): _____
- [ ] Tasmota binary firmware version number used: _____
- [ ] Pre-compiled
- [ ] Self-compiled
- - [ ] IDE / Compiler
+ - [ ] IDE / Compiler used: _____
- [ ] Flashing tools used: _____
-- [ ] Provide the output of command ``Backlog Template; Module; GPIO``:
+- [ ] Provide the output of command: ``Backlog Template; Module; GPIO``:
```
Configuration output here:
+
```
-- [ ] If using rules, provide the output of command ``Backlog Rule1; Rule2; Rule3``:
+- [ ] If using rules, provide the output of this command: ``Backlog Rule1; Rule2; Rule3``:
```
Rules output here:
+
```
-- [ ] Provide the output of command ``Status 0``:
+- [ ] Provide the output of this command: ``Status 0``:
```
STATUS 0 output here:
```
-- [ ] Provide the output of console when you experience your issue if applicable:
+- [ ] Provide the output of the Console log output when you experience your issue; if applicable:
_(Please use_ ``weblog 4`` _for more debug information)_
```
Console output here:
diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md
index d5c6bd89c..f0d6fafe0 100644
--- a/.github/ISSUE_TEMPLATE/Custom.md
+++ b/.github/ISSUE_TEMPLATE/Custom.md
@@ -8,13 +8,13 @@ about: Users Troubleshooting Help
> This troubleshooting issue template is meant to help Tasmota users with difficult problems. It is aimed to be opened if using the wiki and the support chat could not solve the issue. The Github Issue tracker is NOT a general discussion forum!
>
> Please DO NOT OPEN AN ISSUE:
-> - If you have general questions or you need help on Tasmota usage, go to the Tasmota support chat
+> - If you have general questions or you need help on Tasmota usage, go to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
> - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/
> - If your issue is about a new device, please use the Tasmota [Template](../wiki/Templates) feature.
-> - If your issue is a flashing issue, please address it to the Tasmota Support Chat
-> - If your issue is compilation problem, please address it to the Tasmota Support Chat
-> - If your issue has been addresed before (duplicated issue), please ask in the original issue
-> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the FAQ and troubleshooting wiki articles
+> - If your issue is a flashing issue, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
+> - If your issue is compilation problem, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
+> - If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue
+> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the [FAQ](https://github.com/arendst/Sonoff-Tasmota/wiki/FAQ) and troubleshooting wiki articles
>
> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
@@ -36,25 +36,27 @@ _Make sure these boxes are checked before submitting your issue. Thank you_
- [ ] Tasmota binary firmware version number used: _____
- [ ] Pre-compiled
- [ ] Self-compiled
- - [ ] IDE / Compiler
+ - [ ] IDE / Compiler used: _____
- [ ] Flashing tools used: _____
-- [ ] Provide the output of command ``Backlog Template; Module; GPIO``:
+- [ ] Provide the output of this command: ``Backlog Template; Module; GPIO``:
```
Configuration output here:
+
```
-- [ ] If using rules, provide the output of command ``Backlog Rule1; Rule2; Rule3``:
+- [ ] If using rules, provide the output of this command: ``Backlog Rule1; Rule2; Rule3``:
```
Rules output here:
+
```
-- [ ] Provide the output of command ``Status 0``:
+- [ ] Provide the output of this command: ``Status 0``:
```
STATUS 0 output here:
```
-- [ ] Provide the output of console when you experience your issue if applicable:
+- [ ] Provide the output of the Console log output when you experience your issue; if applicable:
_(Please use_ ``weblog 4`` _for more debug information)_
```
Console output here:
diff --git a/.gitignore b/.gitignore
index bd39647e3..acdd5c610 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
.piolibdeps
.clang_complete
.gcc-flags.json
+.cache
sonoff/user_config_override.h
build
firmware.map
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 1209b76bf..d7084c559 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -1,4 +1,4 @@
-
+
# RELEASE NOTES
@@ -10,8 +10,13 @@ See [wiki migration path](https://github.com/arendst/Sonoff-Tasmota/wiki/Upgrade
3. Migrate to **Sonoff-Tasmota 5.14**
4. Migrate to **Sonoff-Tasmota 6.x**
-## Core version 2.3.0 vs 2.4.2
-This release is based on ESP8266/Arduino library core 2.3.0 (again) as some people encountered wifi related issues on core 2.4.2. For others core 2.4.2 is working just fine. Both version are available from http://thehackbox.org/tasmota/release/
+## Support of TLS
+TLS support for core 2.3.0 is removed.
+
+TLS is supported on core 2.4.2 and up. To save resources when TLS is enabled mDNS needs to be disabled. In addition to TLS using fingerprints now also user supplied CA certs and AWS IoT is supported. See full documentation on https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT
+
+## Core version 2.3.0 vs 2.4.2 vs 2.5.2
+This release is based on ESP8266/Arduino library core 2.3.0 as some people encountered wifi related issues on core 2.4.2 and 2.5.2. For others core 2.4.2 or 2.5.2 is working just fine. All version are available from http://thehackbox.org/tasmota/release/
## Change in default initial configuration tool
Firmware binary **sonoff-classic.bin** supports **WifiManager, Wps and SmartConfig** for initial configuration. The default tool is **Wps**.
@@ -92,6 +97,7 @@ Module | Description
67 SP10 | Tuya SP10 Wifi Smart Switch with Energy Monitoring
68 WAGA CHCZ02MB | WAGA life CHCZ02MB Wifi Smart Switch with Energy Monitoring
69 SYF05 | Sunyesmart SYF05 RGBWW Wifi Led Bulb
+70 Sonoff L1 | Sonoff L1 light strip
## Provided Binary Downloads
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.3.0**.
@@ -107,6 +113,8 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
Core version **2.4.2** binaries can be found at http://thehackbox.org/tasmota/release/020402/
+Core version **2.5.2** binaries can be found at http://thehackbox.org/tasmota/release/020502/
+
## Available Features and Sensors
| Feature or Sensor | minimal | basic | classic | sonoff | knx | sensors | display | Remarks
@@ -118,9 +126,12 @@ Core version **2.4.2** binaries can be found at http://thehackbox.org/tasmota/re
| USE_DOMOTICZ | - | - | x | x | x | x | - |
| USE_HOME_ASSISTANT | - | - | - | x | x | x | - |
| USE_MQTT_TLS | - | - | - | - | - | - | - |
+| USE_MQTT_TLS_CA_CERT | - | - | - | - | - | - | - |
+| USE_MQTT_AWS_IOT | - | - | - | - | - | - | - |
| USE_KNX | - | - | - | - | x | - | - |
| USE_WEBSERVER | x | x | x | x | x | x | x | WifiManager
-| USE_EMULATION | - | x | x | x | - | x | - |
+| USE_EMULATION_HUE | - | x | x | x | - | x | - |
+| USE_EMULATION_WEMO | - | x | x | x | - | x | - |
| USE_DISCOVERY | - | - | x | x | x | x | x |
| WEBSERVER_ADVERTISE | - | - | x | x | x | x | x |
| MQTT_HOST_DISCOVERY | - | - | x | x | x | x | x |
@@ -128,12 +139,15 @@ Core version **2.4.2** binaries can be found at http://thehackbox.org/tasmota/re
| USE_TIMERS_WEB | - | x | - | x | x | x | x |
| USE_SUNRISE | - | x | - | x | x | x | x |
| USE_RULES | - | x | - | x | x | x | x |
+| USE_SCRIPT | - | - | - | - | - | - | - |
| USE_EXPRESSION | - | - | - | - | - | - | - |
| | | | | | | | |
-| USE_ADC_VCC | x | x | x | x | x | - | x |
+| USE_ADC_VCC | x | x | x | - | - | - | - |
+| USE_COUNTER | - | - | - | x | x | x | x |
| USE_DS18B20 | - | - | - | - | - | - | - | Single sensor
| USE_DS18x20 | - | - | x | x | x | x | x | Multiple sensors
| USE_DS18x20_LEGACY | - | - | - | - | - | - | - | Multiple sensors
+| USE_DHT | - | - | x | x | x | x | x |
| | | | | | | | |
| Feature or Sensor | minimal | basic | classic | sonoff | knx | sensors | display | Remarks
| USE_I2C | - | - | - | x | x | x | x |
@@ -162,6 +176,10 @@ Core version **2.4.2** binaries can be found at http://thehackbox.org/tasmota/re
| USE_MGC3130 | - | - | - | - | - | - | - |
| USE_MAX44009 | - | - | - | - | - | - | - |
| USE_SCD30 | - | - | - | - | - | x | - |
+| USE_SPS30 | - | - | - | - | - | - | - |
+| USE_ADE7953 | - | - | - | x | x | x | x |
+| USE_VL53L0X | - | - | - | - | - | - | - |
+| USE_MLX90614 | - | - | - | - | - | - | - |
| | | | | | | | |
| Feature or Sensor | minimal | basic | classic | sonoff | knx | sensors | display | Remarks
| USE_SPI | - | - | - | - | - | - | x |
@@ -206,81 +224,80 @@ Core version **2.4.2** binaries can be found at http://thehackbox.org/tasmota/re
| USE_DISPLAY_EPAPER_29 | - | - | - | - | - | - | x | Disabled for core 2.3.0
## Changelog
-Version 6.5.0 20190319
- * Remove commands SetOption14 and SetOption63 as it has been superseded by command Interlock
- * Remove command SetOption35 0-255 for mDNS start-up delay (#4793)
- * Remove support for MQTT_LIBRARY_TYPE, MQTT_ARDUINOMQTT and MQTT_TASMOTAMQTT (#5474)
- * Change webserver content handling from single String to small Chunks increasing RAM
- * Change code use of boolean to bool and byte to uint8_t
- * Change code uint8_t flags to bool flags
- * Change sonoff_template.h layout regarding optional module flags like ADC0
- * Change sonoff_template.h module lay-out by removing non-configurable GPIOs
- * Change button driver making it modular
- * Change switch driver making it modular and introduce input filter (#4665, #4724)
- * Change switch input detection by optimizing switch debounce (#4724)
- * Change web authentication (#4865)
- * Change image name BE_MINIMAL to FIRMWARE_MINIMAL and USE_xyz to FIRMWARE_xyz (#5106)
- * Change GUI weblog from XML to plain text solving possible empty screens (#5154)
- * Fix most compiler warnings
- * Fix Display exception 28 when JSON value is NULL received
- * Fix epaper driver (#4785)
- * Fix HAss Sensor Discovery Software Watchdog restart (#4831, #4988)
- * Fix allowable MAX_RULE_VARS to 16 (#4933)
- * Fix mDNS addService (#4938, #4951)
- * Fix HAss discovery of MHZ19(B) sensors (#4992)
- * Fix some exceptions and watchdogs due to lack of stack space (#5215)
- * Fix GUI wifi password acception starting with asteriks (*) (#5231, #5242)
- * Fix command WebSend intermittent results (#5273, #5304)
- * Fix additional characters in fallbacktopic, hostname and mqttclient on core 2.5.0 (#5359, #5417)
- * Fix Energy TotalStartTime when commands EnergyReset0 and/or EnergyReset3 used (#5373)
- * Fix DS18S20 temperature calculation (#5375)
- * Fix float calculations in range from 0 to -1 (#5386)
- * Fix exception on GUI Configure Logging and Configure Other (#5424)
- * Add commands PowerCal, VoltageCal and CurrentCal for HLW8012, HJL01 and BL0937 based energy sensors
- * Add command SerialDelimiter 128 to filter reception of only characters between ASCII 32 and 127 (#5131)
- * Add command SSerialSend5 \ to SerialBridge
- * Add command Interlock 0 / 1 / 1,2 3,4 .. to control interlock ON/OFF and add up to 8 relays in 1 to 4 interlock groups (#4910, #5014)
- * Add command Template 255 to copy module configuration over to current active template and store as user template named Merged (#5371)
- * Add command WifiConfig 7 to allow reset of device in AP mode without admin password (#5297)
- * Add command SetOption36 to control boot loop default restoration (#4645, #5063)
- * Add command SetOption37 for RGBCW color mapping (#5326)
- * Add command SetOption55 0/1 and define MDNS_ENABLE to disable/enable mDNS (#4793, #4923)
- * Add command SetOption62 0/1 to disable retain on Button or Switch hold messages (#5299)
- * Add support for Smanergy KA10 Smart Wall Socket with Energy monitoring
- * Add support for commands in sensor drivers
- * Add support for MAX31855 K-Type thermocouple sensor using softSPI (#4764)
- * Add support for Near Field Communication (NFC) controller PN532 using Serial (#4791, #5162)
- * Add support for OBI Power Socket 2 (#4829)
- * Add support for YTF IR Bridge (#4855)
- * Add support for Mi LED Desk Lamp with rotary switch (#4887)
- * Add support for Digoo DG-SP202 Smart Socket with Energy monitoring (#4891)
- * Add support for MAX44009 Ambient Light sensor (#4907)
- * Add support for inverted buttons and inverted buttons without pullup (#4914)
- * Add support for Luminea ZX2820 Smart Socket with Energy monitoring (#4921)
- * Add support for multiple ADS1115 I2C devices (#5083)
- * Add support for online template change using command Template or GUI Configure Other (#5177)
- * Add support for Korean language translations (#5344)
- * Add support for sensor SCD30 (#5434)
- * Add parameter CFG_HOLDER to status 1 message (#5206)
- * Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name
- * Add Resolution property to Status 3 report providing previous SetOption second value property
- * Add property MqttCount to status 6 message representing number of Mqtt re-connections
- * Add property LinkCount to state and status 11 message representing number of Wifi Link re-connections
- * Add property Downtime to state and status 11 message representing the duration of wifi connection loss
- * Add variable %timestamp% to rules (#4749)
- * Add rule support for "==", "!=" ">=" and "<=" (#5122)
- * Add rule expression enabled by define USE_EXPRESSION in my_user_config.h (#5210)
- * Add Power status functionality to LED2 when configured leaving LED1 for Link status indication
- * Add user configuration of HLW8012 and HJL-01/BL0937 Energy Monitoring as used in Sonoff Pow and many Tuya based devices
- * Add user configuration of MCP39F501 Energy Monitoring as used in Shelly2
- * Add online template configuration using both commands and Configure Template menu option in GUI
- * Add (S)SerialSend3 escape sequence \x to allow hexadecimal byte value (#3560, #4947)
- * Add define DS18B20_INTERNAL_PULLUP to select internal input pullup when only one DS18B20 sensor is connected eliminating external resistor (#4738)
- * Add button control when no relay configured (#4682)
- * Add startup delay of 4 seconds to button control (#4829)
- * Add core version conditional compile options to provided PWM files (#4917)
- * Add resiliency to saved Settings (#5065)
- * Add MHZ19 Temperature as Domoticz Temperature selection (#5128)
- * Add HAss status sensor (#5139)
- * Add status message to former declined group commands (#5145)
- * Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431)
+Version 6.6.0 20190707
+ * Remove support of TLS on core 2.3.0 and extent support on core 2.4.2 and up
+ * Remove MQTT uptime message every hour
+ * Refactor some defines to const
+ * Refactor webserver HTML input, button, textarea, and select name based on id
+ * Refactor webserver sensor data collection
+ * Refactor TLS based on BearSSL, warning breaking change for fingerprints validation
+ * Refactor management of lights, using classes and integers instead of floats
+ * Refactor UDP initial message handling from string to char using static memory and add debug info (#5505)
+ * Refactor ``IRsend`` and receive for 64-bit support (#5523)
+ * Refactor MQTT which might solve issue (#5755)
+ * Refactor ``IRSend`` by using heap when more than 199 values need to be send. May need increase of define MQTT_MAX_PACKET_SIZE too (#5950)
+ * Refactor double to float in rules, and replaced trigonometric functions from stdlib with smaller versions (#6005)
+ * Change pubsubclient MQTT_KEEPALIVE from 10 to 30 seconds for AWS IoT support
+ * Change gamma correction as default behavior, ie "Ledtable 1"
+ * Change PWM resolution from 8 to 10 bits for low brightness lights
+ * Change ``IRSend`` Panasonic protocol to 64-bit (#5523)
+ * Change ADC0 to enabled by default in my_user_config.h (#5671)
+ * Change define USE_EMULATION by USE_EMULATION_HUE and USE_EMULATION_WEMO (#5826)
+ * Change default ``PowerDelta`` from 80% to 0% on new installations (#5858, #5028, #4813, #4130, #4145, #3795, #3778, #3660, #3648)
+ * Fix display Bug in KNX webmenu for Physical Address
+ * Fix the Unescape() function and the ``SendSerial3`` behaviour
+ * Fix webserver multiple Javascript window.onload functionality
+ * Fix TasmotaSerial at 9600 bps solving DFPlayer comms (#5528)
+ * Fix Configure Timer Web GUI (#5568)
+ * Fix Shelly 2.5 I2C address priority issue when VEML6070 code is present by disabling VEML6070 for Shelly 2.5 (#5592)
+ * Fix use of ``SerialDelimiter`` value 128 (#5634)
+ * Fix Sonoff Pow R2 / S31 invalid energy increments (#5789)
+ * Fix core 2.5.x ISR not in IRAM exception (#5837)
+ * Fix Philips Hue emulation Alexa issue by using part of MAC address for LightId (#5849)
+ * Fix missing white channel for WS2812 (#5869)
+ * Fix PZem startup issue (#5875)
+ * Fix exception 9 when syslog is enabled and NTP is just synced (#5917)
+ * Fix Toggle functionality to button double press when one button and two devices are detected (#5935)
+ * Fix command ``Channel`` for dual dimmers (#5940)
+ * Fix not restoring white value on power off/power on (#5993)
+ * Add command ``AdcParam`` to control ADC0 Temperature and Light formula parameters
+ * Add command ``LedMask`` to assign which relay has access to power LED (#5602, #5612)
+ * Add extended LED power control using command ``LedPowerX`` where X is 1 to 4. Enabled when "LedLink(i)" is configured too (#5709)
+ * Add command ``Sensor20 1..255`` to change Nova Fitness SDS01 working period in minutes (#5452)
+ * Add command ``SetOption38 6..255`` to set IRReceive protocol detection sensitivity mimizing UNKNOWN protocols (#5853)
+ * Add command ``SetOption39 1..255`` to control CSE7766 (Pow R2) or HLW8032 (Blitzwolf SHP5) handling of power loads below 6W. Default setting is 128 (#5756)
+ * Add command ``SetOption40 0..250`` to disable button functionality if activated for over 0.1 second. Needs SetOption1 1 and SetOption13 0 (#5449)
+ * Add command ``SetOption63 0/1`` to disable relay state feedback scan at restart (#5594, #5663)
+ * Add command ``SetOption64 0/1`` to switch between "-" or "_" as sensor index separator impacting DS18X20, DHT, BMP and SHT3X sensor names (#5689)
+ * Add command ``SetOption65 0/1`` and more Tuya Serial based device support (#5815)
+ * Add command ``WebColor`` to change GUI colors on the fly
+ * Add support for AWS IoT with TLS 1.2 on core 2.4.2 and up. Full doc here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT
+ * Add support for Badger HR-E Water Meter (#5539)
+ * Add support for Shelly 2.5 Energy and overtemp Monitoring (#5592)
+ * Add support for color and colortone for Philips Hue emulation via Alexa (#5600 #4809)
+ * Add support for Scripts as replacement for Rules. Default disabled but can be enabled in my_user_config.h (#5689)
+ * Add support for up to four LEDs related to four power outputs. Enabled when "LedLink(i)" is configured too (#5709)
+ * Add support for Shelly 1PM Template ``{"NAME":"Shelly 1PM","GPIO":[56,0,0,0,82,134,0,0,0,0,0,21,0],"FLAG":2,"BASE":18}`` (#5716)
+ * Add support for SPS30 Particle sensor thanks to Gerhard Mutz (#5830)
+ * Add support for VL53L0x time of flight sensor. Might interfere with TSL2561 using same I2C address (#5845)
+ * Add support for Sonoff L1 thanks to reef-actor (#6002)
+ * Add rule Http#Initialized
+ * Add rule System#Save executed just before a planned restart
+ * Add rule support for single JSON value pair like {"SSerialReceived":"on"} by expanding it to {"SSerialReceived":{"Data":"on"}} allowing for trigger SSerialReceived#Data=on (#5638)
+ * Add define USE_COUNTER to my_user_config.h to save space in sonoff-basic.bin and sonoff-minimal.bin
+ * Add define USE_DHT to my_user_config.h to save space in sonoff-basic.bin
+ * Add defines USE_EMULATION_WEMO and USE_EMULATION_HUE to my_user_config.h to control emulation features at compile time (#5826)
+ * Add Toggle functionality to button double press when more devices are detected
+ * Add device OverTemp (>73 Celsius) detection to Energy Monitoring devices with temperature sensor powering off all outputs
+ * Add Tuya Dimmer 10 second heartbeat serial packet required by some Tuya dimmer secondary MCUs
+ * Add all temperature, humidity and pressure for global access
+ * Add validation check when loading settings from flash
+ * Add HX711 weight restore after controlled restart or after power restore just before executing command Sensor34 7 (#5367, #5786)
+ * Add GUI hexadecimal color options in my_user_config.h (#5586)
+ * Add alternative ``IRSend`` command syntax ``IRSend raw,,,,,,,`` (#5610)
+ * Add user configurable ADC0 to Module and Template configuration compatible with current FLAG options (#5671)
+ * Add AriLux RF control GPIO option "ALux IrSel" (159) replacing "Led4i" (59) for full LED control (#5709)
+ * Add LED GPIO option "LedLink" (157) and "LedLinki" (158) to select dedicated link status LED (#5709)
+ * Add all 5 PWM channels individually adressable with LEDs. (#5741)
+ * Add reset of Energy values when connection to sensor is lost for over 4 seconds (#5874, #5881)
+ * Add checkbox to GUI password field enabling visibility during password entry only (#5934)
\ No newline at end of file
diff --git a/platformio.ini b/platformio.ini
index 99ff2aee8..48b23c8ef 100755
--- a/platformio.ini
+++ b/platformio.ini
@@ -10,6 +10,7 @@
[platformio]
src_dir = sonoff
build_dir = .pioenvs
+build_cache_dir = .cache
; *** Uncomment one of the lines below to build/upload only one environment
;default_envs = sonoff
diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino
index d00dc075d..5b26d35d3 100644
--- a/sonoff/_changelog.ino
+++ b/sonoff/_changelog.ino
@@ -1,4 +1,17 @@
/*********************************************************************************************\
+ * 6.6.0.14 20190925
+ * Change command Tariffx to allow time entries like 23 (hours), 1320 (minutes) or 23:00. NOTE: As this is development branch previous tariffs are lost! (#6488)
+ * Remove support for define USE_DS18x20_LEGACY and legacy DS18x20 driver (#6486)
+ * Add initial support for MQTT logging using command MqttLog (#6498)
+ * Add Zigbee more support - collect endpoints and clusters, added ZigbeeDump command
+ * Add initial support for shutters by Stefan Bode (#288)
+ *
+ * 6.6.0.13 20190922
+ * Add command EnergyReset4 x,x to initialize total usage for two tarrifs
+ * Add command EnergyReset5 x,x to initialize total export (or production) for two tarrifs
+ * Add command Sensor34 8,0 and Sensor34 8,1 to disable/enable JSON message on weight change over 4 gram
+ * Add JSON array index support to rules evaluation allowing trigger on ENERGY#POWER[2]>0.60 from JSON ..,"Power":[0.00,0.68],.. (#6160)
+ *
* 6.6.0.12 20190910
* Redesign command Tariff to now default to 0 (=disabled) and allowing to set both Standard Time (ST) and Daylight Savings Time (DST) start hour
* Commands Tariff1 22,23 = Tariff1 (Off-Peak) ST,DST Tariff2 (Standard) 6,7 = Tariff2 ST,DST Tariff9 0/1 = Weekend toggle (1 = Off-Peak during weekend)
diff --git a/sonoff/i18n.h b/sonoff/i18n.h
index c3f4333bc..5dae197a6 100644
--- a/sonoff/i18n.h
+++ b/sonoff/i18n.h
@@ -175,6 +175,8 @@
#define D_JSON_PV2_CURRENT "Pv2Current"
#define D_JSON_PV2_POWER "Pv2Power"
#define D_JSON_SOLAR_POWER "SolarPower"
+#define D_JSON_USAGE "Usage"
+#define D_JSON_EXPORT "Export"
#define D_RSLT_ENERGY "ENERGY"
#define D_RSLT_HASS_STATE "HASS_STATE"
@@ -289,6 +291,7 @@
#define D_JSON_BASE "BASE"
// Commands xdrv_01_mqtt.ino
+#define D_CMND_MQTTLOG "MqttLog"
#define D_CMND_MQTTHOST "MqttHost"
#define D_CMND_MQTTPORT "MqttPort"
#define D_CMND_MQTTRETRY "MqttRetry"
@@ -453,6 +456,7 @@
// Commands xdrv_23_zigbee.ino
#define D_CMND_ZIGBEE_PERMITJOIN "ZigbeePermitJoin"
+#define D_CMND_ZIGBEE_DUMP "ZigbeeDump"
#define D_CMND_ZIGBEEZNPSEND "ZigbeeZNPSend"
#define D_JSON_ZIGBEE_STATUS "ZigbeeStatus"
#define D_JSON_ZIGBEEZNPRECEIVED "ZigbeeZNPReceived"
diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h
index 69e35925d..1cc34be2c 100644
--- a/sonoff/language/bg-BG.h
+++ b/sonoff/language/bg-BG.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Използвана енергия вчера"
#define D_ENERGY_TOTAL "Използвана енергия общо"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Датчикът DS18x20 е зает"
#define D_SENSOR_CRC_ERROR "Датчик DS18x20 - грешка CRC"
diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h
index 3cc0d3197..c8a5713c8 100644
--- a/sonoff/language/cs-CZ.h
+++ b/sonoff/language/cs-CZ.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Spotřeba Včera"
#define D_ENERGY_TOTAL "Celková spotřeba"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor DS18x20 obsazen"
#define D_SENSOR_CRC_ERROR "Sensor DS18x20 chyba CRC"
diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h
index a516eeb42..295402d6b 100644
--- a/sonoff/language/de-DE.h
+++ b/sonoff/language/de-DE.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energie gestern"
#define D_ENERGY_TOTAL "Energie insgesamt"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor beschäftigt"
#define D_SENSOR_CRC_ERROR "Sensor CRC-Fehler"
diff --git a/sonoff/language/el-GR.h b/sonoff/language/el-GR.h
index 100791bb1..222c06ef6 100644
--- a/sonoff/language/el-GR.h
+++ b/sonoff/language/el-GR.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Ενέργεια χθες"
#define D_ENERGY_TOTAL "Ενέργεια συνολικά"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Ο αισθητήρας είναι απασχολημένος"
#define D_SENSOR_CRC_ERROR "Σφάλμα CRC αισθητήρα"
diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h
index 3e415c6e2..546d99af1 100644
--- a/sonoff/language/en-GB.h
+++ b/sonoff/language/en-GB.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energy Yesterday"
#define D_ENERGY_TOTAL "Energy Total"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor busy"
#define D_SENSOR_CRC_ERROR "Sensor CRC error"
diff --git a/sonoff/language/es-ES.h b/sonoff/language/es-ES.h
index bbd1d776a..b62e54661 100644
--- a/sonoff/language/es-ES.h
+++ b/sonoff/language/es-ES.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energía Ayer"
#define D_ENERGY_TOTAL "Energía Total"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor ocupado"
#define D_SENSOR_CRC_ERROR "Error CRC del Sensor"
diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h
index d08f654ff..6091da84f 100644
--- a/sonoff/language/fr-FR.h
+++ b/sonoff/language/fr-FR.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Énergie hier"
#define D_ENERGY_TOTAL "Énergie totale"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Capteur occupé"
#define D_SENSOR_CRC_ERROR "Erreur CRC capteur"
diff --git a/sonoff/language/he-HE.h b/sonoff/language/he-HE.h
index e2a54fe57..ee16e5073 100644
--- a/sonoff/language/he-HE.h
+++ b/sonoff/language/he-HE.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "צריכה בעבר"
#define D_ENERGY_TOTAL "צריכה כללית"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "שרת עסוק"
#define D_SENSOR_CRC_ERROR "בחיישן CRC שגיאת"
diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h
index 564d385c1..90a52b03a 100644
--- a/sonoff/language/hu-HU.h
+++ b/sonoff/language/hu-HU.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Tegnapi energia"
#define D_ENERGY_TOTAL "Összes energia"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Szenzor foglalt"
#define D_SENSOR_CRC_ERROR "Szenzor CRC hiba"
diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h
index cfb564eca..2a990dc8e 100644
--- a/sonoff/language/it-IT.h
+++ b/sonoff/language/it-IT.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energia Ieri"
#define D_ENERGY_TOTAL "Energia Totale"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensore occupato"
#define D_SENSOR_CRC_ERROR "Sensore errore CRC"
diff --git a/sonoff/language/ko-KO.h b/sonoff/language/ko-KO.h
index d713fa79d..7ffc5271d 100644
--- a/sonoff/language/ko-KO.h
+++ b/sonoff/language/ko-KO.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "어제 전력 사용량"
#define D_ENERGY_TOTAL "총 전력 사용량"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "센서가 사용 중"
#define D_SENSOR_CRC_ERROR "센서 CRC 에러"
diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h
index 03f77b4eb..822bf1542 100644
--- a/sonoff/language/nl-NL.h
+++ b/sonoff/language/nl-NL.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Verbruik gisteren"
#define D_ENERGY_TOTAL "Verbruik totaal"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor bezet"
#define D_SENSOR_CRC_ERROR "Sensor CRC fout"
diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h
index 6b4d35678..8729be3c7 100644
--- a/sonoff/language/pl-PL.h
+++ b/sonoff/language/pl-PL.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energia Wczoraj"
#define D_ENERGY_TOTAL "Energia suma"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Czujnik DS18x20 zajęty"
#define D_SENSOR_CRC_ERROR "Czujnik DS18x20 błąd CRC"
diff --git a/sonoff/language/pt-BR.h b/sonoff/language/pt-BR.h
index 388db5620..f1ec6326f 100644
--- a/sonoff/language/pt-BR.h
+++ b/sonoff/language/pt-BR.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Consumo energético de ontem"
#define D_ENERGY_TOTAL "Consumo total de energia"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor ocupado"
#define D_SENSOR_CRC_ERROR "Erro sensor CRC"
diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h
index 44e5b3469..0fac99308 100644
--- a/sonoff/language/pt-PT.h
+++ b/sonoff/language/pt-PT.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Consumo energético de ontem"
#define D_ENERGY_TOTAL "Consumo total de energial"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor ocupado"
#define D_SENSOR_CRC_ERROR "Erro Sensor CRC"
diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h
index 614fea8fe..2b0b68cb7 100644
--- a/sonoff/language/ru-RU.h
+++ b/sonoff/language/ru-RU.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Энергия Вчера"
#define D_ENERGY_TOTAL "Энергия Всего"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Датчик DS18x20 занят"
#define D_SENSOR_CRC_ERROR "Датчик DS18x20 - ошибка CRC"
diff --git a/sonoff/language/sk-SK.h b/sonoff/language/sk-SK.h
index 18e3fcb41..84385ee28 100644
--- a/sonoff/language/sk-SK.h
+++ b/sonoff/language/sk-SK.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Spotreba včera"
#define D_ENERGY_TOTAL "Celková spotreba"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor DS18x20 obsadený"
#define D_SENSOR_CRC_ERROR "Sensor DS18x20 chyba CRC"
diff --git a/sonoff/language/sv-SE.h b/sonoff/language/sv-SE.h
index 477e17e67..d55b6ddbc 100644
--- a/sonoff/language/sv-SE.h
+++ b/sonoff/language/sv-SE.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energi igår"
#define D_ENERGY_TOTAL "Energi totalt"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor upptagen"
#define D_SENSOR_CRC_ERROR "Sensor CRC-fel"
diff --git a/sonoff/language/tr-TR.h b/sonoff/language/tr-TR.h
index 6826c9e92..f31efe078 100755
--- a/sonoff/language/tr-TR.h
+++ b/sonoff/language/tr-TR.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Energy Yesterday"
#define D_ENERGY_TOTAL "Energy Total"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensör başgül"
#define D_SENSOR_CRC_ERROR "Sensor CRC hatası"
diff --git a/sonoff/language/uk-UK.h b/sonoff/language/uk-UK.h
index eb9db9913..dd21904d8 100644
--- a/sonoff/language/uk-UK.h
+++ b/sonoff/language/uk-UK.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "Енергія Вчора"
#define D_ENERGY_TOTAL "Енергія Всього"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Датчик DS18x20 зайнятий"
#define D_SENSOR_CRC_ERROR "Датчик DS18x20 - помилка CRC"
diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h
index 0f16bf057..0d776f40c 100644
--- a/sonoff/language/zh-CN.h
+++ b/sonoff/language/zh-CN.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "昨日用电量"
#define D_ENERGY_TOTAL "总用电量"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "传感器正忙"
#define D_SENSOR_CRC_ERROR "传感器 CRC 校验错误"
diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h
index 8d65c1c67..38d0b26be 100644
--- a/sonoff/language/zh-TW.h
+++ b/sonoff/language/zh-TW.h
@@ -442,6 +442,11 @@
#define D_ENERGY_YESTERDAY "昨日用電量"
#define D_ENERGY_TOTAL "總用電量"
+// xdrv_27_shutter.ino
+#define D_OPEN "Open"
+#define D_CLOSE "Close"
+#define D_DOMOTICZ_SHUTTER "Shutter"
+
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "傳感器正忙"
#define D_SENSOR_CRC_ERROR "傳感器 CRC 校驗錯誤"
diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h
index 17954ac65..a2a2eda67 100644
--- a/sonoff/my_user_config.h
+++ b/sonoff/my_user_config.h
@@ -313,6 +313,7 @@
#define USE_ARMTRONIX_DIMMERS // Add support for Armtronix Dimmers (+1k4 code)
#define USE_PS_16_DZ // Add support for PS-16-DZ Dimmer and Sonoff L1 (+2k code)
//#define ROTARY_V1 // Add support for MI Desk Lamp
+//#define USE_SHUTTER // Add Shutter support for up to 4 shutter with different motortypes (+6k code)
// -- Counter input -------------------------------
#define USE_COUNTER // Enable inputs as counter (+0k8 code)
@@ -321,11 +322,9 @@
//#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices
// -- One wire sensors ----------------------------
- // WARNING: Select none for default one DS18B20 sensor or enable one of the following two options for multiple sensors
-//#define USE_DS18x20_LEGACY // Optional for more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
-// #define W1_PARASITE_POWER // If using USE_DS18x20 then optimize for parasite powered sensors
-// #define DS18B20_INTERNAL_PULLUP // Use INPUT_PULLUP internal pullup resistors for single DS18B20
+// #define W1_PARASITE_POWER // Optimize for parasite powered sensors
+// #define DS18B20_INTERNAL_PULLUP // Use INPUT_PULLUP internal pullup resistor
// -- I2C sensors ---------------------------------
#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
@@ -498,10 +497,10 @@
#define IR_RCV_MIN_UNKNOWN_SIZE 6 // Set the smallest sized "UNKNOWN" message packets we actually care about (default 6, max 255)
// -- Zigbee interface ----------------------------
-//#define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP
- #define USE_ZIGBEE_PANID 0x1A63 // arbitrary PAN ID for Zigbee network, must be unique in the home
+//#define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP
+ #define USE_ZIGBEE_PANID 0x1A63 // arbitrary PAN ID for Zigbee network, must be unique in the home
#define USE_ZIGBEE_EXTPANID 0xCCCCCCCCCCCCCCCCL // arbitrary extended PAN ID
- #define USE_ZIGBEE_CHANNEL 0x00000800 // Zigbee Channel (11)
+ #define USE_ZIGBEE_CHANNEL 11 // Zigbee Channel (11-26)
#define USE_ZIGBEE_PRECFGKEY_L 0x0F0D0B0907050301L // note: changing requires to re-pair all devices
#define USE_ZIGBEE_PRECFGKEY_H 0x0D0C0A0806040200L // note: changing requires to re-pair all devices
#define USE_ZIGBEE_PERMIT_JOIN false // don't allow joining by default
diff --git a/sonoff/settings.h b/sonoff/settings.h
index 9fdfb1e34..c11926855 100644
--- a/sonoff/settings.h
+++ b/sonoff/settings.h
@@ -93,7 +93,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t spare27 : 1;
uint32_t spare28 : 1;
uint32_t spare29 : 1;
- uint32_t spare30 : 1;
+ uint32_t shutter_mode : 1; // bit 30 (v6.6.0.15) - SetOption80 - Enable shutter support
uint32_t spare31 : 1;
};
} SysBitfield3;
@@ -171,18 +171,18 @@ typedef union {
uint8_t spare3 : 1;
uint8_t spare4 : 1;
uint8_t spare5 : 1;
- uint8_t spare6 : 1;
+ uint8_t hx711_json_weight_change : 1; // Sensor34 8,x - Enable JSON message on weight change
uint8_t mhz19b_abc_disable : 1; // Disable ABC (Automatic Baseline Correction for MHZ19(B) (0 = Enabled (default), 1 = Disabled with Sensor15 command)
};
} SensorCfg1;
typedef struct {
uint32_t usage1_kWhtotal;
- uint32_t usage1_kWhtoday;
+ uint32_t usage2_kWhtotal;
uint32_t return1_kWhtotal;
uint32_t return2_kWhtotal;
uint32_t last_return_kWhtotal;
- uint32_t free;
+ uint32_t last_usage_kWhtotal;
} EnergyUsage;
@@ -227,7 +227,9 @@ struct SYSCFG {
uint8_t weblog_level; // 1AC
uint8_t mqtt_fingerprint[2][20]; // 1AD
uint8_t adc_param_type; // 1D5
- uint8_t register8[18]; // 1D6 - 18 x 8-bit registers indexed by enum SettingsRegister8
+ uint8_t register8[16]; // 1D6 - 16 x 8-bit registers indexed by enum SettingsRegister8
+ uint8_t shutter_accuracy; // 1E6
+ uint8_t mqttlog_level; // 1E7
uint8_t sps30_inuse_hours; // 1E8
char mqtt_host[33]; // 1E9 - Keep together with below as being copied as one chunck with reset 6
uint16_t mqtt_port; // 20A - Keep together
@@ -373,8 +375,17 @@ struct SYSCFG {
TuyaFnidDpidMap tuya_fnid_map[MAX_TUYA_FUNCTIONS]; // E00 32 bytes
uint16_t ina226_r_shunt[4]; // E20
uint16_t ina226_i_fs[4]; // E28
+ uint16_t tariff[4][2]; // E30
- uint8_t free_e30[456]; // E30
+ uint16_t shutter_opentime[MAX_SHUTTERS]; // E40
+ uint16_t shutter_closetime[MAX_SHUTTERS]; // E48
+ int16_t shuttercoeff[5][MAX_SHUTTERS]; // E50
+ uint8_t shutter_invert[MAX_SHUTTERS]; // E78
+ uint8_t shutter_set50percent[MAX_SHUTTERS]; // E7C
+ uint8_t shutter_position[MAX_SHUTTERS]; // E80
+ uint8_t shutter_startrelay[MAX_SHUTTERS]; // E84
+
+ uint8_t free_e88[368]; // E88
uint32_t cfg_timestamp; // FF8
uint32_t cfg_crc32; // FFC
@@ -425,7 +436,11 @@ struct XDRVMAILBOX {
char *command;
} XdrvMailbox;
+#ifdef USE_SHUTTER
+const uint8_t MAX_RULES_FLAG = 10; // Number of bits used in RulesBitfield (tricky I know...)
+#else
const uint8_t MAX_RULES_FLAG = 8; // Number of bits used in RulesBitfield (tricky I know...)
+#endif // USE_SHUTTER
typedef union { // Restricted by MISRA-C Rule 18.4 but so useful...
uint16_t data; // Allow bit manipulation
struct {
@@ -437,8 +452,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint16_t wifi_connected : 1;
uint16_t wifi_disconnected : 1;
uint16_t http_init : 1;
- uint16_t spare08 : 1;
- uint16_t spare09 : 1;
+ uint16_t shutter_moved : 1;
+ uint16_t shutter_moving : 1;
uint16_t spare10 : 1;
uint16_t spare11 : 1;
uint16_t spare12 : 1;
diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h
index 9cefa9ca1..5ee19873c 100644
--- a/sonoff/sonoff.h
+++ b/sonoff/sonoff.h
@@ -67,6 +67,7 @@ const uint8_t MAX_XNRG_DRIVERS = 32; // Max number of allowed energy driv
const uint8_t MAX_XDSP_DRIVERS = 32; // Max number of allowed display drivers
const uint8_t MAX_XDRV_DRIVERS = 96; // Max number of allowed driver drivers
const uint8_t MAX_XSNS_DRIVERS = 96; // Max number of allowed sensor drivers
+const uint8_t MAX_SHUTTERS = 4; // Max number of shutters
const uint8_t MAX_RULE_MEMS = 5; // Max number of saved vars
const uint8_t MAX_RULE_SETS = 3; // Max number of rule sets of size 512 characters
const uint16_t MAX_RULE_SIZE = 512; // Max number of characters in rules
@@ -113,7 +114,7 @@ const uint16_t SERIALLOG_TIMER = 600; // Seconds to disable SerialLog
const uint8_t OTA_ATTEMPTS = 5; // Number of times to try fetching the new firmware
const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in (serial and http) command buffer
-const uint16_t FLOATSZ = 33; // Max number of characters in float result from dtostrfd
+const uint16_t FLOATSZ = 16; // Max number of characters in float result from dtostrfd (max 32)
const uint16_t CMDSZ = 24; // Max number of characters in command
const uint16_t TOPSZ = 100; // Max number of characters in topic string
const uint16_t LOGSZ = 520; // Max number of characters in log
@@ -252,13 +253,13 @@ enum SettingsParamIndex { P_HOLD_TIME, P_MAX_POWER_RETRY, P_ex_TUYA_DIMMER_ID, P
P_ex_ENERGY_TARIFF1, P_ex_ENERGY_TARIFF2, // SetOption47 .. SetOption48
P_MAX_PARAM8 }; // Max is PARAM8_SIZE (18) - SetOption32 until SetOption49
-enum SettingsRegister8 { R8_ENERGY_TARIFF1_ST, R8_ENERGY_TARIFF2_ST, R8_ENERGY_TARIFF1_DS, R8_ENERGY_TARIFF2_DS,
+enum SettingsRegister8 { R8_SPARE00, R8_SPARE01, R8_SPARE02, R8_SPARE03,
R8_SPARE04, R8_SPARE05, R8_SPARE06, R8_SPARE07,
R8_SPARE08, R8_SPARE09, R8_SPARE10, R8_SPARE11,
- R8_SPARE12, R8_SPARE13, R8_SPARE14, R8_SPARE15,
- R8_SPARE16, R8_SPARE17 }; // Max size is 18 (Settings.register8[])
+ R8_SPARE12, R8_SPARE13, R8_SPARE14, R8_SPARE15 }; // Max size is 16 (Settings.register8[])
-enum DomoticzSensors {DZ_TEMP, DZ_TEMP_HUM, DZ_TEMP_HUM_BARO, DZ_POWER_ENERGY, DZ_ILLUMINANCE, DZ_COUNT, DZ_VOLTAGE, DZ_CURRENT, DZ_AIRQUALITY, DZ_P1_SMART_METER, DZ_MAX_SENSORS};
+enum DomoticzSensors {DZ_TEMP, DZ_TEMP_HUM, DZ_TEMP_HUM_BARO, DZ_POWER_ENERGY, DZ_ILLUMINANCE, DZ_COUNT, DZ_VOLTAGE, DZ_CURRENT,
+ DZ_AIRQUALITY, DZ_P1_SMART_METER, DZ_SHUTTER, DZ_MAX_SENSORS};
enum Ws2812ClockIndex { WS_SECOND, WS_MINUTE, WS_HOUR, WS_MARKER };
enum Ws2812Color { WS_RED, WS_GREEN, WS_BLUE };
@@ -282,8 +283,10 @@ enum XsnsFunctions {FUNC_SETTINGS_OVERRIDE, FUNC_PIN_STATE, FUNC_MODULE_INIT, FU
enum AddressConfigSteps { ADDR_IDLE, ADDR_RECEIVE, ADDR_SEND };
enum CommandSource { SRC_IGNORE, SRC_MQTT, SRC_RESTART, SRC_BUTTON, SRC_SWITCH, SRC_BACKLOG, SRC_SERIAL, SRC_WEBGUI, SRC_WEBCOMMAND, SRC_WEBCONSOLE, SRC_PULSETIMER,
- SRC_TIMER, SRC_RULE, SRC_MAXPOWER, SRC_MAXENERGY, SRC_OVERTEMP, SRC_LIGHT, SRC_KNX, SRC_DISPLAY, SRC_WEMO, SRC_HUE, SRC_RETRY, SRC_REMOTE, SRC_MAX };
-const char kCommandSource[] PROGMEM = "I|MQTT|Restart|Button|Switch|Backlog|Serial|WebGui|WebCommand|WebConsole|PulseTimer|Timer|Rule|MaxPower|MaxEnergy|Overtemp|Light|Knx|Display|Wemo|Hue|Retry|Remote";
+ SRC_TIMER, SRC_RULE, SRC_MAXPOWER, SRC_MAXENERGY, SRC_OVERTEMP, SRC_LIGHT, SRC_KNX, SRC_DISPLAY, SRC_WEMO, SRC_HUE, SRC_RETRY, SRC_REMOTE, SRC_SHUTTER,
+ SRC_MAX };
+const char kCommandSource[] PROGMEM = "I|MQTT|Restart|Button|Switch|Backlog|Serial|WebGui|WebCommand|WebConsole|PulseTimer|"
+ "Timer|Rule|MaxPower|MaxEnergy|Overtemp|Light|Knx|Display|Wemo|Hue|Retry|Remote|Shutter";
const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };
diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino
index ff771c95e..07862a9a5 100755
--- a/sonoff/sonoff.ino
+++ b/sonoff/sonoff.ino
@@ -138,6 +138,8 @@ uint8_t seriallog_level; // Current copy of Settings.seriallo
uint8_t syslog_level; // Current copy of Settings.syslog_level
uint8_t my_module_type; // Current copy of Settings.module or user template type
uint8_t my_adc0; // Active copy of Module ADC0
+uint8_t last_source = 0; // Last command source
+uint8_t shutters_present = 0; // Number of actual define shutters
//uint8_t mdns_delayed_start = 0; // mDNS delayed start
bool serial_local = false; // Handle serial locally;
bool fallback_topic_flag = false; // Use Topic or FallbackTopic
@@ -745,10 +747,7 @@ bool MqttShowSensor(void)
}
}
XsnsCall(FUNC_JSON_APPEND);
-
-#ifdef USE_SCRIPT_JSON_EXPORT
XdrvCall(FUNC_JSON_APPEND);
-#endif
bool json_data_available = (strlen(mqtt_data) - json_data_start);
if (strstr_P(mqtt_data, PSTR(D_JSON_PRESSURE)) != nullptr) {
diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h
index dacdf3b4b..3a792f569 100644
--- a/sonoff/sonoff_post.h
+++ b/sonoff/sonoff_post.h
@@ -83,6 +83,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#undef CODE_IMAGE
#define CODE_IMAGE 3
+#undef USE_DISCOVERY // Disable mDNS (+8k code or +23.5k code with core 2_5_x, +0.3k mem)
+
// -- Optional modules -------------------------
#define USE_SONOFF_IFAN // Add support for Sonoff iFan02 and iFan03 (+2k code)
#define USE_TUYA_MCU // Add support for Tuya Serial MCU
@@ -96,7 +98,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#define USE_COUNTER // Enable counters
#undef USE_ADC_VCC // Add Analog input on selected devices
#define USE_DS18x20 // For more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
-//#define USE_DS18x20_LEGACY // For more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
#define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code)
@@ -413,7 +414,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
* Mandatory define for DS18x20 if changed by above image selections
\*********************************************************************************************/
-#if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY)
+#if defined(USE_DS18x20)
#else
#define USE_DS18B20 // Default DS18B20 sensor needs no external library
#endif
@@ -459,7 +460,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#undef USE_COUNTER // Disable counters
#undef USE_DS18x20 // Disable DS18x20 sensor
-#undef USE_DS18x20_LEGACY // Disable DS18x20 sensor
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#undef USE_I2C // Disable all I2C sensors and devices
#undef USE_SPI // Disable all SPI devices
@@ -544,7 +544,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#undef USE_COUNTER // Disable counters
#undef USE_DS18x20 // Disable DS18x20 sensor
-#undef USE_DS18x20_LEGACY // Disable DS18x20 sensor
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#undef USE_I2C // Disable all I2C sensors and devices
#undef USE_SPI // Disable all SPI devices
diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h
index 0ab4d0752..e0f3c6e06 100644
--- a/sonoff/sonoff_template.h
+++ b/sonoff/sonoff_template.h
@@ -531,7 +531,7 @@ const uint8_t kGpioNiceList[] PROGMEM = {
GPIO_DHT22, // DHT21, DHT22, AM2301, AM2302, AM2321
GPIO_SI7021, // iTead SI7021
#endif
-#if defined(USE_DS18B20) || defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY)
+#if defined(USE_DS18B20) || defined(USE_DS18x20)
GPIO_DSB, // Single wire DS18B20 or DS18S20
#endif
diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h
index dc8f2f2e9..02af08bab 100644
--- a/sonoff/sonoff_version.h
+++ b/sonoff/sonoff_version.h
@@ -20,6 +20,6 @@
#ifndef _SONOFF_VERSION_H_
#define _SONOFF_VERSION_H_
-const uint32_t VERSION = 0x0606000C;
+const uint32_t VERSION = 0x0606000E;
#endif // _SONOFF_VERSION_H_
diff --git a/sonoff/support.ino b/sonoff/support.ino
index 6fd41b8f0..0a8b6c42c 100644
--- a/sonoff/support.ino
+++ b/sonoff/support.ino
@@ -125,7 +125,7 @@ size_t strcspn(const char *str1, const char *str2)
}
// https://clc-wiki.net/wiki/C_standard_library:string.h:strpbrk
-// Locate the first occurrence in the string pointed to by s1 of any character from the string pointed to by s2
+// Locate the first occurrence in the string pointed to by s1 of any character from the string pointed to by s2
char* strpbrk(const char *s1, const char *s2)
{
while(*s1) {
@@ -1264,6 +1264,7 @@ void SetNextTimeInterval(unsigned long& timer, const unsigned long step)
#ifdef USE_I2C
const uint8_t I2C_RETRY_COUNTER = 3;
+uint32_t i2c_active[4] = { 0 };
uint32_t i2c_buffer = 0;
bool I2cValidRead(uint8_t addr, uint8_t reg, uint8_t size)
@@ -1457,12 +1458,35 @@ void I2cScan(char *devs, unsigned int devs_len)
}
}
+void I2cSetActive(uint32_t addr, uint32_t count = 1)
+{
+ addr &= 0x7F;
+ count &= 0x7F;
+ while (count-- && (addr < 128)) {
+ i2c_active[addr / 32] |= (1 << (addr % 32));
+ addr++;
+ }
+// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("I2C: Active %08X,%08X,%08X,%08X"), i2c_active[0], i2c_active[1], i2c_active[2], i2c_active[3]);
+}
+
+bool I2cActive(uint32_t addr)
+{
+ addr &= 0x7F;
+ if (i2c_active[addr / 32] & (1 << (addr % 32))) {
+ return true;
+ }
+ return false;
+}
+
bool I2cDevice(uint8_t addr)
{
+ if (I2cActive(addr)) {
+ return false; // If already active report as not present;
+ }
for (uint8_t address = 1; address <= 127; address++) {
Wire.beginTransmission(address);
if (!Wire.endTransmission() && (address == addr)) {
- return true;
+ return true; // Report as present;
}
}
return false;
@@ -1571,6 +1595,7 @@ void AddLog(uint32_t loglevel)
if (!web_log_index) web_log_index++; // Index 0 is not allowed as it is the end of char string
}
#endif // USE_WEBSERVER
+ if (!global_state.mqtt_down && (loglevel <= Settings.mqttlog_level)) { MqttPublishLogging(mxtime); }
if (!global_state.wifi_down && (loglevel <= syslog_level)) { Syslog(); }
}
diff --git a/sonoff/support_command.ino b/sonoff/support_command.ino
index fff2831cb..0e2f6d4e6 100644
--- a/sonoff/support_command.ino
+++ b/sonoff/support_command.ino
@@ -185,6 +185,18 @@ void CommandHandler(char* topic, uint8_t* data, uint32_t data_len)
XdrvMailbox.topic = type;
XdrvMailbox.data = dataBuf;
+#ifdef USE_SCRIPT_SUB_COMMAND
+ // allow overwrite tasmota cmds
+ if (!Script_SubCmd()) {
+ if (!DecodeCommand(kTasmotaCommands, TasmotaCommand)) {
+ if (!XdrvCall(FUNC_COMMAND)) {
+ if (!XsnsCall(FUNC_COMMAND)) {
+ type = nullptr; // Unknown command
+ }
+ }
+ }
+ }
+#else //USE_SCRIPT_SUB_COMMAND
if (!DecodeCommand(kTasmotaCommands, TasmotaCommand)) {
if (!XdrvCall(FUNC_COMMAND)) {
if (!XsnsCall(FUNC_COMMAND)) {
@@ -192,6 +204,8 @@ void CommandHandler(char* topic, uint8_t* data, uint32_t data_len)
}
}
}
+#endif //USE_SCRIPT_SUB_COMMAND
+
}
if (type == nullptr) {
diff --git a/sonoff/support_features.ino b/sonoff/support_features.ino
index 35d900041..9b5e05747 100644
--- a/sonoff/support_features.ino
+++ b/sonoff/support_features.ino
@@ -243,7 +243,7 @@ void GetFeatures(void)
feature_sns1 |= 0x00000010; // xsns_05_ds18b20.ino
#endif
#ifdef USE_DS18x20_LEGACY
- feature_sns1 |= 0x00000020; // xsns_05_ds18x20_legacy.ino
+ feature_sns1 |= 0x00000020; // xsns_05_ds18x20_legacy.ino - no more supported since 6.6.0.14
#endif
#ifdef USE_DS18x20
feature_sns1 |= 0x00000040; // xsns_05_ds18x20.ino
diff --git a/sonoff/support_rtc.ino b/sonoff/support_rtc.ino
index 961869687..b799003c4 100644
--- a/sonoff/support_rtc.ino
+++ b/sonoff/support_rtc.ino
@@ -120,10 +120,17 @@ String GetBuildDateAndTime(void)
return String(bdt); // 2017-03-07T11:08:02
}
+String GetMinuteTime(uint32_t minutes)
+{
+ char tm[6];
+ snprintf_P(tm, sizeof(tm), PSTR("%02d:%02d"), minutes / 60, minutes % 60);
+
+ return String(tm); // 03:45
+}
+
String GetTimeZone(void)
{
char tz[7];
-
snprintf_P(tz, sizeof(tz), PSTR("%+03d:%02d"), Rtc.time_timezone / 60, abs(Rtc.time_timezone % 60));
return String(tz); // -03:45
diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino
index ec1303c33..c4239e90f 100644
--- a/sonoff/xdrv_01_webserver.ino
+++ b/sonoff/xdrv_01_webserver.ino
@@ -91,8 +91,48 @@ const char HTTP_SCRIPT_COUNTER[] PROGMEM =
"}"
"wl(u);";
-const char HTTP_SCRIPT_ROOT[] PROGMEM =
+const char HTTP_SCRIPT_ROOT[] PROGMEM =
+#ifdef USE_SCRIPT_WEB_DISPLAY
+ "var rfsh=1;"
+ "function la(p){"
+ "var a='';"
+ "if(la.arguments.length==1){"
+ "a=p;"
+ "clearTimeout(lt);"
+ "}"
+ "if(x!=null){x.abort();}" // Abort if no response within 2 seconds (happens on restart 1)
+ "x=new XMLHttpRequest();"
+ "x.onreadystatechange=function(){"
+ "if(x.readyState==4&&x.status==200){"
+ "var s=x.responseText.replace(/{t}/g,\"