5.7.1a
 * Fix Domoticz loop when Emulation is selected
 * Add GPIO14 to
Sonoff Dual (#797, #839)
 * Add support for Witty Cloud (#794)
 * Add
support for Yunshan Wifi Relay (#802)
 * Add GPIO16 input pulldown
(#827)
This commit is contained in:
arendst 2017-09-10 15:51:44 +02:00
parent 8585465967
commit 0151188652
6 changed files with 50 additions and 10 deletions

View File

@ -1,7 +1,7 @@
## Sonoff-Tasmota ## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE. Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
Current version is **5.7.1** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. Current version is **5.7.1a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### ATTENTION All versions ### ATTENTION All versions

View File

@ -1,4 +1,11 @@
/* 5.7.1 20170909 /* 5.7.1a
* Fix Domoticz loop when Emulation is selected
* Add GPIO14 to Sonoff Dual (#797, #839)
* Add support for Witty Cloud (#794)
* Add support for Yunshan Wifi Relay (#802)
* Add GPIO16 input pulldown (#827)
*
* 5.7.1 20170909
* Remove leading spaces from MQTT data * Remove leading spaces from MQTT data
* Fix webconsole special character entry * Fix webconsole special character entry
* Allow # as prefix for color value * Allow # as prefix for color value

View File

@ -25,7 +25,7 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)" - Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/ ====================================================*/
#define VERSION 0x05070100 // 5.7.1 #define VERSION 0x05070101 // 5.7.1a
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL}; enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
enum week_t {Last, First, Second, Third, Fourth}; enum week_t {Last, First, Second, Third, Fourth};
@ -2677,13 +2677,13 @@ void GPIO_init()
Maxdevice++; Maxdevice++;
} }
// if (pin[GPIO_KEY1 +i] < 99) { // if (pin[GPIO_KEY1 +i] < 99) {
// pinMode(pin[GPIO_KEY1 +i], INPUT_PULLUP); // pinMode(pin[GPIO_KEY1 +i], (16 == pin[GPIO_KEY1 +i]) ? INPUT_PULLDOWN_16 : INPUT_PULLUP);
// } // }
} }
} }
for (byte i = 0; i < 4; i++) { for (byte i = 0; i < 4; i++) {
if (pin[GPIO_KEY1 +i] < 99) { if (pin[GPIO_KEY1 +i] < 99) {
pinMode(pin[GPIO_KEY1 +i], INPUT_PULLUP); pinMode(pin[GPIO_KEY1 +i], (16 == pin[GPIO_KEY1 +i]) ? INPUT_PULLDOWN_16 : INPUT_PULLUP);
} }
if (pin[GPIO_LED1 +i] < 99) { if (pin[GPIO_LED1 +i] < 99) {
pinMode(pin[GPIO_LED1 +i], OUTPUT); pinMode(pin[GPIO_LED1 +i], OUTPUT);
@ -2691,7 +2691,7 @@ void GPIO_init()
} }
if (pin[GPIO_SWT1 +i] < 99) { if (pin[GPIO_SWT1 +i] < 99) {
swt_flg = 1; swt_flg = 1;
pinMode(pin[GPIO_SWT1 +i], INPUT_PULLUP); pinMode(pin[GPIO_SWT1 +i], (16 == pin[GPIO_SWT1 +i]) ? INPUT_PULLDOWN_16 :INPUT_PULLUP);
lastwallswitch[i] = digitalRead(pin[GPIO_SWT1 +i]); // set global now so doesn't change the saved power state on first switch check lastwallswitch[i] = digitalRead(pin[GPIO_SWT1 +i]); // set global now so doesn't change the saved power state on first switch check
} }
} }

View File

@ -157,6 +157,8 @@ enum module_t {
SONOFF_T12, SONOFF_T12,
SONOFF_T13, SONOFF_T13,
SUPLA1, SUPLA1,
WITTY,
YUNSHAN,
MAXMODULE }; MAXMODULE };
/********************************************************************************************/ /********************************************************************************************/
@ -199,11 +201,13 @@ const uint8_t nicelist[MAXMODULE] PROGMEM = {
ELECTRODRAGON, ELECTRODRAGON,
EXS_RELAY, EXS_RELAY,
SUPLA1, SUPLA1,
YUNSHAN,
WION, WION,
H801, H801,
HUAFAN_SS, HUAFAN_SS,
AILIGHT, AILIGHT,
WEMOS WEMOS,
WITTY
}; };
// Default module settings // Default module settings
@ -278,7 +282,8 @@ const mytmplt modules[MAXMODULE] PROGMEM = {
0, 0, 0, 0, 0, 0, // Flash connection 0, 0, 0, 0, 0, 0, // Flash connection
0, 0,
GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off) GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
0, 0, 0, 0 GPIO_USER, // GPIO14 Optional sensor
0, 0, 0
}, },
{ "Sonoff Pow", // Sonoff Pow (ESP8266) { "Sonoff Pow", // Sonoff Pow (ESP8266)
GPIO_KEY1, // GPIO00 Button GPIO_KEY1, // GPIO00 Button
@ -619,6 +624,32 @@ const mytmplt modules[MAXMODULE] PROGMEM = {
0, 0,
GPIO_LED1, // GPIO16 Led (1 = On, 0 = Off) GPIO_LED1, // GPIO16 Led (1 = On, 0 = Off)
GPIO_ADC0 // ADC0 A0 Analog input GPIO_ADC0 // ADC0 A0 Analog input
},
{ "Witty Cloud", // Witty Cloud Dev Board (ESP8266) - https://www.aliexpress.com/item/ESP8266-serial-WIFI-Witty-cloud-Development-Board-ESP-12F-module-MINI-nodemcu/32643464555.html
GPIO_USER, // GPIO00 D3 flash push button on interface board
GPIO_USER, // GPIO01 Serial RXD and Optional sensor
GPIO_LED1_INV, // GPIO02 D4 Blue Led (0 = On, 1 = Off) on ESP-12F
GPIO_USER, // GPIO03 Serial TXD and Optional sensor
GPIO_KEY1, // GPIO04 D2 push button on ESP-12F board
GPIO_USER, // GPIO05 D1 optional sensor
0, 0, 0, 0, 0, 0, // Flash connection
GPIO_PWM4, // GPIO12 D6 RGB LED Green
GPIO_PWM5, // GPIO13 D7 RGB LED Blue
GPIO_USER, // GPIO14 D5 optional sensor
GPIO_PWM3, // GPIO15 D8 RGB LED Red
GPIO_USER, // GPIO16 D0 optional sensor
GPIO_ADC0 // ADC0 A0 Light sensor / Requires USE_ADC_VCC in user_config.h to be disabled
},
{ "Yunshan Relay", // Yunshan Wifi Relay (ESP8266) - https://www.ebay.com/p/Esp8266-220v-10a-Network-Relay-WiFi-Module/1369583381
// Schematics and Info https://ucexperiment.wordpress.com/2016/12/18/yunshan-esp8266-250v-15a-acdc-network-wifi-relay-module/
0, // GPIO00 Flash jumper - Module Pin 8
GPIO_USER, // GPIO01 Serial RXD and Optional sensor - Module Pin 2
GPIO_LED1_INV, // GPIO02 Blue Led (0 = On, 1 = Off) on ESP-12F - Module Pin 7
GPIO_USER, // GPIO03 Serial TXD and Optional sensor - Module Pin 3
GPIO_REL1, // GPIO04 Red Led and Relay (0 = Off, 1 = On) - Module Pin 10
GPIO_KEY1, // GPIO05 Blue Led and OptoCoupler input - Module Pin 9
0, 0, 0, 0, 0, 0, // Flash connection
0, 0, 0, 0, 0
} }
}; };

View File

@ -269,7 +269,8 @@ void sl_prepPower(char *svalue, uint16_t ssvalue)
do_cmnd_power(1, 6); // No publishPowerState do_cmnd_power(1, 6); // No publishPowerState
} }
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
mqtt_publishDomoticzPowerState(1); // mqtt_publishDomoticzPowerState(1);
domoticz_updatePowerState(1);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
if (sfl_flg > 1) { if (sfl_flg > 1) {
snprintf_P(svalue, ssvalue, PSTR("{\"" D_RSLT_POWER "\":\"%s\", \"" D_CMND_DIMMER "\":%d, \"" D_CMND_COLOR "\":\"%s\"}"), snprintf_P(svalue, ssvalue, PSTR("{\"" D_RSLT_POWER "\":\"%s\", \"" D_CMND_DIMMER "\":%d, \"" D_CMND_COLOR "\":\"%s\"}"),

View File

@ -546,7 +546,8 @@ boolean ws2812_command(char *type, uint16_t index, char *dataBuf, uint16_t data_
bitSet(power, ws_bit); bitSet(power, ws_bit);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
// mqtt_publishDomoticzPowerState(index); // mqtt_publishDomoticzPowerState(index);
mqtt_publishDomoticzPowerState(ws_bit +1); // mqtt_publishDomoticzPowerState(ws_bit +1);
domoticz_updatePowerState(ws_bit +1);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
} }
snprintf_P(svalue, ssvalue, PSTR("{\"" D_CMND_DIMMER "\":%d}"), sysCfg.ws_dimmer); snprintf_P(svalue, ssvalue, PSTR("{\"" D_CMND_DIMMER "\":%d}"), sysCfg.ws_dimmer);