diff --git a/lib/TasmotaSerial-2.4.0/README.md b/lib/TasmotaSerial-2.4.1/README.md similarity index 100% rename from lib/TasmotaSerial-2.4.0/README.md rename to lib/TasmotaSerial-2.4.1/README.md diff --git a/lib/TasmotaSerial-2.4.0/examples/swsertest/swsertest.ino b/lib/TasmotaSerial-2.4.1/examples/swsertest/swsertest.ino similarity index 100% rename from lib/TasmotaSerial-2.4.0/examples/swsertest/swsertest.ino rename to lib/TasmotaSerial-2.4.1/examples/swsertest/swsertest.ino diff --git a/lib/TasmotaSerial-2.4.0/keywords.txt b/lib/TasmotaSerial-2.4.1/keywords.txt similarity index 100% rename from lib/TasmotaSerial-2.4.0/keywords.txt rename to lib/TasmotaSerial-2.4.1/keywords.txt diff --git a/lib/TasmotaSerial-2.4.0/library.json b/lib/TasmotaSerial-2.4.1/library.json similarity index 94% rename from lib/TasmotaSerial-2.4.0/library.json rename to lib/TasmotaSerial-2.4.1/library.json index cdce0deba..554d9ea9e 100644 --- a/lib/TasmotaSerial-2.4.0/library.json +++ b/lib/TasmotaSerial-2.4.1/library.json @@ -1,6 +1,6 @@ { "name": "TasmotaSerial", - "version": "2.4.0", + "version": "2.4.1", "keywords": [ "serial", "io", "TasmotaSerial" ], diff --git a/lib/TasmotaSerial-2.4.0/library.properties b/lib/TasmotaSerial-2.4.1/library.properties similarity index 94% rename from lib/TasmotaSerial-2.4.0/library.properties rename to lib/TasmotaSerial-2.4.1/library.properties index f1486dfab..b326d7404 100644 --- a/lib/TasmotaSerial-2.4.0/library.properties +++ b/lib/TasmotaSerial-2.4.1/library.properties @@ -1,5 +1,5 @@ name=TasmotaSerial -version=2.4.0 +version=2.4.1 author=Theo Arends maintainer=Theo Arends sentence=Implementation of software serial with hardware serial fallback for ESP8266. diff --git a/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp b/lib/TasmotaSerial-2.4.1/src/TasmotaSerial.cpp similarity index 87% rename from lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp rename to lib/TasmotaSerial-2.4.1/src/TasmotaSerial.cpp index 5ffcaf390..ebce5a496 100644 --- a/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp +++ b/lib/TasmotaSerial-2.4.1/src/TasmotaSerial.cpp @@ -213,39 +213,68 @@ int TasmotaSerial::available() #ifdef TM_SERIAL_USE_IRAM #define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts +#define TM_SERIAL_WAIT_SND_FAST { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } #define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } #define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < (wait + start)); } #else #define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } +#define TM_SERIAL_WAIT_SND_FAST { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } #define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } #define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < (wait + start)); } #endif +#ifdef TM_SERIAL_USE_IRAM +void ICACHE_RAM_ATTR TasmotaSerial::_fast_write(uint8_t b) { +#else +void TasmotaSerial::_fast_write(uint8_t b) { +#endif + uint32_t wait = m_bit_time; + uint32_t start = ESP.getCycleCount(); + // Start bit; + digitalWrite(m_tx_pin, LOW); + TM_SERIAL_WAIT_SND_FAST; + for (uint32_t i = 0; i < 8; i++) { + digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW); + TM_SERIAL_WAIT_SND_FAST; + b >>= 1; + } + // Stop bit(s) + digitalWrite(m_tx_pin, HIGH); + for (uint32_t i = 0; i < m_stop_bits; i++) { + TM_SERIAL_WAIT_SND_FAST; + } +} + size_t TasmotaSerial::write(uint8_t b) { if (m_hardserial) { return Serial.write(b); } else { if (-1 == m_tx_pin) return 0; - if (m_high_speed) cli(); // Disable interrupts in order to get a clean transmit - uint32_t wait = m_bit_time; - //digitalWrite(m_tx_pin, HIGH); // already in HIGH mode - uint32_t start = ESP.getCycleCount(); - // Start bit; - digitalWrite(m_tx_pin, LOW); - TM_SERIAL_WAIT_SND; - for (uint32_t i = 0; i < 8; i++) { - digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW); - TM_SERIAL_WAIT_SND; - b >>= 1; - } - // Stop bit(s) - digitalWrite(m_tx_pin, HIGH); - // re-enable interrupts during stop bits, it's not an issue if they are longer than expected - if (m_high_speed) sei(); - for (uint32_t i = 0; i < m_stop_bits; i++) { + if (m_high_speed) { + cli(); // Disable interrupts in order to get a clean transmit + _fast_write(b); + sei(); + } else { + uint32_t wait = m_bit_time; + //digitalWrite(m_tx_pin, HIGH); // already in HIGH mode + uint32_t start = ESP.getCycleCount(); + // Start bit; + digitalWrite(m_tx_pin, LOW); TM_SERIAL_WAIT_SND; + for (uint32_t i = 0; i < 8; i++) { + digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW); + TM_SERIAL_WAIT_SND; + b >>= 1; + } + // Stop bit(s) + digitalWrite(m_tx_pin, HIGH); + // re-enable interrupts during stop bits, it's not an issue if they are longer than expected + for (uint32_t i = 0; i < m_stop_bits; i++) { + TM_SERIAL_WAIT_SND; + } } + return 1; } } diff --git a/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.h b/lib/TasmotaSerial-2.4.1/src/TasmotaSerial.h similarity index 97% rename from lib/TasmotaSerial-2.4.0/src/TasmotaSerial.h rename to lib/TasmotaSerial-2.4.1/src/TasmotaSerial.h index 41f3cd0d7..81545f522 100644 --- a/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.h +++ b/lib/TasmotaSerial-2.4.1/src/TasmotaSerial.h @@ -81,6 +81,8 @@ class TasmotaSerial : public Stream { bool m_high_speed = false; bool m_very_high_speed = false; // above 100000 bauds uint8_t *m_buffer; + + void _fast_write(uint8_t b); // IRAM minimized version }; #endif // TasmotaSerial_h diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 5b26d35d3..72294645c 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,10 +1,24 @@ /*********************************************************************************************\ + * 6.6.0.15 20191003 + * Change command PulseTime JSON message format and allow display of all pulsetimer information (#6519) + * Add support for Chint DDSU666 Modbus energy meter by Pablo Zerón + * Add support for SM2135 as used in Action LSC Smart Led E14 (#6495) + * Add command SetOption72 0/1 to switch between software (0) or hardware (1) energy total counter (#6561) + * Add Zigbee tracking of connected devices and auto-probing of Manuf/Model Ids + * * 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) + * Add command to MCP230xx: sensor29 pin,0/1/2 for OFF/ON/TOGGLE + * Add initial support for PCF8574 I2C I/O Expander (currently output only) by Stefan Bode + * Add command SetOption71 0/1 to switch between different Modbus Active Energy registers on DDS238-2 energy meters (#6531) + * Change command SetOption43 to make it more general. Now supports PS_16_DZ driver too (#6544) + * Change command handling by moving buffers up in chain solving MQTTlog support (#6529) + * Change detection of non-MQTT commands by allowing non-space characters as delimiter (#6540) + * Fix TasmotaSerial: move serial send to IRAM for high speed baud rates * * 6.6.0.13 20190922 * Add command EnergyReset4 x,x to initialize total usage for two tarrifs diff --git a/sonoff/i18n.h b/sonoff/i18n.h index 5dae197a6..0d7cdf0a9 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -118,6 +118,7 @@ #define D_JSON_PROGRAMFLASHSIZE "ProgramFlashSize" #define D_JSON_PROGRAMSIZE "ProgramSize" #define D_JSON_REFERENCETEMPERATURE "ReferenceTemperature" +#define D_JSON_REMAINING "Remaining" #define D_JSON_RESET "Reset" #define D_JSON_RESISTANCE "Resistance" #define D_JSON_RESOLUTION "Resolution" @@ -132,6 +133,7 @@ #define D_JSON_SDKVERSION "SDK" #define D_JSON_SELECTED "selected" #define D_JSON_SERIALRECEIVED "SerialReceived" +#define D_JSON_SET "Set" #define D_JSON_SSID "SSId" #define D_JSON_STARTDST "StartDST" // Start Daylight Savings Time #define D_JSON_STARTED "Started" @@ -456,12 +458,13 @@ // Commands xdrv_23_zigbee.ino #define D_CMND_ZIGBEE_PERMITJOIN "ZigbeePermitJoin" -#define D_CMND_ZIGBEE_DUMP "ZigbeeDump" +#define D_CMND_ZIGBEE_STATUS "ZigbeeStatus" #define D_CMND_ZIGBEEZNPSEND "ZigbeeZNPSend" #define D_JSON_ZIGBEE_STATUS "ZigbeeStatus" #define D_JSON_ZIGBEEZNPRECEIVED "ZigbeeZNPReceived" #define D_JSON_ZIGBEEZNPSENT "ZigbeeZNPSent" - #define D_JSON_ZIGBEEZCLRECEIVED "ZigbeeZCLReceived" + #define D_JSON_ZIGBEEZCL_RECEIVED "ZigbeeZCLReceived" + #define D_JSON_ZIGBEEZCL_RAW_RECEIVED "ZigbeeZCLRawReceived" #define D_JSON_ZIGBEEZCLSENT "ZigbeeZCLSent" // Commands xdrv_25_A4988_Stepper.ino @@ -557,7 +560,6 @@ const char S_JSON_COMMAND_INDEX_LVALUE[] PROGMEM = "{\"%s%d\":%lu}"; const char S_JSON_COMMAND_INDEX_SVALUE[] PROGMEM = "{\"%s%d\":\"%s\"}"; const char S_JSON_COMMAND_INDEX_ASTERISK[] PROGMEM = "{\"%s%d\":\"" D_ASTERISK_PWD "\"}"; const char S_JSON_COMMAND_INDEX_SVALUE_SVALUE[] PROGMEM = "{\"%s%d\":\"%s%s\"}"; -const char S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s%d\":{\"%d\":{\"" D_JSON_ACTIVE "\":\"%d\"}}}"; const char S_JSON_SENSOR_INDEX_NVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":%d}"; const char S_JSON_SENSOR_INDEX_SVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":\"%s\"}"; diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h index 1cc34be2c..482c6284a 100644 --- a/sonoff/language/bg-BG.h +++ b/sonoff/language/bg-BG.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Параметри на лога" #define D_SERIAL_LOG_LEVEL "Степен на серийния лог" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Степен на уеб лога" #define D_SYS_LOG_LEVEL "Степен на системния лог" #define D_MORE_DEBUG "Още дебъгване" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Датчикът DS18x20 е зает" #define D_SENSOR_CRC_ERROR "Датчик DS18x20 - грешка CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h index c8a5713c8..2df00a647 100644 --- a/sonoff/language/cs-CZ.h +++ b/sonoff/language/cs-CZ.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Volba logování" #define D_SERIAL_LOG_LEVEL "Seriová úroveň logu" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Webová úroveň logu" #define D_SYS_LOG_LEVEL "Systemová úroveň logu" #define D_MORE_DEBUG "Více debug informací" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor DS18x20 obsazen" #define D_SENSOR_CRC_ERROR "Sensor DS18x20 chyba CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h index 295402d6b..5849a1a46 100644 --- a/sonoff/language/de-DE.h +++ b/sonoff/language/de-DE.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v6.6.0.4 + * Updated until v6.6.0.14 \*********************************************************************/ //#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -284,9 +284,10 @@ #define D_LOGGING_PARAMETERS "Logging-Einstellungen" #define D_SERIAL_LOG_LEVEL "Seriell-Log Level" +#define D_MQTT_LOG_LEVEL "Mqtt-Log Level" #define D_WEB_LOG_LEVEL "Web-Log Level" #define D_SYS_LOG_LEVEL "Sys-Log Level" -#define D_MORE_DEBUG "More debug" +#define D_MORE_DEBUG "Mehr Details" #define D_SYSLOG_HOST "Sys-Log Host" #define D_SYSLOG_PORT "Sys-Log Port" #define D_TELEMETRY_PERIOD "Telemetrieperiode" @@ -443,9 +444,17 @@ #define D_ENERGY_TOTAL "Energie insgesamt" // xdrv_27_shutter.ino -#define D_OPEN "Open" -#define D_CLOSE "Close" -#define D_DOMOTICZ_SHUTTER "Shutter" +#define D_OPEN "Öffnen" +#define D_CLOSE "Schliessen" +#define D_DOMOTICZ_SHUTTER "Rollo" + +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Konfiguriere PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 Parameter" +#define D_INVERT_PORTS "Invertiere Ports" +#define D_DEVICE "Gerät" +#define D_DEVICE_INPUT "Eingang" +#define D_DEVICE_OUTPUT "Ausgang" // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor beschäftigt" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/el-GR.h b/sonoff/language/el-GR.h index 222c06ef6..7ccf5ae40 100644 --- a/sonoff/language/el-GR.h +++ b/sonoff/language/el-GR.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Παράμετροι καταγραφής" #define D_SERIAL_LOG_LEVEL "Επίπεδο Σειριακής" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Επίπεδο Web" #define D_SYS_LOG_LEVEL "Επίπεδο Syslog" #define D_MORE_DEBUG "More debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Ο αισθητήρας είναι απασχολημένος" #define D_SENSOR_CRC_ERROR "Σφάλμα CRC αισθητήρα" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h index 546d99af1..28008be9e 100644 --- a/sonoff/language/en-GB.h +++ b/sonoff/language/en-GB.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Logging parameters" #define D_SERIAL_LOG_LEVEL "Serial log level" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web log level" #define D_SYS_LOG_LEVEL "Syslog level" #define D_MORE_DEBUG "More debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor busy" #define D_SENSOR_CRC_ERROR "Sensor CRC error" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/es-ES.h b/sonoff/language/es-ES.h index b62e54661..d8cf7cca1 100644 --- a/sonoff/language/es-ES.h +++ b/sonoff/language/es-ES.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v6.6.0.4 + * Updated until v6.6.0.14 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Parámetros Logging" #define D_SERIAL_LOG_LEVEL "Nivel de log Serial" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Nivel de log Web" #define D_SYS_LOG_LEVEL "Nivel de Syslog" #define D_MORE_DEBUG "Más Debug" @@ -443,9 +444,17 @@ #define D_ENERGY_TOTAL "Energía Total" // xdrv_27_shutter.ino -#define D_OPEN "Open" -#define D_CLOSE "Close" -#define D_DOMOTICZ_SHUTTER "Shutter" +#define D_OPEN "Abrir" +#define D_CLOSE "Cerrar" +#define D_DOMOTICZ_SHUTTER "Cortina" + +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configurar PCF8574" +#define D_PCF8574_PARAMETERS "Parámetros de PCF8574" +#define D_INVERT_PORTS "Invertir Puertos" +#define D_DEVICE "Dispositivo" +#define D_DEVICE_INPUT "Entrada" +#define D_DEVICE_OUTPUT "Salida" // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor ocupado" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h index 6091da84f..19070f8e3 100644 --- a/sonoff/language/fr-FR.h +++ b/sonoff/language/fr-FR.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Paramètres du journal" #define D_SERIAL_LOG_LEVEL "Niveau de journalisation série" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Niveau de journalisation web" #define D_SYS_LOG_LEVEL "Niveau SysLog" #define D_MORE_DEBUG "Plus de debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Capteur occupé" #define D_SENSOR_CRC_ERROR "Erreur CRC capteur" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/he-HE.h b/sonoff/language/he-HE.h index ee16e5073..96fbc8863 100644 --- a/sonoff/language/he-HE.h +++ b/sonoff/language/he-HE.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "פרמטרי לוגים" #define D_SERIAL_LOG_LEVEL "רמת לוג עבור סריאל" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "רמת לוג עבור אתר" #define D_SYS_LOG_LEVEL "Syslog רמת לוג עבור שרת" #define D_MORE_DEBUG "מיפוי נוסף" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "שרת עסוק" #define D_SENSOR_CRC_ERROR "בחיישן CRC שגיאת" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h index 90a52b03a..ae19f1d75 100644 --- a/sonoff/language/hu-HU.h +++ b/sonoff/language/hu-HU.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Naplózási paraméterek" #define D_SERIAL_LOG_LEVEL "Soros naplózási szint" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web naplózási szint" #define D_SYS_LOG_LEVEL "Syslog szint" #define D_MORE_DEBUG "Részletes hibakeresés" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Szenzor foglalt" #define D_SENSOR_CRC_ERROR "Szenzor CRC hiba" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h index 2a990dc8e..51aa07540 100644 --- a/sonoff/language/it-IT.h +++ b/sonoff/language/it-IT.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Parametri Logging" #define D_SERIAL_LOG_LEVEL "Livello di log Seriale" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "livello di log Web" #define D_SYS_LOG_LEVEL "livello di log Sys" #define D_MORE_DEBUG "Debug aggiuntivo" @@ -443,9 +444,17 @@ #define D_ENERGY_TOTAL "Energia Totale" // xdrv_27_shutter.ino -#define D_OPEN "Open" -#define D_CLOSE "Close" -#define D_DOMOTICZ_SHUTTER "Shutter" +#define D_OPEN "Aperta" +#define D_CLOSE "Chiusa" +#define D_DOMOTICZ_SHUTTER "Serranda" + +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configura PCF8574" +#define D_PCF8574_PARAMETERS "Parametri PCF8574" +#define D_INVERT_PORTS "Porte Invertite" +#define D_DEVICE "Dispositivo" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensore occupato" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/ko-KO.h b/sonoff/language/ko-KO.h index 7ffc5271d..2c11f02db 100644 --- a/sonoff/language/ko-KO.h +++ b/sonoff/language/ko-KO.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "로그 상세" #define D_SERIAL_LOG_LEVEL "시리얼 로그 레벨" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web 로그 레벨" #define D_SYS_LOG_LEVEL "Syslog 로그 레벨" #define D_MORE_DEBUG "More debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "센서가 사용 중" #define D_SENSOR_CRC_ERROR "센서 CRC 에러" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h index 822bf1542..19f7872b8 100644 --- a/sonoff/language/nl-NL.h +++ b/sonoff/language/nl-NL.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Logging parameters" #define D_SERIAL_LOG_LEVEL "Serieel log niveau" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web log niveau" #define D_SYS_LOG_LEVEL "Syslog niveau" #define D_MORE_DEBUG "Meer debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor bezet" #define D_SENSOR_CRC_ERROR "Sensor CRC fout" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h index 8729be3c7..9fceb490d 100644 --- a/sonoff/language/pl-PL.h +++ b/sonoff/language/pl-PL.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Opcje dziennika" #define D_SERIAL_LOG_LEVEL "Serial poziom dziennika" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web poziom dziennika" #define D_SYS_LOG_LEVEL "System poziom dziennika" #define D_MORE_DEBUG "Więcej informacji debug" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Czujnik DS18x20 zajęty" #define D_SENSOR_CRC_ERROR "Czujnik DS18x20 błąd CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/pt-BR.h b/sonoff/language/pt-BR.h index f1ec6326f..ccea3e78d 100644 --- a/sonoff/language/pt-BR.h +++ b/sonoff/language/pt-BR.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Parâmetros Logging" #define D_SERIAL_LOG_LEVEL "Nível de registro serial" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Nível de registro WEB" #define D_SYS_LOG_LEVEL "Nível de registro Syslog" #define D_MORE_DEBUG "Depurar mais" @@ -443,9 +444,17 @@ #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" +#define D_OPEN "Aberta" +#define D_CLOSE "Fechada" +#define D_DOMOTICZ_SHUTTER "Persiana" + +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configura PCF8574" +#define D_PCF8574_PARAMETERS "Parâmetros PCF8574" +#define D_INVERT_PORTS "Portas Invertidas" +#define D_DEVICE "Dispositivo" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor ocupado" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h index 0fac99308..e89e01710 100644 --- a/sonoff/language/pt-PT.h +++ b/sonoff/language/pt-PT.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Parametros Logging" #define D_SERIAL_LOG_LEVEL "Nível de registro serial" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Nível de registro WEB" #define D_SYS_LOG_LEVEL "Nível de registro Syslog" #define D_MORE_DEBUG "Depurar mais" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor ocupado" #define D_SENSOR_CRC_ERROR "Erro Sensor CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h index 2b0b68cb7..441994c1b 100644 --- a/sonoff/language/ru-RU.h +++ b/sonoff/language/ru-RU.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Параметры Logging" #define D_SERIAL_LOG_LEVEL "Serial лог уровень" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web лог уровень" #define D_SYS_LOG_LEVEL "System лог уровень" #define D_MORE_DEBUG "Дополнительная информация для отладки" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Датчик DS18x20 занят" #define D_SENSOR_CRC_ERROR "Датчик DS18x20 - ошибка CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "А" diff --git a/sonoff/language/sk-SK.h b/sonoff/language/sk-SK.h index 84385ee28..757e48173 100644 --- a/sonoff/language/sk-SK.h +++ b/sonoff/language/sk-SK.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Voľba logovania" #define D_SERIAL_LOG_LEVEL "Sériová úroveň logu" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Webová úroveň logu" #define D_SYS_LOG_LEVEL "Systemová úroveň logu" #define D_MORE_DEBUG "Viac debug informácí" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor DS18x20 obsadený" #define D_SENSOR_CRC_ERROR "Sensor DS18x20 chyba CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/sv-SE.h b/sonoff/language/sv-SE.h index d55b6ddbc..200023970 100644 --- a/sonoff/language/sv-SE.h +++ b/sonoff/language/sv-SE.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Loggningsparametrar" #define D_SERIAL_LOG_LEVEL "Seriell loggnivå" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Webb loggnivå" #define D_SYS_LOG_LEVEL "Syslog-nivå" #define D_MORE_DEBUG "Mer debugging" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensor upptagen" #define D_SENSOR_CRC_ERROR "Sensor CRC-fel" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/tr-TR.h b/sonoff/language/tr-TR.h index f31efe078..c8d006513 100755 --- a/sonoff/language/tr-TR.h +++ b/sonoff/language/tr-TR.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Loglama parametreleri" #define D_SERIAL_LOG_LEVEL "Serial log seviyesi" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web log seviyesi" #define D_SYS_LOG_LEVEL "Syslog seviyesi" #define D_MORE_DEBUG "Hata ayıklama devamı" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Sensör başgül" #define D_SENSOR_CRC_ERROR "Sensor CRC hatası" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "A" diff --git a/sonoff/language/uk-UK.h b/sonoff/language/uk-UK.h index dd21904d8..daaf299fa 100644 --- a/sonoff/language/uk-UK.h +++ b/sonoff/language/uk-UK.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "Параметри журналу" #define D_SERIAL_LOG_LEVEL "Serial рівень" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web рівень" #define D_SYS_LOG_LEVEL "System рівень" #define D_MORE_DEBUG "Додаткова інформація для налагодження" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "Датчик DS18x20 зайнятий" #define D_SENSOR_CRC_ERROR "Датчик DS18x20 - помилка CRC" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "А" diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h index 0d776f40c..1fcb3ef3d 100644 --- a/sonoff/language/zh-CN.h +++ b/sonoff/language/zh-CN.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "日志设置" #define D_SERIAL_LOG_LEVEL "串口日志级别" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web 日志级别" #define D_SYS_LOG_LEVEL "Syslog 日志级别" #define D_MORE_DEBUG "全部调试" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "传感器正忙" #define D_SENSOR_CRC_ERROR "传感器 CRC 校验错误" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "安" diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h index 38d0b26be..6939de541 100644 --- a/sonoff/language/zh-TW.h +++ b/sonoff/language/zh-TW.h @@ -284,6 +284,7 @@ #define D_LOGGING_PARAMETERS "日志設置" #define D_SERIAL_LOG_LEVEL "串口日志級別" +#define D_MQTT_LOG_LEVEL "Mqtt log level" #define D_WEB_LOG_LEVEL "Web 日志級別" #define D_SYS_LOG_LEVEL "Syslog 日志級別" #define D_MORE_DEBUG "全部調試" @@ -447,6 +448,14 @@ #define D_CLOSE "Close" #define D_DOMOTICZ_SHUTTER "Shutter" +// xdrv_28_pcf8574.ino +#define D_CONFIGURE_PCF8574 "Configure PCF8574" +#define D_PCF8574_PARAMETERS "PCF8574 parameters" +#define D_INVERT_PORTS "Invert Ports" +#define D_DEVICE "Device" +#define D_DEVICE_INPUT "Input" +#define D_DEVICE_OUTPUT "Output" + // xsns_05_ds18b20.ino #define D_SENSOR_BUSY "傳感器正忙" #define D_SENSOR_CRC_ERROR "傳感器 CRC 校驗錯誤" @@ -609,6 +618,10 @@ #define D_SENSOR_A4988_MS3 "A4988 MS3" #define D_SENSOR_DDS2382_TX "DDS238-2 Tx" #define D_SENSOR_DDS2382_RX "DDS238-2 Rx" +#define D_SENSOR_DDSU666_TX "DDSU666 Tx" +#define D_SENSOR_DDSU666_RX "DDSU666 Rx" +#define D_SENSOR_SM2135_CLK "SM2135 Clk" +#define D_SENSOR_SM2135_DAT "SM2135 Dat" // Units #define D_UNIT_AMPERE "安" diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index a2a2eda67..ad28116cf 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -66,8 +66,9 @@ #define STA_PASS1 "" // [Password1] Wifi password #define STA_SSID2 "" // [Ssid2] Optional alternate AP Wifi SSID #define STA_PASS2 "" // [Password2] Optional alternate AP Wifi password -#define WIFI_CONFIG_TOOL WIFI_RETRY // [WifiConfig] Default tool if wifi fails to connect - // (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT, WIFI_SERIAL) +#define WIFI_CONFIG_TOOL WIFI_RETRY // [WifiConfig] Default tool if wifi fails to connect (default option: 4 - WIFI_RETRY) + // (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT, WIFI_SERIAL, WIFI_MANAGER_RESET_ONLY) + // The configuration can be changed after first setup using WifiConfig 0, 1, 2, 3, 4, 5, 6 and 7. #define WIFI_CONFIG_NO_SSID WIFI_WPSCONFIG // Default tool if wifi fails to connect and no SSID is configured // (WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_SERIAL) // *** NOTE: When WPS is disabled by USE_WPS below, WIFI_WPSCONFIG will execute WIFI_MANAGER *** @@ -80,6 +81,7 @@ #define SYS_LOG_LEVEL LOG_LEVEL_NONE // [SysLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE) #define SERIAL_LOG_LEVEL LOG_LEVEL_INFO // [SerialLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE) #define WEB_LOG_LEVEL LOG_LEVEL_INFO // [WebLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE) +#define MQTT_LOG_LEVEL LOG_LEVEL_NONE // [MqttLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE) // -- Ota ----------------------------------------- #define OTA_URL "http://thehackbox.org/tasmota/release/sonoff.bin" // [OtaUrl] @@ -315,6 +317,15 @@ //#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) +// -- Optional light modules ---------------------- +#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // +// #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_HARDWARE NEO_HW_WS2812 // Hardware type (NEO_HW_WS2812, NEO_HW_WS2812X, NEO_HW_WS2813, NEO_HW_SK6812, NEO_HW_LC8812, NEO_HW_APA106) + #define USE_WS2812_CTYPE NEO_GRB // Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW) +#define USE_MY92X1 // Add support for MY92X1 RGBCW led controller as used in Sonoff B1, Ailight and Lohas +#define USE_SM16716 // Add support for SM16716 RGB LED controller (+0k7 code) +#define USE_SM2135 // Add support for SM2135 RGBCW led control as used in Action LSC (+0k6 code) + // -- Counter input ------------------------------- #define USE_COUNTER // Enable inputs as counter (+0k8 code) @@ -372,6 +383,7 @@ // #define USE_MLX90614 // Enable MLX90614 ir temp sensor (I2C address 0x5a) (+0.6k code) // #define USE_CHIRP // Enable CHIRP soil moisture sensor (variable I2C address, default 0x20) // #define USE_PAJ7620 // Enable PAJ7620 gesture sensor (I2C address 0x73) (+2.5k code) +// #define USE_PCF8574 // Enable PCF8574 I/O Expander (I2C addresses 0x20 - 0x27 and 0x38 - 0x3F) (+1k9 code) // #define USE_DISPLAY // Add I2C Display Support (+2k code) #define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0 @@ -436,6 +448,8 @@ #define SDM630_SPEED 9600 // SDM630-Modbus RS485 serial speed (default: 9600 baud) //#define USE_DDS2382 // Add support for Hiking DDS2382 Modbus energy monitor (+0k6 code) #define DDS2382_SPEED 9600 // Hiking DDS2382 Modbus RS485 serial speed (default: 9600 baud) +//#define USE_DDSU666 // Add support for Chint DDSU666 Modbus energy monitor (+0k6 code) + #define DDSU666_SPEED 9600 // Chint DDSU666 Modbus RS485 serial speed (default: 9600 baud) //#define USE_SDM120 // Add support for Eastron SDM120-Modbus energy meter (+2k4 code) // #define SDM120_SPEED 2400 // SDM120-Modbus RS485 serial speed (default: 2400 baud) @@ -507,11 +521,6 @@ // ------------------------------------------------ -#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // -// #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_HARDWARE NEO_HW_WS2812 // Hardware type (NEO_HW_WS2812, NEO_HW_WS2812X, NEO_HW_WS2813, NEO_HW_SK6812, NEO_HW_LC8812, NEO_HW_APA106) - #define USE_WS2812_CTYPE NEO_GRB // Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW) - #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) @@ -530,8 +539,6 @@ // #define USE_THEO_V2 // Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver (+1k4 code) // #define USE_ALECTO_V2 // Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 weather stations using 868MHz RF sensor receiver (+1k7 code) -#define USE_SM16716 // Add support for SM16716 RGB LED controller (+0k7 code) - //#define USE_HRE // Add support for Badger HR-E Water Meter (+1k4 code) //#define USE_A4988_Stepper // Add support for A4988 stepper-motor-driver-circuit (+10k5 code) diff --git a/sonoff/settings.h b/sonoff/settings.h index c11926855..938102cc6 100644 --- a/sonoff/settings.h +++ b/sonoff/settings.h @@ -84,8 +84,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t pwm_multi_channels : 1; // bit 18 (v6.6.0.3) - SetOption68 - Enable multi-channels PWM instead of Color PWM uint32_t tuya_dimmer_min_limit : 1; // bit 19 (v6.6.0.5) - SetOption69 - Limits Tuya dimmers to minimum of 10% (25) when enabled. uint32_t energy_weekend : 1; // bit 20 (v6.6.0.8) - CMND_TARIFF - uint32_t spare21 : 1; - uint32_t spare22 : 1; + uint32_t dds2382_model : 1; // bit 21 (v6.6.0.14) - SetOption71 - Select different Modbus registers for Active Energy (#6531) + uint32_t hardware_energy_total : 1; // bit 22 (v6.6.0.15) - SetOption72 - Enable / Disable hardware energy total counter as reference (#6561) uint32_t spare23 : 1; uint32_t spare24 : 1; uint32_t spare25 : 1; @@ -93,8 +93,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t spare27 : 1; uint32_t spare28 : 1; uint32_t spare29 : 1; - uint32_t shutter_mode : 1; // bit 30 (v6.6.0.15) - SetOption80 - Enable shutter support - uint32_t spare31 : 1; + uint32_t shutter_mode : 1; // bit 30 (v6.6.0.14) - SetOption80 - Enable shutter support + uint32_t pcf8574_ports_inverted : 1; // bit 31 (v6.6.0.14) - SetOption81 - Invert all ports on PCF8574 devices }; } SysBitfield3; @@ -376,7 +376,6 @@ struct SYSCFG { uint16_t ina226_r_shunt[4]; // E20 uint16_t ina226_i_fs[4]; // E28 uint16_t tariff[4][2]; // E30 - uint16_t shutter_opentime[MAX_SHUTTERS]; // E40 uint16_t shutter_closetime[MAX_SHUTTERS]; // E48 int16_t shuttercoeff[5][MAX_SHUTTERS]; // E50 @@ -384,8 +383,9 @@ struct SYSCFG { uint8_t shutter_set50percent[MAX_SHUTTERS]; // E7C uint8_t shutter_position[MAX_SHUTTERS]; // E80 uint8_t shutter_startrelay[MAX_SHUTTERS]; // E84 + uint8_t pcf8574_config[MAX_PCF8574]; // E88 - uint8_t free_e88[368]; // E88 + uint8_t free_e90[360]; // E90 uint32_t cfg_timestamp; // FF8 uint32_t cfg_crc32; // FFC diff --git a/sonoff/settings.ino b/sonoff/settings.ino index 289c8392b..5487ad18a 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -125,8 +125,8 @@ #ifndef ENERGY_OVERTEMP #define ENERGY_OVERTEMP 90 // Overtemp in Celsius #endif -#ifndef TUYA_DIMMER_MAX -#define TUYA_DIMMER_MAX 100 +#ifndef DEFAULT_DIMMER_MAX +#define DEFAULT_DIMMER_MAX 100 #endif enum WebColors { @@ -678,6 +678,7 @@ void SettingsDefaultSet2(void) Settings.mqtt_fingerprint[1][i] = strtol(p, &p, 16); } Settings.tele_period = TELE_PERIOD; + Settings.mqttlog_level = MQTT_LOG_LEVEL; // Energy Settings.flag2.current_resolution = 3; @@ -774,7 +775,7 @@ void SettingsDefaultSet2(void) // Settings.light_rotation = 0; SettingsDefaultSet_5_8_1(); // Clock color - Settings.param[P_TUYA_DIMMER_MAX] = TUYA_DIMMER_MAX; + Settings.param[P_DIMMER_MAX] = DEFAULT_DIMMER_MAX; // Display SettingsDefaultSet_5_10_1(); // Display settings @@ -1084,9 +1085,9 @@ void SettingsDelta(void) if (Settings.version < 0x06060008) { // Move current tuya dimmer range to the new param. if (Settings.flag3.tuya_dimmer_range_255) { - Settings.param[P_TUYA_DIMMER_MAX] = 100; + Settings.param[P_DIMMER_MAX] = 100; } else { - Settings.param[P_TUYA_DIMMER_MAX] = 255; + Settings.param[P_DIMMER_MAX] = 255; } } if (Settings.version < 0x06060009) { diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 5ee19873c..c1c19f3fe 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -68,6 +68,7 @@ const uint8_t MAX_XDSP_DRIVERS = 32; // Max number of allowed display dri 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_PCF8574 = 8; // Max number of PCF8574 devices 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 @@ -248,7 +249,7 @@ enum Shortcuts { SC_CLEAR, SC_DEFAULT, SC_USER }; enum SettingsParamIndex { P_HOLD_TIME, P_MAX_POWER_RETRY, P_ex_TUYA_DIMMER_ID, P_MDNS_DELAYED_START, P_BOOT_LOOP_OFFSET, P_RGB_REMAP, P_IR_UNKNOW_THRESHOLD, // SetOption32 .. SetOption38 P_CSE7766_INVALID_POWER, P_HOLD_IGNORE, P_ex_TUYA_RELAYS, P_OVER_TEMP, // SetOption39 .. SetOption42 - P_TUYA_DIMMER_MAX, + P_DIMMER_MAX, P_ex_TUYA_VOLTAGE_ID, P_ex_TUYA_CURRENT_ID, P_ex_TUYA_POWER_ID, // SetOption43 .. SetOption46 P_ex_ENERGY_TARIFF1, P_ex_ENERGY_TARIFF2, // SetOption47 .. SetOption48 P_MAX_PARAM8 }; // Max is PARAM8_SIZE (18) - SetOption32 until SetOption49 diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 07862a9a5..df7de51ec 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -130,6 +130,7 @@ uint8_t led_power = 0; // LED power state uint8_t ledlnk_inverted = 0; // Link LED inverted flag (1 = (0 = On, 1 = Off)) uint8_t pwm_inverted = 0; // PWM inverted flag (1 = inverted) uint8_t energy_flg = 0; // Energy monitor configured +uint8_t light_flg = 0; // Light module configured uint8_t light_type = 0; // Light types uint8_t serial_in_byte; // Received byte uint8_t ota_retry_counter = OTA_ATTEMPTS; // OTA retry counter @@ -315,6 +316,7 @@ void SetLatchingRelay(power_t lpower, uint32_t state) void SetDevicePower(power_t rpower, uint32_t source) { ShowSource(source); + last_source = source; if (POWER_ALL_ALWAYS_ON == Settings.poweronstate) { // All on and stay on power = (1 << devices_present) -1; @@ -1390,14 +1392,6 @@ void GpioInit(void) devices_present = 1; light_type = LT_BASIC; // Use basic PWM control if SetOption15 = 0 -#ifdef USE_LIGHT - if (Settings.flag.pwm_control) { - for (uint32_t i = 0; i < MAX_PWMS; i++) { - if (pin[GPIO_PWM1 +i] < 99) { light_type++; } // Use Dimmer/Color control for all PWM as SetOption15 = 1 - } - } -#endif // USE_LIGHT - if (XdrvCall(FUNC_MODULE_INIT)) { // Serviced } @@ -1419,30 +1413,24 @@ void GpioInit(void) devices_present = 0; baudrate = 19200; } -#ifdef USE_LIGHT - else if (SONOFF_BN == my_module_type) { // PWM Single color led (White) - light_type = LT_PWM1; + + if (!light_type) { + devices_present = 0; + for (uint32_t i = 0; i < MAX_PWMS; i++) { // Basic PWM control only + if (pin[GPIO_PWM1 +i] < 99) { + pwm_present = true; + pinMode(pin[GPIO_PWM1 +i], OUTPUT); + analogWrite(pin[GPIO_PWM1 +i], bitRead(pwm_inverted, i) ? Settings.pwm_range - Settings.pwm_value[i] : Settings.pwm_value[i]); + } + } } - else if (SONOFF_LED == my_module_type) { // PWM Dual color led (White warm and cold) - light_type = LT_PWM2; - } - else if (AILIGHT == my_module_type) { // RGBW led - light_type = LT_RGBW; - } - else if (SONOFF_B1 == my_module_type) { // RGBWC led - light_type = LT_RGBWC; - } -#endif // USE_LIGHT - else { - if (!light_type) { devices_present = 0; } - for (uint32_t i = 0; i < MAX_RELAYS; i++) { - if (pin[GPIO_REL1 +i] < 99) { - pinMode(pin[GPIO_REL1 +i], OUTPUT); - devices_present++; - if (EXS_RELAY == my_module_type) { - digitalWrite(pin[GPIO_REL1 +i], bitRead(rel_inverted, i) ? 1 : 0); - if (i &1) { devices_present--; } - } + for (uint32_t i = 0; i < MAX_RELAYS; i++) { + if (pin[GPIO_REL1 +i] < 99) { + pinMode(pin[GPIO_REL1 +i], OUTPUT); + devices_present++; + if (EXS_RELAY == my_module_type) { + digitalWrite(pin[GPIO_REL1 +i], bitRead(rel_inverted, i) ? 1 : 0); + if (i &1) { devices_present--; } } } } @@ -1474,37 +1462,6 @@ void GpioInit(void) RotaryInit(); #endif -#ifdef USE_LIGHT -#ifdef USE_WS2812 - if (!light_type && (pin[GPIO_WS2812] < 99)) { // RGB led - devices_present++; - light_type = LT_WS2812; - } -#endif // USE_WS2812 -#ifdef USE_SM16716 - if (SM16716_ModuleSelected()) { - light_type += 3; - light_type |= LT_SM16716; - } -#endif // USE_SM16716 - - // post-process for lights - if (Settings.flag3.pwm_multi_channels) { - uint32_t pwm_channels = (light_type & 7) > LST_MAX ? LST_MAX : (light_type & 7); - if (0 == pwm_channels) { pwm_channels = 1; } - devices_present += pwm_channels - 1; // add the pwm channels controls at the end - } -#endif // USE_LIGHT - if (!light_type) { - for (uint32_t i = 0; i < MAX_PWMS; i++) { // Basic PWM control only - if (pin[GPIO_PWM1 +i] < 99) { - pwm_present = true; - pinMode(pin[GPIO_PWM1 +i], OUTPUT); - analogWrite(pin[GPIO_PWM1 +i], bitRead(pwm_inverted, i) ? Settings.pwm_range - Settings.pwm_value[i] : Settings.pwm_value[i]); - } - } - } - SetLedPower(Settings.ledstate &8); SetLedLink(Settings.ledstate &8); diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 3a792f569..eceb972a0 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -165,6 +165,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #define USE_SDM120_2 // Add support for Eastron SDM120-Modbus energy monitor (+1k1 code) #define USE_SDM630_2 // Add support for Eastron SDM630-Modbus energy monitor (+0k6 code) #define USE_DDS2382 // Add support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#define USE_DDSU666 // Add support for Chint DDSU666 Modbus energy monitor (+0k6 code) #define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor #define USE_MAX31855 // Add support for MAX31855 K-Type thermocouple sensor using softSPI @@ -251,6 +252,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_SDM120_2 // Disable support for Eastron SDM120-Modbus energy meter #undef USE_SDM630_2 // Disable support for Eastron SDM630-Modbus energy monitor (+0k6 code) #undef USE_DDS2382 // Disable support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#undef USE_DDSU666 // Disable support for Chint DDSU666 Modbus energy monitor (+0k6 code) #define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor #undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI @@ -305,6 +307,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_SDM120_2 // Disable support for Eastron SDM120-Modbus energy meter #undef USE_SDM630_2 // Disable support for Eastron SDM630-Modbus energy monitor (+0k6 code) #undef USE_DDS2382 // Disable support for Hiking DDS2382 Modbus energy monitor (+0k6 code) + #undef USE_DDSU666 // Disable support for Chint DDSU666 Modbus energy monitor (+0k6 code) #undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem) #undef USE_DOMOTICZ // Disable Domoticz #undef USE_HOME_ASSISTANT // Disable Home Assistant @@ -388,6 +391,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_SDM120_2 // Disable support for Eastron SDM120-Modbus energy meter #undef USE_SDM630_2 // Disable support for Eastron SDM630-Modbus energy monitor (+0k6 code) #undef USE_DDS2382 // Disable support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#undef USE_DDSU666 // Disable support for Chint DDSU666 Modbus energy monitor (+0k6 code) //#define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor #undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI @@ -484,6 +488,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_SDM120_2 // Disable support for Eastron SDM120-Modbus energy meter #undef USE_SDM630_2 // Disable support for Eastron SDM630-Modbus energy monitor (+0k6 code) #undef USE_DDS2382 // Disable support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#undef USE_DDSU666 // Disable support for Chint DDSU666 Modbus energy monitor (+0k6 code) #undef USE_DHT // Disable support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor #undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI @@ -568,6 +573,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_SDM120_2 // Disable support for Eastron SDM120-Modbus energy meter #undef USE_SDM630_2 // Disable support for Eastron SDM630-Modbus energy monitor (+0k6 code) #undef USE_DDS2382 // Disable support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#undef USE_DDSU666 // Disable support for Chint DDSU666 Modbus energy monitor (+0k6 code) #undef USE_DHT // Disable support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor #undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index e0f3c6e06..ca09fce44 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -202,6 +202,10 @@ enum UserSelectablePins { GPIO_A4988_MS3, // A4988 microstep pin3 GPIO_DDS2382_TX, // DDS2382 Serial interface GPIO_DDS2382_RX, // DDS2382 Serial interface + GPIO_DDSU666_TX, // DDSU666 Serial interface + GPIO_DDSU666_RX, // DDSU666 Serial interface + GPIO_SM2135_CLK, // SM2135 Clk + GPIO_SM2135_DAT, // SM2135 Dat GPIO_SENSOR_END }; // Programmer selectable GPIO functionality @@ -277,6 +281,8 @@ const char kSensorNames[] PROGMEM = D_SENSOR_IBEACON_TX "|" D_SENSOR_IBEACON_RX "|" D_SENSOR_A4988_DIR "|" D_SENSOR_A4988_STP "|" D_SENSOR_A4988_ENA "|" D_SENSOR_A4988_MS1 "|" D_SENSOR_A4988_MS2 "|" D_SENSOR_A4988_MS3 "|" D_SENSOR_DDS2382_TX "|" D_SENSOR_DDS2382_RX "|" + D_SENSOR_DDSU666_TX "|" D_SENSOR_DDSU666_RX "|" + D_SENSOR_SM2135_CLK "|" D_SENSOR_SM2135_DAT "|" ; // User selectable ADC0 functionality @@ -544,13 +550,19 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_ARIRFRCV, // AriLux RF Receive input GPIO_ARIRFSEL, // Arilux RF Receive input selected #endif +#ifdef USE_MY92X1 GPIO_DI, // my92x1 PWM input GPIO_DCKI, // my92x1 CLK input +#endif // USE_MY92X1 #ifdef USE_SM16716 GPIO_SM16716_CLK, // SM16716 CLOCK GPIO_SM16716_DAT, // SM16716 DATA GPIO_SM16716_SEL, // SM16716 SELECT #endif // USE_SM16716 +#ifdef USE_SM2135 + GPIO_SM2135_CLK, // SM2135 CLOCK + GPIO_SM2135_DAT, // SM2135 DATA +#endif // USE_SM2135 #ifdef USE_TUYA_MCU GPIO_TUYA_TX, // Tuya Serial interface GPIO_TUYA_RX, // Tuya Serial interface @@ -645,6 +657,10 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_SOLAXX1_TX, // Solax Inverter tx pin GPIO_SOLAXX1_RX, // Solax Inverter rx pin #endif +#ifdef USE_DDSU666 + GPIO_DDSU666_TX, // DDSU666 Serial interface + GPIO_DDSU666_RX, // DDSU666 Serial interface +#endif // USE_DDSU666 #ifdef USE_SERIAL_BRIDGE GPIO_SBR_TX, // Serial Bridge Serial interface diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h index 02af08bab..51d92d944 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 = 0x0606000E; +const uint32_t VERSION = 0x0606000F; #endif // _SONOFF_VERSION_H_ diff --git a/sonoff/support.ino b/sonoff/support.ino index 0a8b6c42c..8dbbc3316 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -1460,8 +1460,8 @@ void I2cScan(char *devs, unsigned int devs_len) void I2cSetActive(uint32_t addr, uint32_t count = 1) { - addr &= 0x7F; - count &= 0x7F; + addr &= 0x7F; // Max I2C address is 127 + count &= 0x7F; // Max 4 x 32 bits available while (count-- && (addr < 128)) { i2c_active[addr / 32] |= (1 << (addr % 32)); addr++; @@ -1471,7 +1471,7 @@ void I2cSetActive(uint32_t addr, uint32_t count = 1) bool I2cActive(uint32_t addr) { - addr &= 0x7F; + addr &= 0x7F; // Max I2C address is 127 if (i2c_active[addr / 32] & (1 << (addr % 32))) { return true; } @@ -1480,16 +1480,12 @@ bool I2cActive(uint32_t addr) bool I2cDevice(uint8_t addr) { + addr &= 0x7F; // Max I2C address is 127 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; // Report as present; - } - } - return false; + Wire.beginTransmission(addr); + return (0 == Wire.endTransmission()); } #endif // USE_I2C diff --git a/sonoff/support_command.ino b/sonoff/support_command.ino index 0e2f6d4e6..fbc6316c5 100644 --- a/sonoff/support_command.ino +++ b/sonoff/support_command.ino @@ -81,55 +81,61 @@ void ResponseCmndIdxChar(const char* value) /********************************************************************************************/ -void ExecuteCommand(char *cmnd, uint32_t source) +void ExecuteCommand(const char *cmnd, uint32_t source) { - char *start; - char *token; - + // cmnd: "status 0" = stopic "status" and svalue " 0" + // cmnd: "var1 =1" = stopic "var1" and svalue " =1" + // cmnd: "var1=1" = stopic "var1" and svalue "=1" #ifdef USE_DEBUG_DRIVER ShowFreeMem(PSTR("ExecuteCommand")); #endif ShowSource(source); - token = strtok(cmnd, " "); - if (token != nullptr) { - start = strrchr(token, '/'); // Skip possible cmnd/sonoff/ preamble - if (start) { token = start +1; } + const char *pos = cmnd; + while (*pos && isspace(*pos)) { + pos++; // Skip all spaces } - uint32_t size = (token != nullptr) ? strlen(token) : 0; - char stopic[size +2]; // / + \0 - snprintf_P(stopic, sizeof(stopic), PSTR("/%s"), (token == nullptr) ? "" : token); - token = strtok(nullptr, ""); - size = (token != nullptr) ? strlen(token) : 0; - char svalue[size +1]; - strlcpy(svalue, (token == nullptr) ? "" : token, sizeof(svalue)); // Fixed 5.8.0b - CommandHandler(stopic, (uint8_t*)svalue, strlen(svalue)); + const char *start = pos; + // Get a command. Commands can only use letters, digits and underscores + while (*pos && (isalpha(*pos) || isdigit(*pos) || '_' == *pos || '/' == *pos)) { + if ('/' == *pos) { // Skip possible cmnd/sonoff/ preamble + start = pos + 1; + } + pos++; + } + if ('\0' == *start || pos <= start) { + return; // Did not find any command to execute + } + + uint32_t size = pos - start; + char stopic[size + 2]; // with leader '/' and end '\0' + stopic[0] = '/'; + memcpy(stopic+1, start, size); + stopic[size+1] = '\0'; + + char svalue[strlen(pos) +1]; // pos point to the start of parameters + strlcpy(svalue, pos, sizeof(svalue)); + CommandHandler(stopic, svalue, strlen(svalue)); } /********************************************************************************************/ -// topic: /power1 data: toggle = Console command -// topic: cmnd/sonoff/power1 data: toggle = Mqtt command using topic -// topic: cmnd/sonoffs/power1 data: toggle = Mqtt command using a group topic -// topic: cmnd/DVES_83BB10_fb/power1 data: toggle = Mqtt command using fallback topic +// topicBuf: /power1 dataBuf: toggle = Console command +// topicBuf: cmnd/sonoff/power1 dataBuf: toggle = Mqtt command using topic +// topicBuf: cmnd/sonoffs/power1 dataBuf: toggle = Mqtt command using a group topic +// topicBuf: cmnd/DVES_83BB10_fb/power1 dataBuf: toggle = Mqtt command using fallback topic -void CommandHandler(char* topic, uint8_t* data, uint32_t data_len) +void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) { #ifdef USE_DEBUG_DRIVER ShowFreeMem(PSTR("CommandHandler")); #endif - char topicBuf[TOPSZ]; - strlcpy(topicBuf, topic, sizeof(topicBuf)); - - uint32_t i = 0; - for (i = 0; i < data_len; i++) { - if (!isspace(data[i])) { break; } // Skip leading spaces in data + while (*dataBuf && isspace(*dataBuf)) { + dataBuf++; // Skip leading spaces in data + data_len--; } - data_len -= i; - char dataBuf[data_len+1]; - memcpy(dataBuf, data +i, sizeof(dataBuf)); bool grpflg = (strstr(topicBuf, Settings.mqtt_grptopic) != nullptr); @@ -137,8 +143,9 @@ void CommandHandler(char* topic, uint8_t* data, uint32_t data_len) GetFallbackTopic_P(stemp1, CMND, ""); // Full Fallback topic = cmnd/DVES_xxxxxxxx_fb/ fallback_topic_flag = (!strncmp(topicBuf, stemp1, strlen(stemp1))); - char *type = strrchr(topicBuf, '/'); // Last part of received topic is always the command (type) + char *type = strrchr(topicBuf, '/'); // Last part of received topic is always the command (type) + uint32_t i = 0; uint32_t index = 1; bool user_index = false; if (type != nullptr) { @@ -156,7 +163,7 @@ void CommandHandler(char* topic, uint8_t* data, uint32_t data_len) type[i] = '\0'; } - DEBUG_CORE_LOG(PSTR("CMD: " D_GROUP " %d, " D_INDEX " %d, " D_COMMAND " \"%s\", " D_DATA " \"%s\""), grpflg, index, type, dataBuf); + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("CMD: " D_GROUP " %d, " D_INDEX " %d, " D_COMMAND " \"%s\", " D_DATA " \"%s\""), grpflg, index, type, dataBuf); if (type != nullptr) { Response_P(PSTR("{\"" D_JSON_COMMAND "\":\"" D_JSON_ERROR "\"}")); @@ -361,10 +368,10 @@ void CmndStatus(void) } if ((0 == payload) || (3 == payload)) { - Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS3_LOGGING "\":{\"" D_CMND_SERIALLOG "\":%d,\"" D_CMND_WEBLOG "\":%d,\"" D_CMND_SYSLOG "\":%d,\"" + Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS3_LOGGING "\":{\"" D_CMND_SERIALLOG "\":%d,\"" D_CMND_WEBLOG "\":%d,\"" D_CMND_MQTTLOG "\":%d,\"" D_CMND_SYSLOG "\":%d,\"" D_CMND_LOGHOST "\":\"%s\",\"" D_CMND_LOGPORT "\":%d,\"" D_CMND_SSID "\":[\"%s\",\"%s\"],\"" D_CMND_TELEPERIOD "\":%d,\"" D_JSON_RESOLUTION "\":\"%08X\",\"" D_CMND_SETOPTION "\":[\"%08X\",\"%s\",\"%08X\"]}}"), - Settings.seriallog_level, Settings.weblog_level, Settings.syslog_level, + Settings.seriallog_level, Settings.weblog_level, Settings.mqttlog_level, Settings.syslog_level, Settings.syslog_host, Settings.syslog_port, Settings.sta_ssid[0], Settings.sta_ssid[1], Settings.tele_period, Settings.flag2.data, Settings.flag.data, ToHex_P((unsigned char*)Settings.param, PARAM8_SIZE, stemp2, sizeof(stemp2)), Settings.flag3.data); MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "3")); @@ -558,11 +565,24 @@ void CmndPowerOnState(void) void CmndPulsetime(void) { if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= MAX_PULSETIMERS)) { - if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < 65536)) { - Settings.pulse_timer[XdrvMailbox.index -1] = XdrvMailbox.payload; // 0 - 65535 - SetPulseTimer(XdrvMailbox.index -1, XdrvMailbox.payload); + uint32_t items = 1; + if (!XdrvMailbox.usridx && !XdrvMailbox.data_len) { + items = MAX_PULSETIMERS; + } else { + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < 65536)) { + Settings.pulse_timer[XdrvMailbox.index -1] = XdrvMailbox.payload; // 0 - 65535 + SetPulseTimer(XdrvMailbox.index -1, XdrvMailbox.payload); + } } - Response_P(S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE, XdrvMailbox.command, XdrvMailbox.index, Settings.pulse_timer[XdrvMailbox.index -1], GetPulseTimer(XdrvMailbox.index -1)); + mqtt_data[0] = '\0'; + for (uint32_t i = 0; i < items; i++) { + uint32_t index = (1 == items) ? XdrvMailbox.index : i +1; + ResponseAppend_P(PSTR("%c\"%s%d\":{\"" D_JSON_SET "\":%d,\"" D_JSON_REMAINING "\":%d}"), + (i) ? ',' : '{', + XdrvMailbox.command, index, + Settings.pulse_timer[index -1], GetPulseTimer(index -1)); + } + ResponseJsonEnd(); } } @@ -686,11 +706,9 @@ void CmndSetoption(void) IrReceiveUpdateThreshold(); break; #endif -#ifdef USE_TUYA_MCU - case P_TUYA_DIMMER_MAX: + case P_DIMMER_MAX: restart_flag = 2; // Need a restart to update GUI break; -#endif } } } diff --git a/sonoff/support_features.ino b/sonoff/support_features.ino index 9b5e05747..30403e6c3 100644 --- a/sonoff/support_features.ino +++ b/sonoff/support_features.ino @@ -450,11 +450,18 @@ void GetFeatures(void) #ifdef USE_DDS2382 feature5 |= 0x00000040; // Xnrg_09_dds2382.ino #endif -// feature5 |= 0x00000080; - -// feature5 |= 0x00000100; -// feature5 |= 0x00000200; -// feature5 |= 0x00000400; +#ifdef USE_SM2135 + feature5 |= 0x00000080; // Xdrv_026_sm2135.ino +#endif +#ifdef USE_SHUTTER + feature5 |= 0x00000100; // Xdrv_027_shutter.ino +#endif +#ifdef USE_PCF8574 + feature5 |= 0x00000200; // Xdrv_028_pcf8574.ino +#endif +#ifdef USE_DDSU666 + feature5 |= 0x00000400; // Xnrg_11_ddsu666.ino +#endif // feature5 |= 0x00000800; // feature5 |= 0x00001000; diff --git a/sonoff/support_udp.ino b/sonoff/support_udp.ino index 550e97b97..a33ca6973 100644 --- a/sonoff/support_udp.ino +++ b/sonoff/support_udp.ino @@ -85,7 +85,11 @@ void PollUdp(void) // AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR("\n%s"), packet_buffer); // Simple Service Discovery Protocol (SSDP) +#ifdef USE_SCRIPT_HUE + if (!udp_response_mutex && (strstr_P(packet_buffer, PSTR("M-SEARCH")) != nullptr)) { +#else if (devices_present && !udp_response_mutex && (strstr_P(packet_buffer, PSTR("M-SEARCH")) != nullptr)) { +#endif udp_response_mutex = true; udp_remote_ip = PortUdp.remoteIP(); diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index c4239e90f..32aeed73c 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -527,7 +527,7 @@ const char kButtonConfirm[] PROGMEM = D_CONFIRM_RESTART "|" D_CONFIRM_RESET_CONF enum CTypes { CT_HTML, CT_PLAIN, CT_XML, CT_JSON, CT_STREAM }; const char kContentTypes[] PROGMEM = "text/html|text/plain|text/xml|application/json|application/octet-stream"; -const char kLoggingOptions[] PROGMEM = D_SERIAL_LOG_LEVEL "|" D_WEB_LOG_LEVEL "|" D_SYS_LOG_LEVEL; +const char kLoggingOptions[] PROGMEM = D_SERIAL_LOG_LEVEL "|" D_WEB_LOG_LEVEL "|" D_MQTT_LOG_LEVEL "|" D_SYS_LOG_LEVEL; const char kLoggingLevels[] PROGMEM = D_NONE "|" D_ERROR "|" D_INFO "|" D_DEBUG "|" D_MORE_DEBUG; const char kEmulationOptions[] PROGMEM = D_NONE "|" D_BELKIN_WEMO "|" D_HUE_BRIDGE; @@ -1128,7 +1128,7 @@ bool HandleRootStatusRefresh(void) } #ifdef USE_SHUTTER char webindex[5]; // WebGetArg name - for (uint32_t j = 1; j < 5; j++) { + for (uint32_t j = 1; j <= shutters_present; j++) { snprintf_P(webindex, sizeof(webindex), PSTR("u%d"), j); WebGetArg(webindex, tmp, sizeof(tmp)); // 0 - 100 percent if (strlen(tmp)) { @@ -1618,9 +1618,10 @@ void HandleLoggingConfiguration(void) WSContentSend_P(HTTP_FORM_LOG1); char stemp1[45]; char stemp2[32]; - uint8_t dlevel[3] = { LOG_LEVEL_INFO, LOG_LEVEL_INFO, LOG_LEVEL_NONE }; - for (uint32_t idx = 0; idx < 3; idx++) { - uint32_t llevel = (0==idx)?Settings.seriallog_level:(1==idx)?Settings.weblog_level:Settings.syslog_level; + uint8_t dlevel[4] = { LOG_LEVEL_INFO, LOG_LEVEL_INFO, LOG_LEVEL_NONE, LOG_LEVEL_NONE }; + for (uint32_t idx = 0; idx < 4; idx++) { + if ((2==idx) && !Settings.flag.mqtt_enabled) { continue; } + uint32_t llevel = (0==idx)?Settings.seriallog_level:(1==idx)?Settings.weblog_level:(2==idx)?Settings.mqttlog_level:Settings.syslog_level; WSContentSend_P(PSTR("

%s (%s)
" D_INVERT_PORTS "


"; + +const char HTTP_FORM_I2C_PCF8574_2[] PROGMEM = + "" D_DEVICE " %d " D_PORT " %d"; + +void HandlePcf8574(void) +{ + if (!HttpCheckPriviledgedAccess()) { return; } + + AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP D_CONFIGURE_PCF8574)); + + if (WebServer->hasArg("save")) { + Pcf8574SaveSettings(); + WebRestart(1); + return; + } + + WSContentStart_P(D_CONFIGURE_PCF8574); + WSContentSendStyle(); + WSContentSend_P(HTTP_FORM_I2C_PCF8574_1, (Settings.flag3.pcf8574_ports_inverted) ? " checked" : ""); + WSContentSend_P(HTTP_TABLE100); + for (uint32_t idx = 0; idx < Pcf8574.max_devices; idx++) { + for (uint32_t idx2 = 0; idx2 < 8; idx2++) { // 8 ports on PCF8574 + uint8_t helper = 1 << idx2; + WSContentSend_P(HTTP_FORM_I2C_PCF8574_2, + idx +1, idx2, + idx2 + 8*idx, + idx2 + 8*idx, + ((helper & Settings.pcf8574_config[idx]) >> idx2 == 0) ? " selected " : " ", + ((helper & Settings.pcf8574_config[idx]) >> idx2 == 1) ? " selected " : " " + ); + } + } + WSContentSend_P(PSTR("")); + WSContentSend_P(HTTP_FORM_END); + WSContentSpaceButton(BUTTON_CONFIGURATION); + WSContentStop(); +} + +void Pcf8574SaveSettings() +{ + char stemp[7]; + char tmp[100]; + + //AddLog_P(LOG_LEVEL_DEBUG, PSTR("PCF: Start working on Save arguements: inverted:%d")), WebServer->hasArg("b1"); + + Settings.flag3.pcf8574_ports_inverted = WebServer->hasArg("b1"); + for (byte idx = 0; idx < Pcf8574.max_devices; idx++) { + byte count=0; + byte n = Settings.pcf8574_config[idx]; + while(n!=0) { + n = n&(n-1); + count++; + } + if (count <= devices_present) { + devices_present = devices_present - count; + } + for (byte i = 0; i < 8; i++) { + snprintf_P(stemp, sizeof(stemp), PSTR("i2cs%d"), i+8*idx); + WebGetArg(stemp, tmp, sizeof(tmp)); + byte _value = (!strlen(tmp)) ? 0 : atoi(tmp); + if (_value) { + Settings.pcf8574_config[idx] = Settings.pcf8574_config[idx] | 1 << i; + devices_present++; + Pcf8574.max_connected_ports++; + } else { + Settings.pcf8574_config[idx] = Settings.pcf8574_config[idx] & ~(1 << i ); + } + } + //Settings.pcf8574_config[0] = (!strlen(webServer->arg("i2cs0").c_str())) ? 0 : atoi(webServer->arg("i2cs0").c_str()); + //AddLog_P2(LOG_LEVEL_INFO, PSTR("PCF: I2C Board: %d, Config: %2x")), idx, Settings.pcf8574_config[idx]; + + } +} +#endif // USE_WEBSERVER + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv28(uint8_t function) +{ + bool result = false; + + if (i2c_flg && Pcf8574.type) { + switch (function) { + case FUNC_SET_POWER: + Pcf8574SwitchRelay(); + break; +#ifdef USE_WEBSERVER + case FUNC_WEB_ADD_BUTTON: + WSContentSend_P(HTTP_BTN_MENU_PCF8574); + break; + case FUNC_WEB_ADD_HANDLER: + WebServer->on("/" WEB_HANDLE_PCF8574, HandlePcf8574); + break; +#endif // USE_WEBSERVER + case FUNC_PRE_INIT: + Pcf8574Init(); + break; + } + } + return result; +} + +#endif // USE_PCF8574 +#endif // USE_I2C diff --git a/sonoff/xdrv_99_debug.ino b/sonoff/xdrv_99_debug.ino index c4fc535b7..78437ad33 100644 --- a/sonoff/xdrv_99_debug.ino +++ b/sonoff/xdrv_99_debug.ino @@ -57,6 +57,10 @@ #define D_CMND_HELP "Help" #define D_CMND_RTCDUMP "RtcDump" #define D_CMND_SETSENSOR "SetSensor" +#define D_CMND_I2CWRITE "I2CWrite" +#define D_CMND_I2CREAD "I2CRead" +#define D_CMND_I2CSTRETCH "I2CStretch" +#define D_CMND_I2CCLOCK "I2CClock" const char kDebugCommands[] PROGMEM = "|" // No prefix D_CMND_CFGDUMP "|" D_CMND_CFGPEEK "|" D_CMND_CFGPOKE "|" @@ -70,7 +74,8 @@ const char kDebugCommands[] PROGMEM = "|" // No prefix #ifdef DEBUG_THEO D_CMND_EXCEPTION "|" #endif - D_CMND_FLASHDUMP "|" D_CMND_FLASHMODE "|" D_CMND_FREEMEM"|" D_CMND_HELP "|" D_CMND_RTCDUMP "|" D_CMND_SETSENSOR ; + D_CMND_FLASHDUMP "|" D_CMND_FLASHMODE "|" D_CMND_FREEMEM"|" D_CMND_HELP "|" D_CMND_RTCDUMP "|" D_CMND_SETSENSOR "|" + D_CMND_I2CWRITE "|" D_CMND_I2CREAD "|" D_CMND_I2CSTRETCH "|" D_CMND_I2CCLOCK ; void (* const DebugCommand[])(void) PROGMEM = { &CmndCfgDump, &CmndCfgPeek, &CmndCfgPoke, @@ -84,7 +89,8 @@ void (* const DebugCommand[])(void) PROGMEM = { #ifdef DEBUG_THEO &CmndException, #endif - &CmndFlashDump, &CmndFlashMode, &CmndFreemem, &CmndHelp, &CmndRtcDump, &CmndSetSensor }; + &CmndFlashDump, &CmndFlashMode, &CmndFreemem, &CmndHelp, &CmndRtcDump, &CmndSetSensor, + &CmndI2cWrite, &CmndI2cRead, &CmndI2cStretch, &CmndI2cClock }; uint32_t CPU_loops = 0; uint32_t CPU_last_millis = 0; @@ -569,6 +575,84 @@ void CmndFlashDump(void) ResponseCmndDone(); } +void CmndI2cWrite(void) +{ + // I2cWrite
,.. + if (i2c_flg) { + char* parms = XdrvMailbox.data; + uint8_t buffer[100]; + uint32_t index = 0; + + char *p; + char *data = strtok_r(parms, " ,", &p); + while (data != NULL && index < sizeof(buffer)) { + buffer[index++] = strtol(data, nullptr, 16); + data = strtok_r(nullptr, " ,", &p); + } + + if (index > 1) { + AddLogBuffer(LOG_LEVEL_INFO, buffer, index); + + Wire.beginTransmission(buffer[0]); + for (uint32_t i = 1; i < index; i++) { + Wire.write(buffer[i]); + } + int result = Wire.endTransmission(); + AddLog_P2(LOG_LEVEL_INFO, PSTR("I2C: Result %d"), result); + } + } + ResponseCmndDone(); +} + +void CmndI2cRead(void) +{ + // I2cRead
, + if (i2c_flg) { + char* parms = XdrvMailbox.data; + uint8_t buffer[100]; + uint32_t index = 0; + + char *p; + char *data = strtok_r(parms, " ,", &p); + while (data != NULL && index < sizeof(buffer)) { + buffer[index++] = strtol(data, nullptr, 16); + data = strtok_r(nullptr, " ,", &p); + } + + if (index > 0) { + uint8_t size = 1; + if (index > 1) { + size = buffer[1]; + } + Wire.requestFrom(buffer[0], size); + index = 0; + while (Wire.available() && index < sizeof(buffer)) { + buffer[index++] = Wire.read(); + } + if (index > 0) { + AddLogBuffer(LOG_LEVEL_INFO, buffer, index); + } + } + } + ResponseCmndDone(); +} + +void CmndI2cStretch(void) +{ + if (i2c_flg && (XdrvMailbox.payload > 0)) { + Wire.setClockStretchLimit(XdrvMailbox.payload); + } + ResponseCmndDone(); +} + +void CmndI2cClock(void) +{ + if (i2c_flg && (XdrvMailbox.payload > 0)) { + Wire.setClock(XdrvMailbox.payload); + } + ResponseCmndDone(); +} + /*********************************************************************************************\ * Interface \*********************************************************************************************/ diff --git a/sonoff/xdrv_interface.ino b/sonoff/xdrv_interface.ino index be9936c4d..ead58e613 100644 --- a/sonoff/xdrv_interface.ino +++ b/sonoff/xdrv_interface.ino @@ -847,16 +847,6 @@ void XsnsDriverState(void) /*********************************************************************************************/ -bool XdrvMqttData(char *topicBuf, uint16_t stopicBuf, char *dataBuf, uint16_t sdataBuf) -{ - XdrvMailbox.index = stopicBuf; - XdrvMailbox.data_len = sdataBuf; - XdrvMailbox.topic = topicBuf; - XdrvMailbox.data = dataBuf; - - return XdrvCall(FUNC_MQTT_DATA); -} - bool XdrvRulesProcess(void) { return XdrvCallDriver(10, FUNC_RULES_PROCESS); diff --git a/sonoff/xlgt_02_my92x1.ino b/sonoff/xlgt_02_my92x1.ino new file mode 100644 index 000000000..0f74f5713 --- /dev/null +++ b/sonoff/xlgt_02_my92x1.ino @@ -0,0 +1,166 @@ +/* + xlgt_02_my92x1.ino - led support for Sonoff-Tasmota + + Copyright (C) 2019 Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_LIGHT +#ifdef USE_MY92X1 +/*********************************************************************************************\ + * Sonoff B1 and AiLight inspired by OpenLight https://github.com/icamgo/noduino-sdk +\*********************************************************************************************/ + +#define XLGT_02 2 + +struct MY92X1 { + uint8_t pdi_pin; + uint8_t pdcki_pin; +} My92x1; + +extern "C" { + void os_delay_us(unsigned int); +} + +void LightDiPulse(uint8_t times) +{ + for (uint32_t i = 0; i < times; i++) { + digitalWrite(My92x1.pdi_pin, HIGH); + digitalWrite(My92x1.pdi_pin, LOW); + } +} + +void LightDckiPulse(uint8_t times) +{ + for (uint32_t i = 0; i < times; i++) { + digitalWrite(My92x1.pdcki_pin, HIGH); + digitalWrite(My92x1.pdcki_pin, LOW); + } +} + +void LightMy92x1Write(uint8_t data) +{ + for (uint32_t i = 0; i < 4; i++) { // Send 8bit Data + digitalWrite(My92x1.pdcki_pin, LOW); + digitalWrite(My92x1.pdi_pin, (data & 0x80)); + digitalWrite(My92x1.pdcki_pin, HIGH); + data = data << 1; + digitalWrite(My92x1.pdi_pin, (data & 0x80)); + digitalWrite(My92x1.pdcki_pin, LOW); + digitalWrite(My92x1.pdi_pin, LOW); + data = data << 1; + } +} + +void LightMy92x1Init(void) +{ + uint8_t chips = 1; // 1 (AiLight) + if (LT_RGBWC == light_type) { + chips = 2; // 2 (Sonoff B1) + } + + LightDckiPulse(chips * 32); // Clear all duty register + os_delay_us(12); // TStop > 12us. + // Send 12 DI pulse, after 6 pulse's falling edge store duty data, and 12 + // pulse's rising edge convert to command mode. + LightDiPulse(12); + os_delay_us(12); // Delay >12us, begin send CMD data + for (uint32_t n = 0; n < chips; n++) { // Send CMD data + LightMy92x1Write(0x18); // ONE_SHOT_DISABLE, REACTION_FAST, BIT_WIDTH_8, FREQUENCY_DIVIDE_1, SCATTER_APDM + } + os_delay_us(12); // TStart > 12us. Delay 12 us. + // Send 16 DI pulse, at 14 pulse's falling edge store CMD data, and + // at 16 pulse's falling edge convert to duty mode. + LightDiPulse(16); + os_delay_us(12); // TStop > 12us. +} + +void LightMy92x1Duty(uint8_t duty_r, uint8_t duty_g, uint8_t duty_b, uint8_t duty_w, uint8_t duty_c) +{ + uint8_t channels[2] = { 4, 6 }; + + uint8_t didx = 0; // 0 (AiLight) + if (LT_RGBWC == light_type) { + didx = 1; // 1 (Sonoff B1) + } + + uint8_t duty[2][6] = {{ duty_r, duty_g, duty_b, duty_w, duty_w, duty_w }, // Definition for RGBW(WW) channels + { duty_w, duty_c, 0, duty_g, duty_r, duty_b }}; // Definition for RGBWC channels + + os_delay_us(12); // TStop > 12us. + for (uint32_t channel = 0; channel < channels[didx]; channel++) { + LightMy92x1Write(duty[didx][channel]); // Send 8bit Data + } + os_delay_us(12); // TStart > 12us. Ready for send DI pulse. + LightDiPulse(8); // Send 8 DI pulse. After 8 pulse falling edge, store old data. + os_delay_us(12); // TStop > 12us. +} + +/********************************************************************************************/ + +bool My92x1SetChannels(void) +{ + uint8_t *cur_col = (uint8_t*)XdrvMailbox.data; + + LightMy92x1Duty(cur_col[0], cur_col[1], cur_col[2], cur_col[3], cur_col[4]); + + return true; +} + +void My92x1ModuleSelected(void) +{ + if ((pin[GPIO_DCKI] < 99) && (pin[GPIO_DI] < 99)) { + My92x1.pdi_pin = pin[GPIO_DI]; + My92x1.pdcki_pin = pin[GPIO_DCKI]; + + pinMode(My92x1.pdi_pin, OUTPUT); + pinMode(My92x1.pdcki_pin, OUTPUT); + digitalWrite(My92x1.pdi_pin, LOW); + digitalWrite(My92x1.pdcki_pin, LOW); + + LightMy92x1Init(); + + if (AILIGHT == my_module_type) { // RGBW(WW) led + light_type = LT_RGBW; + } + else if (SONOFF_B1 == my_module_type) { // RGBWC led + light_type = LT_RGBWC; + } + light_flg = XLGT_02; + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: MY29x1 Found")); + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xlgt02(uint8_t function) +{ + bool result = false; + + switch (function) { + case FUNC_SET_CHANNELS: + result = My92x1SetChannels(); + break; + case FUNC_MODULE_INIT: + My92x1ModuleSelected(); + break; + } + return result; +} + +#endif // USE_MY92X1 +#endif // USE_LIGHT \ No newline at end of file diff --git a/sonoff/xlgt_03_sm16716.ino b/sonoff/xlgt_03_sm16716.ino new file mode 100644 index 000000000..d12636e85 --- /dev/null +++ b/sonoff/xlgt_03_sm16716.ino @@ -0,0 +1,200 @@ +/* + xlgt_03_sm16716.ino - sm16716 three channel led support for Sonoff-Tasmota + + Copyright (C) 2019 Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_LIGHT +#ifdef USE_SM16716 +/*********************************************************************************************\ + * SM16716 - Controlling RGB over a synchronous serial line + * Copyright (C) 2019 Gabor Simon + * + * Source: https://community.home-assistant.io/t/cheap-uk-wifi-bulbs-with-tasmota-teardown-help-tywe3s/40508/27 +\*********************************************************************************************/ + +#define XLGT_03 3 + +#define D_LOG_SM16716 "SM16716: " + +struct SM16716 { + uint8_t pin_clk = 0; + uint8_t pin_dat = 0; + uint8_t pin_sel = 0; + bool enabled = false; +} Sm16716; + +void SM16716_SendBit(uint8_t v) +{ + /* NOTE: + * According to the spec sheet, max freq is 30 MHz, that is 16.6 ns per high/low half of the + * clk square wave. That is less than the overhead of 'digitalWrite' at this clock rate, + * so no additional delays are needed yet. */ + + digitalWrite(Sm16716.pin_dat, (v != 0) ? HIGH : LOW); + //delayMicroseconds(1); + digitalWrite(Sm16716.pin_clk, HIGH); + //delayMicroseconds(1); + digitalWrite(Sm16716.pin_clk, LOW); +} + +void SM16716_SendByte(uint8_t v) +{ + uint8_t mask; + + for (mask = 0x80; mask; mask >>= 1) { + SM16716_SendBit(v & mask); + } +} + +void SM16716_Update(uint8_t duty_r, uint8_t duty_g, uint8_t duty_b) +{ + if (Sm16716.pin_sel < 99) { + bool should_enable = (duty_r | duty_g | duty_b); + if (!Sm16716.enabled && should_enable) { + DEBUG_DRIVER_LOG(PSTR(D_LOG_SM16716 "turning color on")); + Sm16716.enabled = true; + digitalWrite(Sm16716.pin_sel, HIGH); + // in testing I found it takes a minimum of ~380us to wake up the chip + // tested on a Merkury RGBW with an SM726EB + delayMicroseconds(1000); + SM16716_Init(); + } + else if (Sm16716.enabled && !should_enable) { + DEBUG_DRIVER_LOG(PSTR(D_LOG_SM16716 "turning color off")); + Sm16716.enabled = false; + digitalWrite(Sm16716.pin_sel, LOW); + } + } + DEBUG_DRIVER_LOG(PSTR(D_LOG_SM16716 "Update; rgb=%02x%02x%02x"), duty_r, duty_g, duty_b); + + // send start bit + SM16716_SendBit(1); + SM16716_SendByte(duty_r); + SM16716_SendByte(duty_g); + SM16716_SendByte(duty_b); + + // send a 'do it' pulse + // (if multiple chips are chained, each one processes the 1st '1rgb' 25-bit block and + // passes on the rest, right until the one starting with 0) + //SM16716_Init(); + SM16716_SendBit(0); + SM16716_SendByte(0); + SM16716_SendByte(0); + SM16716_SendByte(0); +} + +/* +bool SM16716_ModuleSelected(void) +{ + Sm16716.pin_clk = pin[GPIO_SM16716_CLK]; + Sm16716.pin_dat = pin[GPIO_SM16716_DAT]; + Sm16716.pin_sel = pin[GPIO_SM16716_SEL]; + DEBUG_DRIVER_LOG(PSTR(D_LOG_SM16716 "ModuleSelected; clk_pin=%d, dat_pin=%d)"), Sm16716.pin_clk, Sm16716.pin_dat); + return (Sm16716.pin_clk < 99) && (Sm16716.pin_dat < 99); +} +*/ + +void SM16716_Init(void) +{ + for (uint32_t t_init = 0; t_init < 50; ++t_init) { + SM16716_SendBit(0); + } +} + +/********************************************************************************************/ + +bool Sm16716SetChannels(void) +{ +/* + // handle any PWM pins, skipping the first 3 values for sm16716 + for (uint32_t i = 3; i < Light.subtype; i++) { + if (pin[GPIO_PWM1 +i-3] < 99) { + //AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION "Cur_Col%d 10 bits %d, Pwm%d %d"), i, cur_col[i], i+1, curcol); + analogWrite(pin[GPIO_PWM1 +i-3], bitRead(pwm_inverted, i-3) ? Settings.pwm_range - cur_col_10bits[i] : cur_col_10bits[i]); + } + } +*/ + // handle sm16716 update + uint8_t *cur_col = (uint8_t*)XdrvMailbox.data; + + SM16716_Update(cur_col[0], cur_col[1], cur_col[2]); + + return true; +} + +void Sm16716ModuleSelected(void) +{ + if ((pin[GPIO_SM16716_CLK] < 99) && (pin[GPIO_SM16716_DAT] < 99)) { + Sm16716.pin_clk = pin[GPIO_SM16716_CLK]; + Sm16716.pin_dat = pin[GPIO_SM16716_DAT]; + Sm16716.pin_sel = pin[GPIO_SM16716_SEL]; + +/* + // init PWM + for (uint32_t i = 0; i < Light.subtype; i++) { + Settings.pwm_value[i] = 0; // Disable direct PWM control + if (pin[GPIO_PWM1 +i] < 99) { + pinMode(pin[GPIO_PWM1 +i], OUTPUT); + } + } +*/ + + // init sm16716 + pinMode(Sm16716.pin_clk, OUTPUT); + digitalWrite(Sm16716.pin_clk, LOW); + + pinMode(Sm16716.pin_dat, OUTPUT); + digitalWrite(Sm16716.pin_dat, LOW); + + if (Sm16716.pin_sel < 99) { + pinMode(Sm16716.pin_sel, OUTPUT); + digitalWrite(Sm16716.pin_sel, LOW); + // no need to call SM16716_Init here, it will be called after sel goes HIGH + } else { + // no sel pin means you have an 'always on' chip, so init right away + SM16716_Init(); + } + + LightPwmOffset(LST_RGB); // Handle any PWM pins, skipping the first 3 color values for sm16716 + light_type += LST_RGB; // Add RGB to be controlled by sm16716 + light_flg = XLGT_03; + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: SM16716 Found")); + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xlgt03(uint8_t function) +{ + bool result = false; + + switch (function) { + case FUNC_SET_CHANNELS: + result = Sm16716SetChannels(); + break; + case FUNC_MODULE_INIT: + Sm16716ModuleSelected(); + break; + } + return result; +} + +#endif // USE_SM16716 +#endif // USE_LIGHT + diff --git a/sonoff/xlgt_04_sm2135.ino b/sonoff/xlgt_04_sm2135.ino new file mode 100644 index 000000000..21755d656 --- /dev/null +++ b/sonoff/xlgt_04_sm2135.ino @@ -0,0 +1,172 @@ +/* + xlgt_04_sm2135.ino - sm2135 five channel led support for Sonoff-Tasmota + + Copyright (C) 2019 Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_LIGHT +#ifdef USE_SM2135 +/*********************************************************************************************\ + * SM2135 RGBCW Led bulbs like some Action LSC SmartLed + * + * {"NAME":"LSC RGBCW LED","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18} +\*********************************************************************************************/ + +#define XLGT_04 4 + +#define SM2135_ADDR_MC 0xC0 // Max current register +#define SM2135_ADDR_CH 0xC1 // RGB or CW channel select register +#define SM2135_ADDR_R 0xC2 // Red color +#define SM2135_ADDR_G 0xC3 // Green color +#define SM2135_ADDR_B 0xC4 // Blue color +#define SM2135_ADDR_C 0xC5 // Cold +#define SM2135_ADDR_W 0xC6 // Warm + +#define SM2135_RGB 0x00 // RGB channel +#define SM2135_CW 0x80 // CW channel (Chip default) + +#define SM2135_10MA 0x00 +#define SM2135_15MA 0x01 +#define SM2135_20MA 0x02 // RGB max current (Chip default) +#define SM2135_25MA 0x03 +#define SM2135_30MA 0x04 // CW max current (Chip default) +#define SM2135_35MA 0x05 +#define SM2135_40MA 0x06 +#define SM2135_45MA 0x07 // Max value for RGB +#define SM2135_50MA 0x08 +#define SM2135_55MA 0x09 +#define SM2135_60MA 0x0A + +// RGB current CW current +const uint8_t SM2135_CURRENT = (SM2135_20MA << 4) | SM2135_10MA; + +struct SM2135 { + uint8_t clk = 0; + uint8_t data = 0; +} Sm2135; + +uint8_t Sm2135Write(uint8_t data) +{ + for (uint32_t i = 0; i < 8; i++) { + digitalWrite(Sm2135.clk, LOW); + digitalWrite(Sm2135.data, (data & 0x80)); + digitalWrite(Sm2135.clk, HIGH); + data = data << 1; + } + digitalWrite(Sm2135.clk, LOW); + digitalWrite(Sm2135.data, HIGH); + pinMode(Sm2135.data, INPUT); + digitalWrite(Sm2135.clk, HIGH); + uint8_t ack = digitalRead(Sm2135.data); + pinMode(Sm2135.data, OUTPUT); + return ack; +} + +void Sm2135Send(uint8_t *buffer, uint8_t size) +{ + digitalWrite(Sm2135.data, LOW); + for (uint32_t i = 0; i < size; i++) { + Sm2135Write(buffer[i]); + } + digitalWrite(Sm2135.clk, LOW); + digitalWrite(Sm2135.clk, HIGH); + digitalWrite(Sm2135.data, HIGH); +} + +/********************************************************************************************/ + +bool Sm2135SetChannels(void) +{ + uint8_t *cur_col = (uint8_t*)XdrvMailbox.data; + uint8_t data[6]; + + if ((0 == cur_col[0]) && (0 == cur_col[1]) && (0 == cur_col[2])) { + // No color so must be Cold/Warm +/* + if ((cur_col[3] + cur_col[4]) >= (1 * 256)) { + // Scale down to 255 total to fix max power usage of 9W (=40mA) + +// cur_col[3] >>= 1; // Divide by 2 +// cur_col[4] >>= 1; // Divide by 2 + } +*/ + data[0] = SM2135_ADDR_MC; + data[1] = SM2135_CURRENT; + data[2] = SM2135_CW; + Sm2135Send(data, 3); + delay(1); + data[0] = SM2135_ADDR_C; + data[1] = cur_col[4]; // Warm + data[2] = cur_col[3]; // Cold + Sm2135Send(data, 3); + } else { + // Color +/* + if ((cur_col[0] + cur_col[1] + cur_col[2]) >= (3 * 256)) { + // Scale down to 765 total to fix max power usage of 9W + // Currently not needed with setting 3 x 15mA = 45mA = 11W = 765 + } +*/ + data[0] = SM2135_ADDR_MC; + data[1] = SM2135_CURRENT; + data[2] = SM2135_RGB; + data[3] = cur_col[1]; // Green + data[4] = cur_col[0]; // Red + data[5] = cur_col[2]; // Blue + Sm2135Send(data, 6); + } + + return true; +} + +void Sm2135ModuleSelected(void) +{ + if ((pin[GPIO_SM2135_CLK] < 99) && (pin[GPIO_SM2135_DAT] < 99)) { + Sm2135.clk = pin[GPIO_SM2135_CLK]; + Sm2135.data = pin[GPIO_SM2135_DAT]; + + pinMode(Sm2135.data, OUTPUT); + digitalWrite(Sm2135.data, HIGH); + pinMode(Sm2135.clk, OUTPUT); + digitalWrite(Sm2135.clk, HIGH); + + light_type = LT_RGBWC; + light_flg = XLGT_04; + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: SM2135 Found")); + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xlgt04(uint8_t function) +{ + bool result = false; + + switch (function) { + case FUNC_SET_CHANNELS: + result = Sm2135SetChannels(); + break; + case FUNC_MODULE_INIT: + Sm2135ModuleSelected(); + break; + } + return result; +} + +#endif // USE_SM2135 +#endif // USE_LIGHT diff --git a/sonoff/xlgt_interface.ino b/sonoff/xlgt_interface.ino new file mode 100644 index 000000000..cb963dc5c --- /dev/null +++ b/sonoff/xlgt_interface.ino @@ -0,0 +1,114 @@ +/* + xlgt_interface.ino - Light driver interface support for Sonoff-Tasmota + + Copyright (C) 2019 Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_LIGHT + +#ifdef XFUNC_PTR_IN_ROM +bool (* const xlgt_func_ptr[])(uint8_t) PROGMEM = { // Light driver Function Pointers +#else +bool (* const xlgt_func_ptr[])(uint8_t) = { // Light driver Function Pointers +#endif + +#ifdef XLGT_01 + &Xlgt01, +#endif + +#ifdef XLGT_02 + &Xlgt02, +#endif + +#ifdef XLGT_03 + &Xlgt03, +#endif + +#ifdef XLGT_04 + &Xlgt04, +#endif + +#ifdef XLGT_05 + &Xlgt05, +#endif + +#ifdef XLGT_06 + &Xlgt06, +#endif + +#ifdef XLGT_07 + &Xlgt07, +#endif + +#ifdef XLGT_08 + &Xlgt08, +#endif + +#ifdef XLGT_09 + &Xlgt09, +#endif + +#ifdef XLGT_10 + &Xlgt10, +#endif + +#ifdef XLGT_11 + &Xlgt11, +#endif + +#ifdef XLGT_12 + &Xlgt12, +#endif + +#ifdef XLGT_13 + &Xlgt13, +#endif + +#ifdef XLGT_14 + &Xlgt14, +#endif + +#ifdef XLGT_15 + &Xlgt15, +#endif + +#ifdef XLGT_16 + &Xlgt16 +#endif +}; + +const uint8_t xlgt_present = sizeof(xlgt_func_ptr) / sizeof(xlgt_func_ptr[0]); // Number of drivers found + +uint8_t xlgt_active = 0; + +bool XlgtCall(uint8_t function) +{ + if (FUNC_MODULE_INIT == function) { + for (uint32_t x = 0; x < xlgt_present; x++) { + xlgt_func_ptr[x](function); + if (light_flg) { + xlgt_active = x; + return true; // Stop further driver investigation + } + } + } + else if (light_flg) { + return xlgt_func_ptr[xlgt_active](function); + } + return false; +} + +#endif // USE_LIGHT diff --git a/sonoff/xnrg_09_dds2382.ino b/sonoff/xnrg_09_dds2382.ino index b36a12d8f..590a60186 100644 --- a/sonoff/xnrg_09_dds2382.ino +++ b/sonoff/xnrg_09_dds2382.ino @@ -54,8 +54,10 @@ void Dds2382EverySecond(void) } else { Energy.data_valid[0] = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 - // SA FC BC EnergyTotal ExportActiv ImportActiv Volta Curre APowe RPowe PFact Frequ Crc-- + // 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 = ModBus register + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 = Buffer index + // SA FC BC EnergyTotal ExportActiv ImportActiv Volta Curre APowe RPowe PFact Frequ Crc-- = DDS238-2 ZN/S version 1 (#6384) + // SA FC BC EnergyTotal ExportActiv ImportActiv Volta Curre APowe RPowe PFact Frequ Crc-- = DDS238-2 ZN/S version 2 (#6531) Energy.voltage[0] = (float)((buffer[27] << 8) + buffer[28]) / 10.0; Energy.current[0] = (float)((buffer[29] << 8) + buffer[30]) / 100.0; @@ -63,9 +65,12 @@ void Dds2382EverySecond(void) Energy.reactive_power[0] = (float)((buffer[33] << 8) + buffer[34]); Energy.power_factor[0] = (float)((buffer[35] << 8) + buffer[36]) / 1000.0; // 1.00 Energy.frequency[0] = (float)((buffer[37] << 8) + buffer[38]) / 100.0; // 50.0 Hz - Energy.export_active = (float)((buffer[11] << 24) + (buffer[12] << 16) + (buffer[13] << 8) + buffer[14]) / 100.0; // 429496729.0 W -// float energy_total = (float)((buffer[3] << 24) + (buffer[4] << 16) + (buffer[5] << 8) + buffer[6]) / 100.0; // 429496729.0 W - float import_active = (float)((buffer[15] << 24) + (buffer[16] << 16) + (buffer[17] << 8) + buffer[18]) / 100.0; // 429496729.0 W + uint8_t offset = 11; + if (Settings.flag3.dds2382_model) { + offset = 19; + } + Energy.export_active = (float)((buffer[offset] << 24) + (buffer[offset +1] << 16) + (buffer[offset +2] << 8) + buffer[offset +3]) / 100.0; // 429496729.0 W + float import_active = (float)((buffer[offset +4] << 24) + (buffer[offset +5] << 16) + (buffer[offset +6] << 8) + buffer[offset +7]) / 100.0; // 429496729.0 W EnergyUpdateTotal(import_active, false); // 484.708 kWh } diff --git a/sonoff/xnrg_11_ddsu666.ino b/sonoff/xnrg_11_ddsu666.ino new file mode 100644 index 000000000..2f6dfbf36 --- /dev/null +++ b/sonoff/xnrg_11_ddsu666.ino @@ -0,0 +1,175 @@ +/* + xnrg_11_ddsu666.ino - Chint DDSU666-Modbus energy meter support for Sonoff-Tasmota + + Copyright (C) 2019 Pablo Zerón and Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_ENERGY_SENSOR +#ifdef USE_DDSU666 +/*********************************************************************************************\ + * Chint DDSU666 Modbus energy meter +\*********************************************************************************************/ + +#define XNRG_11 11 + +// can be user defined in my_user_config.h +#ifndef DDSU666_SPEED + #define DDSU666_SPEED 9600 // default DDSU66 Modbus address +#endif +// can be user defined in my_user_config.h +#ifndef DDSU666_ADDR + #define DDSU666_ADDR 1 // default DDSU66 Modbus address +#endif + +#include +TasmotaModbus *Ddsu666Modbus; + +const uint16_t Ddsu666_start_addresses[] { + 0x2000, // DDSU666_VOLTAGE [V] + 0x2002, // DDSU666_CURRENT [A] + 0x2004, // DDSU666_POWER [KW] + 0x2006, // DDSU666_REACTIVE_POWER [KVAR] + 0x200A, // DDSU666_POWER_FACTOR + 0x200E, // DDSU666_FREQUENCY [Hz] + 0X4000, // DDSU666_IMPORT_ACTIVE [kWh] + 0X400A, // DDSU666_EXPORT_ACTIVE [kWh] +}; + +struct DDSU666 { + float import_active = NAN; + uint8_t read_state = 0; + uint8_t send_retry = 0; +} Ddsu666; + +/*********************************************************************************************/ + +void DDSU666Every250ms(void) +{ + bool data_ready = Ddsu666Modbus->ReceiveReady(); + + if (data_ready) { + uint8_t buffer[14]; // At least 5 + (2 * 2) = 9 + + uint32_t error = Ddsu666Modbus->ReceiveBuffer(buffer, 2); + AddLogBuffer(LOG_LEVEL_DEBUG_MORE, buffer, Ddsu666Modbus->ReceiveCount()); + + if (error) { + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("SDM: Ddsu666 error %d"), error); + } else { + Energy.data_valid[0] = 0; + + // 0 1 2 3 4 5 6 7 8 + // SA FC BC Fh Fl Sh Sl Cl Ch + // 01 04 04 43 66 33 34 1B 38 = 230.2 Volt + float value; + ((uint8_t*)&value)[3] = buffer[3]; // Get float values + ((uint8_t*)&value)[2] = buffer[4]; + ((uint8_t*)&value)[1] = buffer[5]; + ((uint8_t*)&value)[0] = buffer[6]; + + switch(Ddsu666.read_state) { + case 0: + Energy.voltage[0] = value; // 230.2 V + break; + + case 1: + Energy.current[0] = value; // 1.260 A + break; + + case 2: + Energy.active_power[0] = value * 1000; // -196.3 W + break; + + case 3: + Energy.reactive_power[0] = value * 1000; // 92.2 + break; + + case 4: + Energy.power_factor[0] = value; // 0.91 + break; + + case 5: + Energy.frequency[0] = value; // 50.0 Hz + break; + + case 6: + Ddsu666.import_active = value; // 478.492 kWh + break; + + case 7: + Energy.export_active = value; // 6.216 kWh + break; + } + + Ddsu666.read_state++; + + if (Ddsu666.read_state == 8) { + Ddsu666.read_state = 0; + EnergyUpdateTotal(Ddsu666.import_active, true); // 484.708 kWh + } + } + } // end data ready + + if (0 == Ddsu666.send_retry || data_ready) { + Ddsu666.send_retry = 5; + Ddsu666Modbus->Send(DDSU666_ADDR, 0x04, Ddsu666_start_addresses[Ddsu666.read_state], 2); + } else { + Ddsu666.send_retry--; + } +} + +void Ddsu666SnsInit(void) +{ + Ddsu666Modbus = new TasmotaModbus(pin[GPIO_DDSU666_RX], pin[GPIO_DDSU666_TX]); + uint8_t result = Ddsu666Modbus->Begin(DDSU666_SPEED); + if (result) { + if (2 == result) { ClaimSerial(); } + } else { + energy_flg = ENERGY_NONE; + } +} + +void Ddsu666DrvInit(void) +{ + if ((pin[GPIO_DDSU666_RX] < 99) && (pin[GPIO_DDSU666_TX] < 99)) { + energy_flg = XNRG_11; + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xnrg11(uint8_t function) +{ + bool result = false; + + switch (function) { + case FUNC_EVERY_250_MSECOND: + if (uptime > 4) { DDSU666Every250ms(); } + break; + case FUNC_INIT: + Ddsu666SnsInit(); + break; + case FUNC_PRE_INIT: + Ddsu666DrvInit(); + break; + } + return result; +} + +#endif // USE_DDSU666 +#endif // USE_ENERGY_SENSOR diff --git a/sonoff/xsns_29_mcp230xx.ino b/sonoff/xsns_29_mcp230xx.ino index caefb67e8..0e9cc1039 100644 --- a/sonoff/xsns_29_mcp230xx.ino +++ b/sonoff/xsns_29_mcp230xx.ino @@ -628,15 +628,15 @@ bool MCP230xx_Command(void) { #ifdef USE_MCP230xx_OUTPUT if (Settings.mcp230xx_config[pin].pinmode >= 5) { uint8_t pincmd = Settings.mcp230xx_config[pin].pinmode - 5; - if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) { + if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "1"))) { MCP230xx_SetOutPin(pin,abs(pincmd-1)); return serviced; } - if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) { + if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "0"))) { MCP230xx_SetOutPin(pin,pincmd); return serviced; } - if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "T")) { + if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "T")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "2"))) { MCP230xx_SetOutPin(pin,2); return serviced; } @@ -655,9 +655,9 @@ bool MCP230xx_Command(void) { intmode = atoi(subStr(sub_string, XdrvMailbox.data, ",", 4)); } #ifdef USE_MCP230xx_OUTPUT - if ((pin < mcp230xx_pincount) && (pinmode > 0) && (pinmode < 7) && (pullup < 2)) { + if ((pin < mcp230xx_pincount) && (pinmode > 0) && (pinmode < 7) && (pullup < 2) && (paramcount > 2)) { #else // not use OUTPUT - if ((pin < mcp230xx_pincount) && (pinmode > 0) && (pinmode < 5) && (pullup < 2)) { + if ((pin < mcp230xx_pincount) && (pinmode > 0) && (pinmode < 5) && (pullup < 2) && (paramcount > 2)) { #endif // USE_MCP230xx_OUTPUT Settings.mcp230xx_config[pin].pinmode=pinmode; Settings.mcp230xx_config[pin].pullup=pullup; diff --git a/tools/decode-config.html b/tools/decode-config.html index 4dc80286b..d5cff4c3a 100644 --- a/tools/decode-config.html +++ b/tools/decode-config.html @@ -219,7 +219,7 @@ If you do not want using auto extensions use the --no-extension par [--cmnd-indent <indent>] [--cmnd-groups] [--cmnd-nogroups] [--cmnd-sort] [--cmnd-unsort] [-c <filename>] [-S] [-T json|cmnd|command] - [-g {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} ...]] + [-g {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} ...]] [--ignore-warnings] [-h] [-H] [-v] [-V] Backup/Restore Sonoff-Tasmota configuration data. Args that start with '--' @@ -299,7 +299,7 @@ Common: (default do not output on backup or restore usage) -T, --output-format json|cmnd|command display output format (default: 'json') - -g, --group {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} + -g, --group {Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} limit data processing to command groups (default no filter) --ignore-warnings do not exit on warnings. Not recommended, used by your diff --git a/tools/decode-config.md b/tools/decode-config.md index 01b20a143..883467dfa 100644 --- a/tools/decode-config.md +++ b/tools/decode-config.md @@ -237,7 +237,7 @@ For advanced help use `-H` or `--full-help`: [--cmnd-indent ] [--cmnd-groups] [--cmnd-nogroups] [--cmnd-sort] [--cmnd-unsort] [-c ] [-S] [-T json|cmnd|command] - [-g {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} ...]] + [-g {Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} ...]] [--ignore-warnings] [-h] [-H] [-v] [-V] Backup/Restore Sonoff-Tasmota configuration data. Args that start with '--' @@ -317,7 +317,7 @@ For advanced help use `-H` or `--full-help`: (default do not output on backup or restore usage) -T, --output-format json|cmnd|command display output format (default: 'json') - -g, --group {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} + -g, --group {Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} limit data processing to command groups (default no filter) --ignore-warnings do not exit on warnings. Not recommended, used by your diff --git a/tools/decode-config.py b/tools/decode-config.py index 7582a932b..36ace62dc 100755 --- a/tools/decode-config.py +++ b/tools/decode-config.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -VER = '2.3.0034' +VER = '2.3.0035' """ decode-config.py - Backup/Restore Sonoff-Tasmota configuration data @@ -43,7 +43,7 @@ Usage: decode-config.py [-f ] [-d ] [-P ] [--cmnd-indent ] [--cmnd-groups] [--cmnd-nogroups] [--cmnd-sort] [--cmnd-unsort] [-c ] [-S] [-T json|cmnd|command] - [-g {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} ...]] + [-g {Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} [{Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} ...]] [--ignore-warnings] [-h] [-H] [-v] [-V] Backup/Restore Sonoff-Tasmota configuration data. Args that start with '--' @@ -123,7 +123,7 @@ Usage: decode-config.py [-f ] [-d ] [-P ] (default do not output on backup or restore usage) -T, --output-format json|cmnd|command display output format (default: 'json') - -g, --group {Control,Devices,Display,Domoticz,Internal,KNX,Light,MQTT,Management,Power,Rules,Sensor,Serial,SetOption,SonoffRF,System,Timer,Wifi} + -g, --group {Control,Devices,Display,Domoticz,Internal,Knx,Light,Management,Mqtt,Power,Rules,Sensor,Serial,Setoption,Shutter,Sonoffrf,System,Timer,Wifi} limit data processing to command groups (default no filter) --ignore-warnings do not exit on warnings. Not recommended, used by your @@ -832,6 +832,9 @@ Setting_6_4_1_7['flag3'][0].update ({ }) # ====================================================================== Setting_6_4_1_8 = copy.deepcopy(Setting_6_4_1_7) +Setting_6_4_1_8.update ({ + 'my_gp': ('B', 0x484, ([17], None, ('Management', '"Gpio{} {}".format(#,$)')) ), + }) Setting_6_4_1_8['flag3'][0].update ({ 'split_interlock': ('