Merge pull request #69 from arendst/development

Update from Tasmota
This commit is contained in:
Adrian Scillato 2018-04-23 12:29:25 -03:00 committed by GitHub
commit c5844bbdfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 296 additions and 51 deletions

114
README.md
View File

@ -149,11 +149,9 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute!
Current version is **5.12.0m** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. Current version is **5.12.0m** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### Quick install ### Quick install
Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki. Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki.
### Important User Compilation Information ### Important User Compilation Information
If you want to compile Sonoff-Tasmota yourself keep in mind the following: If you want to compile Sonoff-Tasmota yourself keep in mind the following:
- Only Flash Mode **DOUT** is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device. See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information. - Only Flash Mode **DOUT** is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device. See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information.
@ -161,7 +159,6 @@ If you want to compile Sonoff-Tasmota yourself keep in mind the following:
- To make compile time changes to Sonoff-Tasmota it can use the ``user_config_override.h`` file. It assures keeping your settings when you download and compile a new version. To use ``user_config.override.h`` you will have to make a copy of the provided ``user_config.override_sample.h`` file and add your setting overrides. To enable the override file you will need to use a compile define as documented in the ``user_config_override_sample.h`` file. - To make compile time changes to Sonoff-Tasmota it can use the ``user_config_override.h`` file. It assures keeping your settings when you download and compile a new version. To use ``user_config.override.h`` you will have to make a copy of the provided ``user_config.override_sample.h`` file and add your setting overrides. To enable the override file you will need to use a compile define as documented in the ``user_config_override_sample.h`` file.
### Version Information ### Version Information
- Sonoff-Tasmota provides all (Sonoff) modules in one file and starts with module Sonoff Basic. - Sonoff-Tasmota provides all (Sonoff) modules in one file and starts with module Sonoff Basic.
- Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```. - Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```.
- After reboot select config menu again or use commands ```GPIOs``` and ```GPIO``` to change GPIO with desired sensor. - After reboot select config menu again or use commands ```GPIOs``` and ```GPIO``` to change GPIO with desired sensor.
@ -204,8 +201,74 @@ The following devices are supported:
- [Luani HVIO board](https://luani.de/projekte/esp8266-hvio/) - [Luani HVIO board](https://luani.de/projekte/esp8266-hvio/)
- Wemos D1 mini, NodeMcu and Ledunia - Wemos D1 mini, NodeMcu and Ledunia
### Contribute ### Firmware release information
Different firmware images are released based on Features and Sensors selection guided by code and memory usage.
- The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter.
- The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions.
#### Available Features and Sensors
| Feature or Sensor | sonoff | classic | minimal | knx | allsensors |
|--------------------------------|--------|---------|---------|-----|------------|
| MY_LANGUAGE en-GB | x | x | x | x | x |
| MQTT_LIBRARY_TYPE PUBSUBCLIENT | x | x | x | x | x |
| USE_DOMOTICZ | x | x | - | x | x |
| USE_HOME_ASSISTANT | x | x | - | x | x |
| USE_MQTT_TLS | - | - | - | - | - |
| USE_KNX | - | - | - | x | - |
| USE_WEBSERVER | x | x | x | x | x |
| USE_EMULATION | x | x | - | - | x |
| USE_DISCOVERY | x | x | - | x | x |
| WEBSERVER_ADVERTISE | x | x | - | x | x |
| MQTT_HOST_DISCOVERY | x | x | - | x | x |
| USE_TIMERS | x | - | - | x | x |
| USE_TIMERS_WEB | x | - | - | x | x |
| USE_SUNRISE | x | - | - | x | x |
| USE_RULES | x | - | - | x | x |
| | | | | | |
| USE_ADC_VCC | x | x | x | x | x |
| USE_DS18B20 | x | x | - | x | - |
| USE_DS18x20 | - | - | - | - | x |
| USE_DS18x20_LEGACY | - | - | - | - | - |
| USE_I2C | x | x | - | x | x |
| USE_SHT | x | x | - | x | x |
| USE_SHT3X | x | x | - | x | x |
| USE_HTU | x | x | - | x | x |
| USE_BMP | x | x | - | x | x |
| USE_BME680 | - | - | - | - | x |
| USE_SGP30 | x | - | - | x | x |
| USE_BH1750 | x | x | - | x | x |
| USE_VEML6070 | - | - | - | - | x |
| USE_TSL2561 | - | - | - | - | x |
| USE_ADS1115 | - | - | - | - | x |
| USE_ADS1115_I2CDEV | - | - | - | - | - |
| USE_INA219 | - | - | - | - | x |
| USE_MGS | - | - | - | - | x |
| USE_SPI | - | - | - | - | - |
| USE_MHZ19 | x | x | - | x | x |
| USE_SENSEAIR | x | x | - | x | x |
| USE_PMS5003 | x | x | - | x | x |
| USE_NOVA_SDS | x | - | - | x | x |
| USE_PZEM004T | x | x | - | x | x |
| USE_SERIAL_BRIDGE | x | - | - | x | x |
| USE_IR_REMOTE | x | x | - | x | x |
| USE_IR_HVAC | - | - | - | - | x |
| USE_IR_RECEIVE | x | - | - | x | x |
| USE_WS2812 | x | x | - | x | x |
| USE_WS2812_DMA | - | - | - | - | - |
| USE_ARILUX_RF | x | x | - | x | x |
| USE_SR04 | x | - | - | x | x |
#### Typical file size
| ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors |
|--------------------------------|--------|---------|---------|------|------------|
| ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k |
| ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k |
| ESP/Arduino lib v2.4.1 | 533k | 498k | 436k | 542k | 554k |
### Contribute
You can contribute to Sonoff-Tasmota by You can contribute to Sonoff-Tasmota by
- providing Pull Requests (Features, Proof of Concepts, Language files or Fixes) - providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
- testing new released features and report issues - testing new released features and report issues
@ -213,6 +276,49 @@ You can contribute to Sonoff-Tasmota by
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota) [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota)
### Credits
#### Libraries used
Libraries used with Sonoff-Tasmota are:
- [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)
- [Adafruit BME680](https://github.com/adafruit/Adafruit_BME680)
- [Adafruit Sensor](https://github.com/adafruit/Adafruit_Sensor)
- [Adafruit SGP30](https://github.com/adafruit/Adafruit_SGP30)
- [ArduinoJson](https://arduinojson.org/)
- [Esp8266MqttClient](https://github.com/tuanpmt/ESP8266MQTTClient)
- [esp-knx-ip](https://github.com/envy/esp-knx-ip)
- [esp-mqtt-arduino](https://github.com/i-n-g-o/esp-mqtt-arduino)
- [I2Cdevlib](https://github.com/jrowberg/i2cdevlib)
- [IRremoteEsp8266](https://github.com/markszabo/IRremoteESP8266)
- [JobaTsl2561](https://github.com/joba-1/Joba_Tsl2561)
- [MultiChannelGasSensor](http://wiki.seeedstudio.com/Grove-Multichannel_Gas_Sensor/)
- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus)
- [OneWire](https://github.com/PaulStoffregen/OneWire)
- [PubSubClient](https://github.com/knolleary/pubsubclient)
#### People inspiring me
People helping to keep the show on the road:
- David Lang providing initial issue resolution and code optimizations
- Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers
- Wiktor Schmidt for Travis CI implementation
- Thom Dietrich for PlatformIO optimizations
- Marinus van den Broek for his EspEasy groundwork
- Pete Ba for more user friendly energy monitor calibration
- Lobradov providing compile optimization tips
- Flexiti for his initial timer implementation
- reloxx13 for his [SonWeb](https://github.com/reloxx13/SonWEB) management tool
- Joachim Banzhaf for his TSL2561 library and driver
- Gijs Noorlander for his MHZ19 and SenseAir drivers
- Emontnemery for his HomeAssistant Discovery concept and many code tuning tips
- Aidan Mountford for his HSB support
- Daniel Ztolnai for his Serial Bridge implementation
- Gerhard Mutz for his SGP30 and Sunrise/Sunset driver
- Nuno Ferreira for his HC-SR04 driver
- Adrian Scillato for his (security)fixes and implementing and maintaining KNX
- Raymond Mouthaan for managing Wemos Wiki information
- Norbert Richter, Frogmore42 and Jason2866 for providing many issue answers
- Many more providing Tips, Pocs or PRs
### License ### License
This program is licensed under GPL-3.0 This program is licensed under GPL-3.0

View File

@ -13,8 +13,11 @@ src_dir = sonoff
; *** Uncomment one of the lines below to build/upload only one environment ; *** Uncomment one of the lines below to build/upload only one environment
;env_default = sonoff ;env_default = sonoff
;env_default = sonoff-minimal ;env_default = sonoff-minimal
;env_default = sonoff-xxl ;env_default = sonoff-classic
;env_default = sonoff-knx
;env_default = sonoff-allsensors
;env_default = sonoff-BG ;env_default = sonoff-BG
;env_default = sonoff-CN
;env_default = sonoff-CZ ;env_default = sonoff-CZ
;env_default = sonoff-DE ;env_default = sonoff-DE
;env_default = sonoff-ES ;env_default = sonoff-ES
@ -26,7 +29,6 @@ src_dir = sonoff
;env_default = sonoff-PL ;env_default = sonoff-PL
;env_default = sonoff-PT ;env_default = sonoff-PT
;env_default = sonoff-RU ;env_default = sonoff-RU
;env_default = sonoff-CN
;env_default = sonoff-TW ;env_default = sonoff-TW
[env:sonoff] [env:sonoff]
@ -71,7 +73,35 @@ extra_scripts = pio/strip-floats.py
; Serial Monitor options ; Serial Monitor options
monitor_baud = 115200 monitor_baud = 115200
[env:sonoff-xxl] [env:sonoff-classic]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; Serial Monitor options
monitor_baud = 115200
[env:sonoff-knx]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; Serial Monitor options
monitor_baud = 115200
[env:sonoff-allsensors]
;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0 ;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266 platform = espressif8266
@ -85,20 +115,6 @@ extra_scripts = pio/strip-floats.py
; Serial Monitor options ; Serial Monitor options
monitor_baud = 115200 monitor_baud = 115200
[env:sonoff-CZ]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; *** Serial Monitor options
monitor_baud = 115200
[env:sonoff-BG] [env:sonoff-BG]
;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0 ;platform = espressif8266@1.6.0 ; v2.4.0
@ -113,6 +129,34 @@ extra_scripts = pio/strip-floats.py
; *** Serial Monitor options ; *** Serial Monitor options
monitor_baud = 115200 monitor_baud = 115200
[env:sonoff-CN]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; *** Serial Monitor options
monitor_baud = 115200
[env:sonoff-CZ]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; *** Serial Monitor options
monitor_baud = 115200
[env:sonoff-DE] [env:sonoff-DE]
;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0 ;platform = espressif8266@1.6.0 ; v2.4.0
@ -253,20 +297,6 @@ extra_scripts = pio/strip-floats.py
; *** Serial Monitor options ; *** Serial Monitor options
monitor_baud = 115200 monitor_baud = 115200
[env:sonoff-CN]
;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN
;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -DUSE_CONFIG_OVERRIDE
extra_scripts = pio/strip-floats.py
; *** Serial Monitor options
monitor_baud = 115200
[env:sonoff-TW] [env:sonoff-TW]
;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.5.0 ; v2.3.0
;platform = espressif8266@1.6.0 ; v2.4.0 ;platform = espressif8266@1.6.0 ; v2.4.0

View File

@ -1,11 +1,16 @@
/* 5.12.0m /* 5.12.0m
* Reinit timers to accomodate random window (#2447) * Reinit timers to accomodate random window (#2447)
* Remove sonoff-xxl
* Add sonoff-classic, sonoff-allsensors and sonoff-knx
* Add some coloring to important web buttons
* Add user selectable defines for Sunrise/set Dawn option (#2378)
* Add random window to timers (#2447) * Add random window to timers (#2447)
* Add optional KNX IP Protocol Support (#2402) * Add optional KNX IP Protocol Support (#2402)
* Add Greek language file (#2491) * Add Greek language file (#2491)
* Add Bulgarian language file * Add Bulgarian language file
* Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444) * Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444)
* Add support for Sonoff Pow R2 (#2340) * Add support for Sonoff Pow R2 (#2340)
* Add GPIO_User to GPIO02 for all Sonoff T1 (#2524)
* Fix compile error when using ESP/Arduino library v2.3.0 by reverting KNX async UDP library to default UDP library (#2488, #2492, #2493) * Fix compile error when using ESP/Arduino library v2.3.0 by reverting KNX async UDP library to default UDP library (#2488, #2492, #2493)
* Fix configuration filename truncation when it contains spaces (#2484, #2490) * Fix configuration filename truncation when it contains spaces (#2484, #2490)
* *
@ -111,7 +116,7 @@
* Add support for sensor SHTC3 (#1967) * Add support for sensor SHTC3 (#1967)
* *
* 5.12.0a * 5.12.0a
* Change platformio option sonoff-ds18x20 to sonoff-xxl enabling ds18x20 and all other sensors in one image * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image
* Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850) * Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850)
* Change default parameters in user_config.h to undefined for easy installation (#1851) * Change default parameters in user_config.h to undefined for easy installation (#1851)
* Change max user configurable hold time from 10 to 25 seconds (#1851) * Change max user configurable hold time from 10 to 25 seconds (#1851)

View File

@ -127,6 +127,12 @@ typedef unsigned long power_t; // Power (Relay) type
#define MQTT_TASMOTAMQTT 2 // Mqtt TasmotaMqtt library based on esp-mqtt-arduino #define MQTT_TASMOTAMQTT 2 // Mqtt TasmotaMqtt library based on esp-mqtt-arduino
#define MQTT_ESPMQTTARDUINO 3 // Mqtt esp-mqtt-arduino library by Ingo Randolf #define MQTT_ESPMQTTARDUINO 3 // Mqtt esp-mqtt-arduino library by Ingo Randolf
// Sunrise and Sunset DawnType
#define DAWN_NORMAL -0.8333
#define DAWN_CIVIL -6.0
#define DAWN_NAUTIC -12.0
#define DAWN_ASTRONOMIC -18.0
/*********************************************************************************************\ /*********************************************************************************************\
* Enumeration * Enumeration
\*********************************************************************************************/ \*********************************************************************************************/

View File

@ -20,6 +20,10 @@
#ifndef _SONOFF_POST_H_ #ifndef _SONOFF_POST_H_
#define _SONOFF_POST_H_ #define _SONOFF_POST_H_
/*********************************************************************************************\
* Function declarations
\*********************************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -38,9 +42,18 @@ void WifiWpsStatusCallback(wps_cb_status status);
void KNX_CB_Action(message_t const &msg, void *arg); void KNX_CB_Action(message_t const &msg, void *arg);
//#endif // USE_KNX //#endif // USE_KNX
/*********************************************************************************************\
* Default global defines
\*********************************************************************************************/
#define USE_DHT // Default DHT11 sensor needs no external library #define USE_DHT // Default DHT11 sensor needs no external library
#ifdef USE_ALL_SENSORS // ===================== Configure sonoff-xxl.bin ========================= /*********************************************************************************************\
* [sonoff-allsensors.bin]
* Provide an image with all supported sensors enabled
\*********************************************************************************************/
#ifdef USE_ALL_SENSORS
#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices #define USE_ADC_VCC // Display Vcc in Power status. Disable for use as 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 // 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_DS18x20_LEGACY // For more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
@ -80,14 +93,75 @@ void KNX_CB_Action(message_t const &msg, void *arg);
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
#define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0)) #define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
#define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) #define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code)
#endif // USE_ALL_SENSORS ===================== #endif // USE_ALL_SENSORS
/*********************************************************************************************\
* [sonoff-classic.bin]
* Provide an image close to version 5.12.0 but still within 499k program space to allow one time OTA
\*********************************************************************************************/
#ifdef USE_CLASSIC
#ifdef USE_KNX
#undef USE_KNX
#endif
#ifdef USE_TIMERS
#undef USE_TIMERS
#endif
#ifdef USE_TIMERS_WEB
#undef USE_TIMERS_WEB
#endif
#ifdef USE_SUNRISE
#undef USE_SUNRISE
#endif
#ifdef USE_RULES
#undef USE_RULES
#endif
#ifdef USE_SGP30
#undef USE_SGP30
#endif
#ifdef USE_NOVA_SDS
#undef USE_NOVA_SDS
#endif
#ifdef USE_IR_RECEIVE
#undef USE_IR_RECEIVE
#endif
#ifdef USE_SERIAL_BRIDGE
#undef USE_SERIAL_BRIDGE
#endif
#ifdef USE_SR04
#undef USE_SR04
#endif
#endif // USE_CLASSIC
/*********************************************************************************************\
* [sonoff-knx.bin]
* Provide a dedicated KNX image allowing enough code and memory space
\*********************************************************************************************/
#ifdef USE_KNX_NO_EMULATION
#ifndef USE_KNX
#define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem)
#endif
#ifdef USE_EMULATION
#undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem)
#endif
#endif // USE_KNX_NO_EMULATION
/*********************************************************************************************\
* Mandatory define for DS18x20 if changed by above image selections
\*********************************************************************************************/
#if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY) #if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY)
#else #else
#define USE_DS18B20 // Default DS18B20 sensor needs no external library #define USE_DS18B20 // Default DS18B20 sensor needs no external library
#endif #endif
#ifdef BE_MINIMAL // ========================== Configure sonoff-minimal.bin ===================== /*********************************************************************************************\
* [sonoff-minimal.bin]
* Provide the smallest image possible while still enabling a webserver for intermediate image load
\*********************************************************************************************/
#ifdef BE_MINIMAL
#ifdef USE_MQTT_TLS #ifdef USE_MQTT_TLS
#undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set
#endif #endif
@ -169,7 +243,11 @@ void KNX_CB_Action(message_t const &msg, void *arg);
#ifdef DEBUG_THEO #ifdef DEBUG_THEO
#undef DEBUG_THEO // Disable debug code #undef DEBUG_THEO // Disable debug code
#endif #endif
#endif // BE_MINIMAL ========================== #endif // BE_MINIMAL
/*********************************************************************************************\
* Mandatory defines satisfying possible disabled defines
\*********************************************************************************************/
#ifndef SWITCH_MODE #ifndef SWITCH_MODE
#define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state) #define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state)

View File

@ -608,7 +608,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
{ "Sonoff T1 1CH", // Sonoff T1 1CH (ESP8285) { "Sonoff T1 1CH", // Sonoff T1 1CH (ESP8285)
GPIO_KEY1, // GPIO00 Button 1 GPIO_KEY1, // GPIO00 Button 1
GPIO_USER, // GPIO01 Serial RXD and Optional sensor GPIO_USER, // GPIO01 Serial RXD and Optional sensor
0, GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
GPIO_USER, // GPIO03 Serial TXD and Optional sensor GPIO_USER, // GPIO03 Serial TXD and Optional sensor
0, 0, 0, 0,
0, 0, 0, // Flash connection 0, 0, 0, // Flash connection
@ -621,7 +621,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
{ "Sonoff T1 2CH", // Sonoff T1 2CH (ESP8285) { "Sonoff T1 2CH", // Sonoff T1 2CH (ESP8285)
GPIO_KEY1, // GPIO00 Button 1 GPIO_KEY1, // GPIO00 Button 1
GPIO_USER, // GPIO01 Serial RXD and Optional sensor GPIO_USER, // GPIO01 Serial RXD and Optional sensor
0, GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
GPIO_USER, // GPIO03 Serial TXD and Optional sensor GPIO_USER, // GPIO03 Serial TXD and Optional sensor
0, 0,
GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On) GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On)
@ -636,7 +636,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
{ "Sonoff T1 3CH", // Sonoff T1 3CH (ESP8285) { "Sonoff T1 3CH", // Sonoff T1 3CH (ESP8285)
GPIO_KEY1, // GPIO00 Button 1 GPIO_KEY1, // GPIO00 Button 1
GPIO_USER, // GPIO01 Serial RXD and Optional sensor GPIO_USER, // GPIO01 Serial RXD and Optional sensor
0, GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
GPIO_USER, // GPIO03 Serial TXD and Optional sensor GPIO_USER, // GPIO03 Serial TXD and Optional sensor
GPIO_REL3, // GPIO04 Blue Led and Relay 3 (0 = Off, 1 = On) GPIO_REL3, // GPIO04 Blue Led and Relay 3 (0 = Off, 1 = On)
GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On) GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On)

View File

@ -228,6 +228,7 @@
#define USE_TIMERS // Add support for up to 16 timers (+2k2 code) #define USE_TIMERS // Add support for up to 16 timers (+2k2 code)
#define USE_TIMERS_WEB // Add timer webpage support (+4k5 code) #define USE_TIMERS_WEB // Add timer webpage support (+4k5 code)
#define USE_SUNRISE // Add support for Sunrise and sunset tools (+16k) #define USE_SUNRISE // Add support for Sunrise and sunset tools (+16k)
#define SUNRISE_DAWN_ANGLE DAWN_NORMAL // Select desired Dawn Angle from (DAWN_NORMAL, DAWN_CIVIL, DAWN_NAUTIC, DAWN_ASTRONOMIC)
// -- Rules --------------------------------------- // -- Rules ---------------------------------------
#define USE_RULES // Add support for rules (+4k4 code) #define USE_RULES // Add support for rules (+4k4 code)
@ -288,11 +289,23 @@
#define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) #define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code)
/*********************************************************************************************\
* Select features and sensors enabled in previous version saving space
\*********************************************************************************************/
//#define USE_CLASSIC // Create sonoff-classic (See sonoff_post.h for selected features)
/*********************************************************************************************\ /*********************************************************************************************\
* Select all sensors - overrides above undefines!! * Select all sensors - overrides above undefines!!
\*********************************************************************************************/ \*********************************************************************************************/
//#define USE_ALL_SENSORS // Create sonoff-xxl with all sensors enabled (See sonoff_post.h for selected sensors) //#define USE_ALL_SENSORS // Create sonoff-allsensors with all sensors enabled (See sonoff_post.h for selected sensors)
/*********************************************************************************************\
* Select KNX without Emulation to save space
\*********************************************************************************************/
//#define USE_KNX_NO_EMULATION // Create sonoff-knx with KNX but without Emulation (See sonoff_post.h)
/*********************************************************************************************\ /*********************************************************************************************\
* Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1! * Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1!

View File

@ -89,7 +89,11 @@ const char HTTP_HEAD_STYLE[] PROGMEM =
"body{text-align:center;font-family:verdana;}" "body{text-align:center;font-family:verdana;}"
"td{padding:0px;}" "td{padding:0px;}"
"button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;cursor:pointer;}" "button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;cursor:pointer;}"
"button:hover{background-color:#006cba;}" "button:hover{background-color:#0e70a4;}"
".bred{background-color:#d43535;}"
".bred:hover{background-color:#931f1f;}"
".bgrn{background-color:#47c266;}"
".bgrn:hover{background-color:#5aaf6f;}"
"a{text-decoration:none;}" "a{text-decoration:none;}"
".p{float:left;text-align:left;}" ".p{float:left;text-align:left;}"
".q{float:right;text-align:right;}" ".q{float:right;text-align:right;}"
@ -180,7 +184,7 @@ const char HTTP_BTN_MENU1[] PROGMEM =
"<br/><form action='up' method='get'><button>" D_FIRMWARE_UPGRADE "</button></form>" "<br/><form action='up' method='get'><button>" D_FIRMWARE_UPGRADE "</button></form>"
"<br/><form action='cs' method='get'><button>" D_CONSOLE "</button></form>"; "<br/><form action='cs' method='get'><button>" D_CONSOLE "</button></form>";
const char HTTP_BTN_RSTRT[] PROGMEM = const char HTTP_BTN_RSTRT[] PROGMEM =
"<br/><form action='rb' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESTART "\");'><button>" D_RESTART "</button></form>"; "<br/><form action='rb' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESTART "\");'><button class='button bred'>" D_RESTART "</button></form>";
const char HTTP_BTN_MENU_MODULE[] PROGMEM = const char HTTP_BTN_MENU_MODULE[] PROGMEM =
"<br/><form action='md' method='get'><button>" D_CONFIGURE_MODULE "</button></form>"; "<br/><form action='md' method='get'><button>" D_CONFIGURE_MODULE "</button></form>";
#if defined(USE_TIMERS) && defined(USE_TIMERS_WEB) #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
@ -202,7 +206,7 @@ const char HTTP_BTN_MENU4[] PROGMEM =
"<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>" "<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>"
"<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>" "<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>"
"<br/>" "<br/>"
"<br/><form action='rt' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESET_CONFIGURATION "\");'><button>" D_RESET_CONFIGURATION "</button></form>" "<br/><form action='rt' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESET_CONFIGURATION "\");'><button class='button bred'>" D_RESET_CONFIGURATION "</button></form>"
"<br/><form action='dl' method='get'><button>" D_BACKUP_CONFIGURATION "</button></form>" "<br/><form action='dl' method='get'><button>" D_BACKUP_CONFIGURATION "</button></form>"
"<br/><form action='rs' method='get'><button>" D_RESTORE_CONFIGURATION "</button></form>"; "<br/><form action='rs' method='get'><button>" D_RESTORE_CONFIGURATION "</button></form>";
const char HTTP_BTN_MAIN[] PROGMEM = const char HTTP_BTN_MAIN[] PROGMEM =
@ -270,7 +274,7 @@ const char HTTP_FORM_OTHER3b[] PROGMEM =
"<br/><input style='width:10%;' id='r{1' name='b2' type='radio' value='{1'{2><b>{3</b>{4"; // Different id only used for labels "<br/><input style='width:10%;' id='r{1' name='b2' type='radio' value='{1'{2><b>{3</b>{4"; // Different id only used for labels
#endif // USE_EMULATION #endif // USE_EMULATION
const char HTTP_FORM_END[] PROGMEM = const char HTTP_FORM_END[] PROGMEM =
"<br/><button type='submit'>" D_SAVE "</button></form></fieldset>"; "<br/><button type='submit' class='button bgrn'>" D_SAVE "</button></form></fieldset>";
const char HTTP_FORM_RST[] PROGMEM = const char HTTP_FORM_RST[] PROGMEM =
"<div id='f1' name='f1' style='display:block;'>" "<div id='f1' name='f1' style='display:block;'>"
"<fieldset><legend><b>&nbsp;" D_RESTORE_CONFIGURATION "&nbsp;</b></legend>"; "<fieldset><legend><b>&nbsp;" D_RESTORE_CONFIGURATION "&nbsp;</b></legend>";

View File

@ -124,7 +124,8 @@ void DuskTillDawn(uint8_t *hour_up,uint8_t *minute_up, uint8_t *hour_down, uint8
h (D) = -12.0 nautische Dämmerung h (D) = -12.0 nautische Dämmerung
h (D) = -18.0 astronomische Dämmerung h (D) = -18.0 astronomische Dämmerung
*/ */
double h = -50/60.0*RAD; // double h = -50/60.0*RAD;
double h = SUNRISE_DAWN_ANGLE *RAD;
double B = (((double)Settings.latitude)/1000000) * RAD; // geographische Breite double B = (((double)Settings.latitude)/1000000) * RAD; // geographische Breite
double GeographischeLaenge = ((double)Settings.longitude)/1000000; double GeographischeLaenge = ((double)Settings.longitude)/1000000;
// double Zeitzone = 0; //Weltzeit // double Zeitzone = 0; //Weltzeit

View File

@ -592,7 +592,8 @@ const char HTTP_FORM_KNX_ADD_BTN[] PROGMEM =
const char HTTP_FORM_KNX_ADD_TABLE_ROW[] PROGMEM = const char HTTP_FORM_KNX_ADD_TABLE_ROW[] PROGMEM =
"<tr><td><b>{optex} -> GAfnum / GAarea / GAfdef </b></td>" "<tr><td><b>{optex} -> GAfnum / GAarea / GAfdef </b></td>"
"<td><button type='submit' name='btn_del_ga' value='{opval}' style='background-color: #f44336;'> " D_DELETE " </button></td></tr>"; // "<td><button type='submit' name='btn_del_ga' value='{opval}' style='background-color: #eb1e1e;'> " D_DELETE " </button></td></tr>";
"<td><button type='submit' name='btn_del_ga' value='{opval}' class='button bred'> " D_DELETE " </button></td></tr>";
const char HTTP_FORM_KNX3[] PROGMEM = const char HTTP_FORM_KNX3[] PROGMEM =
"</table></center></fieldset><br/>" "</table></center></fieldset><br/>"
@ -604,7 +605,8 @@ const char HTTP_FORM_KNX4[] PROGMEM =
const char HTTP_FORM_KNX_ADD_TABLE_ROW2[] PROGMEM = const char HTTP_FORM_KNX_ADD_TABLE_ROW2[] PROGMEM =
"<tr><td><b>GAfnum / GAarea / GAfdef -> {optex}</b></td>" "<tr><td><b>GAfnum / GAarea / GAfdef -> {optex}</b></td>"
"<td><button type='submit' name='btn_del_cb' value='{opval}' style='background-color: #f44336;'> " D_DELETE " </button></td></tr>"; // "<td><button type='submit' name='btn_del_cb' value='{opval}' style='background-color: #eb1e1e;'> " D_DELETE " </button></td></tr>";
"<td><button type='submit' name='btn_del_cb' value='{opval}' class='button bred'> " D_DELETE " </button></td></tr>";
void HandleKNXConfiguration() void HandleKNXConfiguration()