diff --git a/sonoff/i18n.h b/sonoff/i18n.h index 40312fc5c08b..66ee5e490913 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -49,6 +49,12 @@ #define D_JSON_COUNT "Count" #define D_JSON_COUNTER "Counter" #define D_JSON_CURRENT "Current" // As in Voltage and Current +#define D_JSON_PHASE_ANGLE "Phase angle" +#define D_JSON_IMPORT_ACTIVE "Import Active Power" +#define D_JSON_EXPORT_ACTIVE "Export Active Power" +#define D_JSON_IMPORT_REACTIVE "Import Reactive Power" +#define D_JSON_EXPORT_REACTIVE "Export Reactive Power" +#define D_JSON_TOTAL_REACTIVE "Total Reactive Power" #define D_JSON_DATA "Data" #define D_JSON_DISTANCE "Distance" #define D_JSON_DNSSERVER "DNSServer" diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h index 0707317f5194..9cad9f63f0ad 100644 --- a/sonoff/language/bg-BG.h +++ b/sonoff/language/bg-BG.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_BG_BG_H_ diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h index 49e0991bb326..ffd69a7146b8 100644 --- a/sonoff/language/cs-CZ.h +++ b/sonoff/language/cs-CZ.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_CS_CZ_H_ diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h index e497bcf4513e..69f12e56e8f2 100644 --- a/sonoff/language/de-DE.h +++ b/sonoff/language/de-DE.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_DE_DE_H_ diff --git a/sonoff/language/el-GR.h b/sonoff/language/el-GR.h index 591c7f414bac..bafc460c4634 100644 --- a/sonoff/language/el-GR.h +++ b/sonoff/language/el-GR.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_EL_GR_H_ diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h index aeb61103dcbb..4cb1d381e053 100644 --- a/sonoff/language/en-GB.h +++ b/sonoff/language/en-GB.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -594,4 +594,13 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_EN_GB_H_ diff --git a/sonoff/language/es-AR.h b/sonoff/language/es-AR.h index c90a20b09382..c0d8885a5b50 100644 --- a/sonoff/language/es-AR.h +++ b/sonoff/language/es-AR.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_ES_AR_H_ diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h index 78afd01d194f..b6dc5132fd77 100644 --- a/sonoff/language/fr-FR.h +++ b/sonoff/language/fr-FR.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_FR_FR_H_ diff --git a/sonoff/language/he-HE.h b/sonoff/language/he-HE.h index ea0e4c6df35e..2039683a4b3a 100644 --- a/sonoff/language/he-HE.h +++ b/sonoff/language/he-HE.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_HE_HE_H_ diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h index 0ac020605415..8fefbfa7d08a 100644 --- a/sonoff/language/hu-HU.h +++ b/sonoff/language/hu-HU.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_HU_HU_H_ diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h index 3dc9d811b0b3..da2f911076a9 100644 --- a/sonoff/language/it-IT.h +++ b/sonoff/language/it-IT.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_IT_IT_H_ diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h index e288e71960a5..c8a32a4632bf 100644 --- a/sonoff/language/nl-NL.h +++ b/sonoff/language/nl-NL.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_NL_NL_H_ diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h index f2ef0c05c748..2a26afa784a0 100644 --- a/sonoff/language/pl-PL.h +++ b/sonoff/language/pl-PL.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_PL_PL_D_H_ diff --git a/sonoff/language/pt-BR.h b/sonoff/language/pt-BR.h index 1c94a784d553..4bad901e7188 100644 --- a/sonoff/language/pt-BR.h +++ b/sonoff/language/pt-BR.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_PT_BR_H_ diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h index 5b1f778119f4..a0ec3643b7af 100644 --- a/sonoff/language/pt-PT.h +++ b/sonoff/language/pt-PT.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -594,4 +594,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_PT_PT_H_ diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h index 3d470bfddf45..ac7b5ea16982 100644 --- a/sonoff/language/ru-RU.h +++ b/sonoff/language/ru-RU.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Угол фазы" +#define D_IMPORT_ACTIVE "Импорт активной мощности" +#define D_EXPORT_ACTIVE "Экспорт активной мощности" +#define D_IMPORT_REACTIVE "Импорт реактивной мощности" +#define D_EXPORT_REACTIVE "Экспорт реактивной мощности" +#define D_TOTAL_REACTIVE "Итого реактивная мощность" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Град" + #endif // _LANGUAGE_RU_RU_H_ diff --git a/sonoff/language/tr-TR.h b/sonoff/language/tr-TR.h index fa9a41d181ad..cee31869ff40 100755 --- a/sonoff/language/tr-TR.h +++ b/sonoff/language/tr-TR.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_TR_TR_H_ diff --git a/sonoff/language/uk-UK.h b/sonoff/language/uk-UK.h index d6bb5e074090..281975c07053 100644 --- a/sonoff/language/uk-UK.h +++ b/sonoff/language/uk-UK.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_UK_UK_H_ diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h index 2f18d25814a7..f882765a5c35 100644 --- a/sonoff/language/zh-CN.h +++ b/sonoff/language/zh-CN.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_ZH_CN_H_ diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h index 0084fa038107..6a9b9bd52f4b 100644 --- a/sonoff/language/zh-TW.h +++ b/sonoff/language/zh-TW.h @@ -515,8 +515,8 @@ #define D_SENSOR_SBR_TX "SerBr Tx" #define D_SENSOR_SR04_TRIG "SR04 Tri" #define D_SENSOR_SR04_ECHO "SR04 Ech" -#define D_SENSOR_SDM120_TX "SDM120 Tx" -#define D_SENSOR_SDM120_RX "SDM120 Rx" +#define D_SENSOR_SDM120_TX "SDM120/220 Tx" +#define D_SENSOR_SDM120_RX "SDM120/220 Rx" #define D_SENSOR_SDM630_TX "SDM630 Tx" #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_TM1638_CLK "TM16 CLK" @@ -593,4 +593,14 @@ #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi +//SDM220 +#define D_PHASE_ANGLE "Phase Angle" +#define D_IMPORT_ACTIVE "Import Active" +#define D_EXPORT_ACTIVE "Export Active" +#define D_IMPORT_REACTIVE "Import Reactive" +#define D_EXPORT_REACTIVE "Export Reactive" +#define D_TOTAL_REACTIVE "Total Reactive" +#define D_UNIT_KWARH "kVArh" +#define D_UNIT_ANGLE "Deg" + #endif // _LANGUAGE_ZH_TW_H_ diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 043a81111026..24c35a91b1eb 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -356,6 +356,7 @@ #define USE_SERIAL_BRIDGE // Add support for software Serial Bridge (+0k8 code) //#define USE_SDM120 // Add support for Eastron SDM120-Modbus energy meter (+1k7 code) #define SDM120_SPEED 9600 // SDM120-Modbus RS485 serial speed (default: 2400 baud) + #define USE_SDM220 // add extra parameters for SDM220 (+0k1 code) //#define USE_SDM630 // Add support for Eastron SDM630-Modbus energy meter (+2k code) #define SDM630_SPEED 9600 // SDM630-Modbus RS485 serial speed (default: 9600 baud) //#define USE_MP3_PLAYER // Use of the DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop diff --git a/sonoff/xsns_23_sdm120.ino b/sonoff/xsns_23_sdm120.ino index a5d47ec67477..7ec23d55d80c 100644 --- a/sonoff/xsns_23_sdm120.ino +++ b/sonoff/xsns_23_sdm120.ino @@ -42,6 +42,12 @@ float sdm120_reactive_power = 0; float sdm120_power_factor = 0; float sdm120_frequency = 0; float sdm120_energy_total = 0; +float sdm120_phase_angle = 0; +float sdm120_import_active = 0; +float sdm120_export_active = 0; +float sdm120_import_reactive = 0; +float sdm120_export_reactive = 0; +float sdm120_total_reactive = 0; bool SDM120_ModbusReceiveReady(void) { @@ -131,7 +137,17 @@ const uint16_t sdm120_start_addresses[] { 0x0018, // SDM120C_REACTIVE_POWER [VAR] 0x001E, // SDM120C_POWER_FACTOR 0x0046, // SDM120C_FREQUENCY [Hz] +#ifdef USE_SDM220 + 0x0156, // SDM120C_TOTAL_ACTIVE_ENERGY [Wh] + 0X0024, // SDM220_PHASE_ANGLE [Degre] + 0X0048, // SDM220_IMPORT_ACTIVE [kWh] + 0X004A, // SDM220_EXPORT_ACTIVE [kWh] + 0X004C, // SDM220_IMPORT_REACTIVE [kVArh] + 0X004E, // SDM220_EXPORT_REACTIVE [kVArh] + 0X0158 // SDM220 TOTAL_REACTIVE [kVArh] +#else // USE_SDM220 0x0156 // SDM120C_TOTAL_ACTIVE_ENERGY [Wh] +#endif // USE_SDM220 }; uint8_t sdm120_read_state = 0; @@ -184,6 +200,31 @@ void SDM120250ms(void) // Every 250 mSec case 7: sdm120_energy_total = value; break; +#ifdef USE_SDM220 + case 8: + sdm120_phase_angle = value; + break; + + case 9: + sdm120_import_active = value; + break; + + case 10: + sdm120_export_active = value; + break; + + case 11: + sdm120_import_reactive = value; + break; + + case 12: + sdm120_export_reactive = value; + break; + + case 13: + sdm120_total_reactive = value; + break; +#endif // USE_SDM220 } // end switch sdm120_read_state++; @@ -228,7 +269,16 @@ const char HTTP_SNS_SDM120_DATA[] PROGMEM = "%s" "{s}SDM120 " D_POWERUSAGE_REACTIVE "{m}%s " D_UNIT_VAR "{e}" "{s}SDM120 " D_POWER_FACTOR "{m}%s{e}" "{s}SDM120 " D_FREQUENCY "{m}%s " D_UNIT_HERTZ "{e}" - "{s}SDM120 " D_ENERGY_TOTAL "{m}%s " D_UNIT_KILOWATTHOUR "{e}"; + "{s}SDM120 " D_ENERGY_TOTAL "{m}%s " D_UNIT_KILOWATTHOUR "{e}" +#ifdef USE_SDM220 + "{s}SDM120 " D_PHASE_ANGLE "{m}%s " D_UNIT_ANGLE "{e}" + "{s}SDM120 " D_IMPORT_ACTIVE "{m}%s " D_UNIT_KILOWATTHOUR "{e}" + "{s}SDM120 " D_EXPORT_ACTIVE "{m}%s " D_UNIT_KILOWATTHOUR "{e}" + "{s}SDM120 " D_IMPORT_REACTIVE "{m}%s " D_UNIT_KWARH "{e}" + "{s}SDM120 " D_EXPORT_REACTIVE "{m}%s " D_UNIT_KWARH "{e}" + "{s}SDM120 " D_TOTAL_REACTIVE "{m}%s " D_UNIT_KWARH "{e}" +#endif // USE_SDM220 + ; #endif // USE_WEBSERVER void SDM120Show(boolean json) @@ -241,19 +291,37 @@ void SDM120Show(boolean json) char power_factor[10]; char frequency[10]; char energy_total[10]; - - dtostrfd(sdm120_voltage, Settings.flag2.voltage_resolution, voltage); - dtostrfd(sdm120_current, Settings.flag2.current_resolution, current); - dtostrfd(sdm120_active_power, Settings.flag2.wattage_resolution, active_power); + char phase_angle[10]; + char import_active[10]; + char export_active[10]; + char import_reactive[10]; + char export_reactive[10]; + char total_reactive[10]; + + dtostrfd(sdm120_voltage, Settings.flag2.voltage_resolution, voltage); + dtostrfd(sdm120_current, Settings.flag2.current_resolution, current); + dtostrfd(sdm120_active_power, Settings.flag2.wattage_resolution, active_power); dtostrfd(sdm120_apparent_power, Settings.flag2.wattage_resolution, apparent_power); dtostrfd(sdm120_reactive_power, Settings.flag2.wattage_resolution, reactive_power); - dtostrfd(sdm120_power_factor, 2, power_factor); - dtostrfd(sdm120_frequency, Settings.flag2.frequency_resolution, frequency); - dtostrfd(sdm120_energy_total, Settings.flag2.energy_resolution, energy_total); - + dtostrfd(sdm120_power_factor, 2, power_factor); + dtostrfd(sdm120_frequency, Settings.flag2.frequency_resolution, frequency); + dtostrfd(sdm120_energy_total, Settings.flag2.energy_resolution, energy_total); +#ifdef USE_SDM220 + dtostrfd(sdm120_phase_angle, 2, phase_angle); + dtostrfd(sdm120_import_active, Settings.flag2.wattage_resolution, import_active); + dtostrfd(sdm120_export_active, Settings.flag2.wattage_resolution, export_active); + dtostrfd(sdm120_import_reactive,Settings.flag2.wattage_resolution, import_reactive); + dtostrfd(sdm120_export_reactive,Settings.flag2.wattage_resolution, export_reactive); + dtostrfd(sdm120_total_reactive, Settings.flag2.wattage_resolution, total_reactive); +#endif // USE_SDM220 if (json) { +#ifdef USE_SDM220 + snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_RSLT_ENERGY "\":{\"" D_JSON_TOTAL "\":%s,\"" D_JSON_ACTIVE_POWERUSAGE "\":%s,\"" D_JSON_APPARENT_POWERUSAGE "\":%s,\"" D_JSON_REACTIVE_POWERUSAGE "\":%s,\"" D_JSON_FREQUENCY "\":%s,\"" D_JSON_POWERFACTOR "\":%s,\"" D_JSON_VOLTAGE "\":%s,\"" D_JSON_CURRENT "\":%s,\"" D_JSON_PHASE_ANGLE "\":%s,\"" D_JSON_IMPORT_ACTIVE "\":%s,\"" D_JSON_EXPORT_ACTIVE "\":%s,\"" D_JSON_IMPORT_REACTIVE "\":%s,\"" D_JSON_EXPORT_REACTIVE "\":%s,\"" D_JSON_TOTAL_REACTIVE "\":%s}"), + mqtt_data, energy_total, active_power, apparent_power, reactive_power, frequency, power_factor, voltage, current, phase_angle, import_active, export_active, import_reactive, export_reactive, total_reactive); +#else snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_RSLT_ENERGY "\":{\"" D_JSON_TOTAL "\":%s,\"" D_JSON_ACTIVE_POWERUSAGE "\":%s,\"" D_JSON_APPARENT_POWERUSAGE "\":%s,\"" D_JSON_REACTIVE_POWERUSAGE "\":%s,\"" D_JSON_FREQUENCY "\":%s,\"" D_JSON_POWERFACTOR "\":%s,\"" D_JSON_VOLTAGE "\":%s,\"" D_JSON_CURRENT "\":%s}"), mqtt_data, energy_total, active_power, apparent_power, reactive_power, frequency, power_factor, voltage, current); +#endif // USE_SDM220 #ifdef USE_DOMOTICZ if (0 == tele_period) { DomoticzSensor(DZ_VOLTAGE, voltage); @@ -263,7 +331,11 @@ void SDM120Show(boolean json) #endif // USE_DOMOTICZ #ifdef USE_WEBSERVER } else { +#ifdef USE_SDM220 + snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_SDM120_DATA, mqtt_data, voltage, current, active_power, apparent_power, reactive_power, power_factor, frequency, energy_total, phase_angle,import_active,export_active,import_reactive,export_reactive,total_reactive); +#else snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_SDM120_DATA, mqtt_data, voltage, current, active_power, apparent_power, reactive_power, power_factor, frequency, energy_total); +#endif // USE_SDM220 #endif // USE_WEBSERVER } }