diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 38c4e4216..43cdcbd49 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -55,6 +55,7 @@ #define D_JSON_COUNT "Count" #define D_JSON_COUNTER "Counter" #define D_JSON_CURRENT "Current" // As in Voltage and Current +#define D_JSON_CURRENT_NEUTRAL "CurrentNeutral" #define D_JSON_DARKNESS "Darkness" #define D_JSON_DATA "Data" #define D_JSON_DEWPOINT "DewPoint" diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index c91946742..6e32c385a 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -77,6 +77,7 @@ #define D_COUNTER "Opnemer" #define D_CT_POWER "CT Power" #define D_CURRENT "Stroom" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Donker" #define D_DEBUG "Ontfout" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 4682cf4c9..bea5e6c93 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -77,6 +77,7 @@ #define D_COUNTER "Брояч" #define D_CT_POWER "CT Power" #define D_CURRENT "Ток" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Данни" #define D_DARKLIGHT "Тъмна" #define D_DEBUG "Дебъгване" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 8883ee9ab..9579d6c79 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -77,6 +77,7 @@ #define D_COUNTER "Počítadlo" #define D_CT_POWER "CT Power" #define D_CURRENT "Proud" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Tmavý" #define D_DEBUG "Debug" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 2662df419..c74065b05 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -77,6 +77,7 @@ #define D_COUNTER "Zähler" #define D_CT_POWER "CT Power" #define D_CURRENT "Strom" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Daten" #define D_DARKLIGHT "dunkel" #define D_DEBUG "debug" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 9bece2add..1c6f9065e 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -77,6 +77,7 @@ #define D_COUNTER "Μετρητής" #define D_CT_POWER "CT Power" #define D_CURRENT "Ένταση" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Δεδομένα" #define D_DARKLIGHT "Σκοτεινό" #define D_DEBUG "Debug" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 388c0ab52..17322f588 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -77,6 +77,7 @@ #define D_COUNTER "Counter" #define D_CT_POWER "CT Power" #define D_CURRENT "Current" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Dark" #define D_DEBUG "Debug" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 32634dc83..b1c99b712 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -77,6 +77,7 @@ #define D_COUNTER "Contador" #define D_CT_POWER "CT Power" #define D_CURRENT "Corriente" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Datos" #define D_DARKLIGHT "Oscuro" #define D_DEBUG "Debug" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index 0fb67543f..57dde5fd6 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -77,6 +77,7 @@ #define D_COUNTER "Compteur" #define D_CT_POWER "CT Power" #define D_CURRENT "Courant" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Donnée" #define D_DARKLIGHT "Sombre" #define D_DEBUG "Debug" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 2ff6e3943..0c2cfa48a 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -77,6 +77,7 @@ #define D_COUNTER "Teller" #define D_CT_POWER "CT Power" #define D_CURRENT "Streame" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Tsjuster" #define D_DEBUG "Debugearje" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index aba134263..0ceee1826 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -77,6 +77,7 @@ #define D_COUNTER "מונה" #define D_CT_POWER "CT Power" #define D_CURRENT "נוכחי" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "נתונים" #define D_DARKLIGHT "חושך" #define D_DEBUG "באגים" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 9aafe19a8..16e4b66b1 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -77,6 +77,7 @@ #define D_COUNTER "Számláló" #define D_CT_POWER "CT erősség" #define D_CURRENT "Áramerősség" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Adat" #define D_DARKLIGHT "Min. fényerő" #define D_DEBUG "Debug" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 0abb6aeb8..83224973a 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -77,6 +77,7 @@ #define D_COUNTER "Contatore" #define D_CT_POWER "Alimentazione CT" #define D_CURRENT "Corrente" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Corrente Neutrale" #define D_DATA "Dati" #define D_DARKLIGHT "Scuro" #define D_DEBUG "Debug" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index a17d10c1d..ba019032a 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -77,6 +77,7 @@ #define D_COUNTER "Counter" #define D_CT_POWER "CT Power" #define D_CURRENT "전류" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "어둡게" #define D_DEBUG "디버그" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index d851cd1ca..47338d14f 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -77,6 +77,7 @@ #define D_COUNTER "Teller" #define D_CT_POWER "CT Power" #define D_CURRENT "Stroom" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Donker" #define D_DEBUG "Debug" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index 4e4767487..39f51bf3d 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -77,6 +77,7 @@ #define D_COUNTER "Licznik" #define D_CT_POWER "Moc CT" #define D_CURRENT "Prąd" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Ciemny" #define D_DEBUG "Debug" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index b528f1558..3ae74fa20 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -77,6 +77,7 @@ #define D_COUNTER "Contador" #define D_CT_POWER "Carga CT" #define D_CURRENT "Corrente" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Dados" #define D_DARKLIGHT "Luz escura" #define D_DEBUG "Depurar" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 15338c72e..9fc8cfa78 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -77,6 +77,7 @@ #define D_COUNTER "Contador" #define D_CT_POWER "CT Power" #define D_CURRENT "Corrente" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Dados" #define D_DARKLIGHT "Luz Escura" #define D_DEBUG "Depurar" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 1eaa121e9..4328e7c22 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -77,6 +77,7 @@ #define D_COUNTER "Contor" #define D_CT_POWER "Putere Transformată" #define D_CURRENT "Curent" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Date" #define D_DARKLIGHT "Întunecat" #define D_DEBUG "Depanare" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index c95980d39..bc5e258f0 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -77,6 +77,7 @@ #define D_COUNTER "Счетчик" #define D_CT_POWER "CT Power" #define D_CURRENT "Ток" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Данные" #define D_DARKLIGHT "Темный" #define D_DEBUG "Отладка" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 6a2f61692..04b071f5f 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -77,6 +77,7 @@ #define D_COUNTER "Počítadlo" #define D_CT_POWER "CT Power" #define D_CURRENT "Prúd" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Dáta" #define D_FLOW_RATE "Flow rate" #define D_DARKLIGHT "Tmavý" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 2191b6f0f..d1a5b2ff0 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -77,6 +77,7 @@ #define D_COUNTER "Räknare" #define D_CT_POWER "CT Power" #define D_CURRENT "Ström" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Mörkt" #define D_DEBUG "Debug" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 6acb99109..d08f78e59 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -77,6 +77,7 @@ #define D_COUNTER "Sayaç" #define D_CT_POWER "CT Power" #define D_CURRENT "Current" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Data" #define D_DARKLIGHT "Karanlık" #define D_DEBUG "Hata Ayıklama" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 791a73ac4..e4aec74b5 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -77,6 +77,7 @@ #define D_COUNTER "Лічильник" #define D_CT_POWER "CT Power" #define D_CURRENT "Струм" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Дані" #define D_DARKLIGHT "Темний" #define D_DEBUG "Налагодження" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index e9f1791be..017d1dd3c 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -77,6 +77,7 @@ #define D_COUNTER "Bộ đếm" #define D_CT_POWER "CT Power" #define D_CURRENT "Dòng điện" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "Dữ liệu" #define D_DARKLIGHT "Tối" #define D_DEBUG "Tìm lỗi" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 8a09fb79c..1458a367b 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -77,6 +77,7 @@ #define D_COUNTER "计数器" #define D_CT_POWER "CT Power" #define D_CURRENT "电流" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "数据:" #define D_DARKLIGHT "暗" #define D_DEBUG "调试" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 7233a2399..393588553 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -77,6 +77,7 @@ #define D_COUNTER "Counter" #define D_CT_POWER "CT Power" #define D_CURRENT "電流" // As in Voltage and Current +#define D_CURRENT_NEUTRAL "Current Neutral" #define D_DATA "數據:" #define D_DARKLIGHT "暗光" #define D_DEBUG "偵錯" diff --git a/tasmota/xdrv_03_energy.ino b/tasmota/xdrv_03_energy.ino index 449d70b0f..018e3c2ff 100644 --- a/tasmota/xdrv_03_energy.ino +++ b/tasmota/xdrv_03_energy.ino @@ -853,8 +853,8 @@ void CmndModuleAddress(void) { void CmndEnergyConfig(void) { Energy.command_code = CMND_ENERGYCONFIG; + ResponseClear(); if (XnrgCall(FUNC_COMMAND)) { - ResponseClear(); if (!ResponseLength()) { ResponseCmndDone(); } diff --git a/tasmota/xnrg_23_ade7880.ino b/tasmota/xnrg_23_ade7880.ino index 48cfbc6c2..b77a1fcf9 100644 --- a/tasmota/xnrg_23_ade7880.ino +++ b/tasmota/xnrg_23_ade7880.ino @@ -36,6 +36,8 @@ /*********************************************************************************************/ +#define ADE7880_MORE_REGS // Add Neutral Current information + //#define ADE7880_DEBUG //#define ADE7880_PROFILING @@ -252,6 +254,7 @@ enum Ade7880PowerQualityRegisters { }; struct Ade7880 { + float neutral_current; int32_t calib_current[4]; int32_t calib_voltage[3]; int32_t calib_acpower[3]; @@ -483,6 +486,7 @@ void Ade7880Cycle(void) { Ade7880.cycle_count--; return; // Skip first cycles } + Ade7880.neutral_current = (float)Ade7880ReadVerify(ADE7880_NIRMS) / 100000; // 0x43C6 for (uint32_t phase = 0; phase < 3; phase++) { Energy.data_valid[phase] = 0; Energy.voltage[phase] = (float)Ade7880ReadVerify(ADE7880_AVRMS + (phase * 2)) / 10000; // 0x43C1 - 0x0024CC94 = 241.1668 V @@ -681,6 +685,29 @@ bool Ade7880Command(void) { return serviced; } +/*********************************************************************************************\ + * Show +\*********************************************************************************************/ + +#ifdef ADE7880_MORE_REGS +#ifdef USE_WEBSERVER +const char HTTP_ADE7880_CURRENT[] PROGMEM = "{s}" D_CURRENT_NEUTRAL "{m}%s " D_UNIT_AMPERE "{e}"; +#endif // USE_WEBSERVER + +void Ade7880Show(bool json) { + char value_chr[TOPSZ]; + + if (json) { + ResponseAppend_P(PSTR(",\"" D_JSON_CURRENT_NEUTRAL "\":%s"), + EnergyFormat(value_chr, &Ade7880.neutral_current, Settings->flag2.current_resolution, 1)); +#ifdef USE_WEBSERVER + } else { + WSContentSend_PD(HTTP_ADE7880_CURRENT, WebEnergyFormat(value_chr, &Ade7880.neutral_current, Settings->flag2.current_resolution, 1)); +#endif // USE_WEBSERVER + } +} +#endif // ADE7880_MORE_REGS + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -694,6 +721,22 @@ bool Xnrg23(uint8_t function) { case FUNC_LOOP: if (Ade7880.irq0_state) { Ade7880Service0(); } break; +#ifdef ADE7880_MORE_REGS + case FUNC_JSON_APPEND: + Ade7880Show(1); + break; +#ifdef USE_WEBSERVER +#ifdef USE_ENERGY_COLUMN_GUI + case FUNC_WEB_COL_SENSOR: + Ade7880Show(0); + break; +#else // not USE_ENERGY_COLUMN_GUI + case FUNC_WEB_SENSOR: + Ade7880Show(0); + break; +#endif // USE_ENERGY_COLUMN_GUI +#endif // USE_WEBSERVER +#endif // ADE7880_MORE_REGS case FUNC_COMMAND: result = Ade7880Command(); break;