diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 42de29186..339ae2bfe 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -2,7 +2,8 @@ * Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name * Add Resolution property to Status 3 report providing previous SetOption second value property * Fix IR local echo - * Add user configuration of HLW8012 and HJL-01/BL0937 Energy Monitoring + * Add user configuration of HLW8012 and HJL-01/BL0937 Energy Monitoring as used in Sonoff S31, Pow Ra and many Tuya based devices + * Add user configuration of MCP39F501 Energy Monitoring as used in Shelly2 * * 6.4.1.13 20190130 * Add command SetOption36 to control boot loop default restoration (#4645, #5063) diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h index 4bd5344ba..3b0aa8a20 100644 --- a/sonoff/language/bg-BG.h +++ b/sonoff/language/bg-BG.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h index b66d3da1e..c7cfcd99f 100644 --- a/sonoff/language/cs-CZ.h +++ b/sonoff/language/cs-CZ.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h index 6915b364c..74be66eac 100644 --- a/sonoff/language/de-DE.h +++ b/sonoff/language/de-DE.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/el-GR.h b/sonoff/language/el-GR.h index cfb35f341..03bc7dc4e 100644 --- a/sonoff/language/el-GR.h +++ b/sonoff/language/el-GR.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h index 22b592387..249bb66c5 100644 --- a/sonoff/language/en-GB.h +++ b/sonoff/language/en-GB.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/es-AR.h b/sonoff/language/es-AR.h index 015c28493..19988b248 100644 --- a/sonoff/language/es-AR.h +++ b/sonoff/language/es-AR.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h index 045cb75c7..27623806d 100644 --- a/sonoff/language/fr-FR.h +++ b/sonoff/language/fr-FR.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/he-HE.h b/sonoff/language/he-HE.h index d46142dab..a4cee77c5 100644 --- a/sonoff/language/he-HE.h +++ b/sonoff/language/he-HE.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h index 130dbd99d..89adb73e6 100644 --- a/sonoff/language/hu-HU.h +++ b/sonoff/language/hu-HU.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h index 1e8cf8c93..7b0801056 100644 --- a/sonoff/language/it-IT.h +++ b/sonoff/language/it-IT.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h index 86746d8c0..6aa5ee7c3 100644 --- a/sonoff/language/nl-NL.h +++ b/sonoff/language/nl-NL.h @@ -549,6 +549,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h index a145bd610..fa38c7887 100644 --- a/sonoff/language/pl-PL.h +++ b/sonoff/language/pl-PL.h @@ -549,6 +549,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/pt-BR.h b/sonoff/language/pt-BR.h index fd22a8143..af3d10974 100644 --- a/sonoff/language/pt-BR.h +++ b/sonoff/language/pt-BR.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h index 33cd0ff81..e868601cb 100644 --- a/sonoff/language/pt-PT.h +++ b/sonoff/language/pt-PT.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h index 60c69b306..b7e079a76 100644 --- a/sonoff/language/ru-RU.h +++ b/sonoff/language/ru-RU.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/sk-SK.h b/sonoff/language/sk-SK.h index 678f98d0d..4b14e8c3d 100644 --- a/sonoff/language/sk-SK.h +++ b/sonoff/language/sk-SK.h @@ -549,6 +549,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/sv-SE.h b/sonoff/language/sv-SE.h index f7881fc71..fe8f4231b 100644 --- a/sonoff/language/sv-SE.h +++ b/sonoff/language/sv-SE.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/tr-TR.h b/sonoff/language/tr-TR.h index dff32eb18..a307f84f1 100755 --- a/sonoff/language/tr-TR.h +++ b/sonoff/language/tr-TR.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/uk-UK.h b/sonoff/language/uk-UK.h index 678817d9b..1ddea2efd 100644 --- a/sonoff/language/uk-UK.h +++ b/sonoff/language/uk-UK.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h index 8763f55fe..c362fd86a 100644 --- a/sonoff/language/zh-CN.h +++ b/sonoff/language/zh-CN.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h index 9cc3a6fd4..105ca749f 100644 --- a/sonoff/language/zh-TW.h +++ b/sonoff/language/zh-TW.h @@ -548,6 +548,11 @@ #define D_SENSOR_NRG_CF1 "HLWBL CF1" #define D_SENSOR_HLW_CF "HLW8012 CF" #define D_SENSOR_HJL_CF "BL0937 CF" +#define D_SENSOR_MCP39F5_TX "MCP39F5 Tx" +#define D_SENSOR_MCP39F5_RX "MCP39F5 Rx" +#define D_SENSOR_MCP39F5_RST "MCP39F5 Rst" +#define D_SENSOR_CSE7766_TX "CSE7766 Tx" +#define D_SENSOR_CSE7766_RX "CSE7766 Rx" #define D_SENSOR_SM16716_CLK "SM16716 CLK" #define D_SENSOR_SM16716_DAT "SM16716 DAT" #define D_SENSOR_SM16716_SEL "SM16716 SEL" diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index dca718dd7..561750a71 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -159,6 +159,9 @@ enum UserSelectablePins { GPIO_NRG_CF1, // HLW8012/HLJ-01 CF1 voltage / current GPIO_HLW_CF, // HLW8012 CF power GPIO_HJL_CF, // HJL-01/BL0937 CF power + GPIO_MCP39F5_TX, // MCP39F501 Serial interface (Shelly2) + GPIO_MCP39F5_RX, // MCP39F501 Serial interface (Shelly2) + GPIO_MCP39F5_RST, // MCP39F501 Reset (Shelly2) GPIO_SM16716_CLK, // SM16716 CLOCK GPIO_SM16716_DAT, // SM16716 DATA GPIO_SM16716_SEL, // SM16716 SELECT @@ -176,6 +179,8 @@ enum ProgramSelectablePins { GPIO_ARIRFRCV, // AliLux RF Receive input GPIO_ROT_A, // Rotary switch A Pin GPIO_ROT_B, // Rotary switch B Pin + GPIO_CSE7766_TX, // CSE7766 Serial interface (S31 and Pow R2) + GPIO_CSE7766_RX, // CSE7766 Serial interface (S31 and Pow R2) GPIO_USER, // User configurable GPIO_MAX }; @@ -224,6 +229,7 @@ const char kSensorNames[] PROGMEM = D_SENSOR_BUTTON "1i|" D_SENSOR_BUTTON "2i|" D_SENSOR_BUTTON "3i|" D_SENSOR_BUTTON "4i|" D_SENSOR_BUTTON "1in|" D_SENSOR_BUTTON "2in|" D_SENSOR_BUTTON "3in|" D_SENSOR_BUTTON "4in|" D_SENSOR_NRG_SEL "|" D_SENSOR_NRG_SEL "i|" D_SENSOR_NRG_CF1 "|" D_SENSOR_HLW_CF "|" D_SENSOR_HJL_CF "|" + D_SENSOR_MCP39F5_TX "|" D_SENSOR_MCP39F5_RX "|" D_SENSOR_MCP39F5_RST "|" D_SENSOR_SM16716_CLK "|" D_SENSOR_SM16716_DAT "|" D_SENSOR_SM16716_SEL ; @@ -471,21 +477,17 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_HX711_SCK, // HX711 Load Cell clock GPIO_HX711_DAT, // HX711 Load Cell data #endif -#ifdef USE_SERIAL_BRIDGE - GPIO_SBR_TX, // Serial Bridge Serial interface - GPIO_SBR_RX, // Serial Bridge Serial interface +#if defined(USE_ENERGY_SENSOR) && defined(USE_HLW8012) + GPIO_NRG_SEL, // HLW8012/HLJ-01 Sel output (1 = Voltage) + GPIO_NRG_SEL_INV, // HLW8012/HLJ-01 Sel output (0 = Voltage) + GPIO_NRG_CF1, // HLW8012/HLJ-01 CF1 voltage / current + GPIO_HLW_CF, // HLW8012 CF power + GPIO_HJL_CF, // HJL-01/BL0937 CF power #endif -#ifdef USE_MHZ19 - GPIO_MHZ_TXD, // MH-Z19 Serial interface - GPIO_MHZ_RXD, // MH-Z19 Serial interface -#endif -#ifdef USE_SENSEAIR - GPIO_SAIR_TX, // SenseAir Serial interface - GPIO_SAIR_RX, // SenseAir Serial interface -#endif -#ifdef USE_NOVA_SDS - GPIO_SDS0X1_TX, // Nova Fitness SDS011 Serial interface - GPIO_SDS0X1_RX, // Nova Fitness SDS011 Serial interface +#if defined(USE_ENERGY_SENSOR) && defined(USE_MCP39F501) + GPIO_MCP39F5_TX, // MCP39F501 Serial interface (Shelly2) + GPIO_MCP39F5_RX, // MCP39F501 Serial interface (Shelly2) + GPIO_MCP39F5_RST, // MCP39F501 Reset (Shelly2) #endif #if defined(USE_PZEM004T) || defined(USE_PZEM_AC) || defined(USE_PZEM_DC) GPIO_PZEM0XX_TX, // PZEM0XX Serial interface @@ -507,6 +509,22 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_SDM630_TX, // SDM630 Serial interface GPIO_SDM630_RX, // SDM630 Serial interface #endif +#ifdef USE_SERIAL_BRIDGE + GPIO_SBR_TX, // Serial Bridge Serial interface + GPIO_SBR_RX, // Serial Bridge Serial interface +#endif +#ifdef USE_MHZ19 + GPIO_MHZ_TXD, // MH-Z19 Serial interface + GPIO_MHZ_RXD, // MH-Z19 Serial interface +#endif +#ifdef USE_SENSEAIR + GPIO_SAIR_TX, // SenseAir Serial interface + GPIO_SAIR_RX, // SenseAir Serial interface +#endif +#ifdef USE_NOVA_SDS + GPIO_SDS0X1_TX, // Nova Fitness SDS011 Serial interface + GPIO_SDS0X1_RX, // Nova Fitness SDS011 Serial interface +#endif #ifdef USE_PMS5003 GPIO_PMS5003, // Plantower PMS5003 Serial interface #endif @@ -533,6 +551,11 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_MAX31855CLK, // MAX31855 Serial interface GPIO_MAX31855DO, // MAX31855 Serial interface #endif +#ifdef USE_SM16716 + GPIO_SM16716_CLK, // SM16716 CLOCK + GPIO_SM16716_DAT, // SM16716 DATA + GPIO_SM16716_SEL, // SM16716 SELECT +#endif // USE_SM16716 #if defined(USE_ENERGY_SENSOR) && defined(USE_HLW8012) GPIO_NRG_SEL, // HLW8012/HLJ-01 Sel output (1 = Voltage) GPIO_NRG_SEL_INV, // HLW8012/HLJ-01 Sel output (0 = Voltage) @@ -540,11 +563,6 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_HLW_CF, // HLW8012 CF power GPIO_HJL_CF, // HJL-01/BL0937 CF power #endif -#ifdef USE_SM16716 - GPIO_SM16716_CLK, // SM16716 CLOCK - GPIO_SM16716_DAT, // SM16716 DATA - GPIO_SM16716_SEL, // SM16716 SELECT -#endif // USE_SM16716 }; const uint8_t kModuleNiceList[MAXMODULE] PROGMEM = { @@ -1340,9 +1358,9 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { }, { "Sonoff S31", // Sonoff S31 (ESP8266 - CSE7766) GPIO_KEY1, // GPIO00 Button - 0, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor + GPIO_CSE7766_TX, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor 0, - 0, // GPIO03 Serial TXD + GPIO_CSE7766_RX, // GPIO03 Serial TXD 0, 0, // GPIO06 (SD_CLK Flash) // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT) @@ -1375,9 +1393,9 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { }, { "Sonoff Pow R2", // Sonoff Pow R2 (ESP8285 - CSE7766) GPIO_KEY1, // GPIO00 Button - 0, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor + GPIO_CSE7766_TX, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor 0, - 0, // GPIO03 Serial TXD + GPIO_CSE7766_RX, // GPIO03 Serial TXD 0, 0, // GPIO06 (SD_CLK Flash) // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT) @@ -1448,9 +1466,9 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { }, { "Shelly 2", // Shelly2 (ESP8266 - 2MB) - https://shelly.cloud/shelly2/ 0, - GPIO_TXD, // GPIO01 MCP39F501 Serial input + GPIO_MCP39F5_TX, // GPIO01 MCP39F501 Serial input 0, - GPIO_RXD, // GPIO03 MCP39F501 Serial output + GPIO_MCP39F5_RX, // GPIO03 MCP39F501 Serial output GPIO_REL1, // GPIO04 GPIO_REL2, // GPIO05 // GPIO06 (SD_CLK Flash) @@ -1462,7 +1480,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { GPIO_SWT1, // GPIO12 0, GPIO_SWT2, // GPIO14 - 0, // GPIO15 MCP39F501 Reset + GPIO_MCP39F5_RST, // GPIO15 MCP39F501 Reset 0, GPIO_FLAG_PULLUP // Allow input pull-up control }, diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index daf45be9f..51498abb4 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -864,7 +864,7 @@ void HandleModuleConfiguration(void) for (uint8_t i = 0; i < sizeof(cmodule); i++) { if (GPIO_USER == ValidGPIO(i, cmodule.io[i])) { snprintf_P(stemp, 3, PINS_WEMOS +i*2); - snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("