From 59d2a2b2146cf79cd15a2601446cf9f60c188670 Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 18:25:25 +0100 Subject: [PATCH 01/10] Calculations for CT based current measurement Implements calculations for CT based current measurement. ADC peak peak range is calculated over 32 samples and this is converted to an RMS current reading using adc_param2 as a scaling factor Power is calculated using current as above and a voltage provided via adc_param3 adc_param1 allows display of current (0), power (1), both (2) or none (> 2). --- tasmota/i18n.h | 8 ++- tasmota/tasmota_template.h | 4 +- tasmota/xsns_02_analog.ino | 114 +++++++++++++++++++++++++++++++++++-- 3 files changed, 117 insertions(+), 9 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 5de4b7a1dd20..b808bb8fdf5b 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -110,7 +110,7 @@ #define D_JSON_POWERUSAGE "Power" #define D_JSON_ACTIVE_POWERUSAGE "ActivePower" #define D_JSON_APPARENT_POWERUSAGE "ApparentPower" -#define D_JSON_REACTIVE_POWERUSAGE "ReactivePower" +#define D_JSON_REACTIVE_D_SNSUSAGE "ReactivePower" #define D_JSON_PRESSURE "Pressure" #define D_JSON_PRESSUREATSEALEVEL "SeaPressure" #define D_JSON_PRESSURE_UNIT "PressureUnit" @@ -569,6 +569,9 @@ const char JSON_SNS_ILLUMINANCE[] PROGMEM = ",\"%s\":{\"" D_JSON_ILLUMINANCE "\" const char JSON_SNS_GNGPM[] PROGMEM = ",\"%s\":{\"" D_JSON_TOTAL_USAGE "\":%s,\"" D_JSON_FLOWRATE "\":%s}"; +const char JSON_SNS_CURRENT[] PROGMEM = ",\"%s\":{\"" D_JSON_CURRENT "\":%s}"; +const char JSON_SNS_POWER[] PROGMEM = ",\"%s\":{\"" D_JSON_POWERUSAGE "\":%d}"; + const char S_LOG_I2C_FOUND_AT[] PROGMEM = D_LOG_I2C "%s " D_FOUND_AT " 0x%x"; const char S_LOG_HTTP[] PROGMEM = D_LOG_HTTP; @@ -595,6 +598,9 @@ const char HTTP_SNS_CO2[] PROGMEM = "{s}%s " D_CO2 "{m}%d " D_UNIT_PARTS_PER_MIL const char HTTP_SNS_CO2EAVG[] PROGMEM = "{s}%s " D_ECO2 "{m}%d " D_UNIT_PARTS_PER_MILLION "{e}"; // {s} = , {m} = , {e} = const char HTTP_SNS_GALLONS[] PROGMEM = "{s}%s " D_TOTAL_USAGE "{m}%s " D_UNIT_GALLONS " {e}"; // {s} = , {m} = , {e} = const char HTTP_SNS_GPM[] PROGMEM = "{s}%s " D_FLOW_RATE "{m}%s " D_UNIT_GALLONS_PER_MIN" {e}"; // {s} = , {m} = , {e} = +const char HTTP_SNS_CURRENT[] PROGMEM = "{s}%s " D_CURRENT "{m}%s " D_UNIT_AMPERE "{e}"; // {s} = , {m} = , {e} = +const char HTTP_SNS_POWER[] PROGMEM = "{s}%s " D_POWERUSAGE "{m}%d " D_UNIT_WATT "{e}"; // {s} = , {m} = , {e} = + const char S_MAIN_MENU[] PROGMEM = D_MAIN_MENU; const char S_CONFIGURATION[] PROGMEM = D_CONFIGURATION; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 5556629f911f..9c06af90a978 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -308,6 +308,7 @@ enum UserSelectableAdc0 { ADC0_LIGHT, // Light sensor ADC0_BUTTON, // Button ADC0_BUTTON_INV, + ADC0_CT_POWER, // Apparrent power using current transformer // ADC0_SWITCH, // Switch // ADC0_SWITCH_INV, ADC0_END }; @@ -323,6 +324,7 @@ const char kAdc0Names[] PROGMEM = D_SENSOR_NONE "|" D_ANALOG_INPUT "|" D_TEMPERATURE "|" D_LIGHT "|" D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" + D_SENSOR_CT_POWER "|" // D_SENSOR_SWITCH "|" D_SENSOR_SWITCH "i|" ; @@ -628,10 +630,8 @@ const uint8_t kGpioNiceList[] PROGMEM = { #if defined(USE_I2C) && defined(USE_ADE7953) GPIO_ADE7953_IRQ, // ADE7953 IRQ #endif -#ifdef USE_CSE7766 GPIO_CSE7766_TX, // CSE7766 Serial interface (S31 and Pow R2) GPIO_CSE7766_RX, // CSE7766 Serial interface (S31 and Pow R2) -#endif #ifdef USE_MCP39F501 GPIO_MCP39F5_TX, // MCP39F501 Serial interface (Shelly2) GPIO_MCP39F5_RX, // MCP39F501 Serial interface (Shelly2) diff --git a/tasmota/xsns_02_analog.ino b/tasmota/xsns_02_analog.ino index 1a4bc090b2c8..8279bb4c3583 100644 --- a/tasmota/xsns_02_analog.ino +++ b/tasmota/xsns_02_analog.ino @@ -47,8 +47,21 @@ #define ANALOG_LDR_LUX_CALC_SCALAR 12518931 // Experimental #define ANALOG_LDR_LUX_CALC_EXPONENT -1.4050 // Experimental +// CT Based Apparrent Power Measurement Parameters +// 3V3 --- R1 ----v--- R1 --- Gnd +// | +// CT+ CT- +// | +// ADC0 +// Default settings for a 20A/1V Current Transformer. Analog peak to peak range is measured and converted to RMS current using ANALOG_CT_MULTIPLIER +#define ANALOG_CT_CURRENT_OR_POWER 2 // (uint32_t) 0 for current, 1 for power, 2 for both, 3 or other for none +#define ANALOG_CT_MULTIPLIER 2146 // (uint32_t) Multiplier*100000 to convert raw ADC peak to peak range 0..1023 to RMS current in Amps +#define ANALOG_CT_VOLTAGE 2300 // (int) Convert current in Amps to apparrent power in Watts using voltage in Volts*10 + uint16_t adc_last_value = 0; float adc_temp = 0; +float adc_amps = 0; +uint16_t adc_watts = 0; void AdcInit(void) { @@ -66,6 +79,12 @@ void AdcInit(void) Settings.adc_param2 = ANALOG_LDR_LUX_CALC_SCALAR; Settings.adc_param3 = ANALOG_LDR_LUX_CALC_EXPONENT * 10000; } + else if (ADC0_CT_POWER == my_adc0) { + Settings.adc_param_type = ADC0_CT_POWER; + Settings.adc_param1 = ANALOG_CT_CURRENT_OR_POWER; //(uint32_t) 0 + Settings.adc_param2 = ANALOG_CT_MULTIPLIER; //(uint32_t) 100000 + Settings.adc_param3 = ANALOG_CT_VOLTAGE; //(int) 10 + } } } @@ -80,12 +99,44 @@ uint16_t AdcRead(uint8_t factor) uint16_t analog = 0; for (uint32_t i = 0; i < samples; i++) { analog += analogRead(A0); + delay(1); } analog >>= factor; return analog; } +void AdcGetCurrentPower(uint8_t factor) +{ + // factor 1 = 2 samples + // factor 2 = 4 samples + // factor 3 = 8 samples + // factor 4 = 16 samples + // factor 5 = 32 samples + uint8_t samples = 1 << factor; + uint16_t analog = 0; + uint16_t analog_min = 1023; + uint16_t analog_max = 0; + for (uint32_t i = 0; i < samples; i++) { + analog = analogRead(A0); + if (analog < analog_min) { + analog_min=analog; + } + if (analog > analog_max) { + analog_max=analog; + } + + delay(1); + } + + adc_amps=(float)(analog_max-analog_min)*((float)(Settings.adc_param2)/100000); + adc_watts=(uint16_t)(adc_amps*((float)(Settings.adc_param3)/10)); + //adc_amps=(float)(analog_max-analog_min); + //adc_watts=(uint16_t)adc_amps; + + return; +} + #ifdef USE_RULES void AdcEvery250ms(void) { @@ -122,6 +173,8 @@ void AdcEverySecond(void) double BC = (double)Settings.adc_param3 / 10000; double T = BC / (BC / ANALOG_T0 + TaylorLog(Rt / (double)Settings.adc_param2)); adc_temp = ConvertTemp(TO_CELSIUS(T)); + } else if (ADC0_CT_POWER == my_adc0) { + AdcGetCurrentPower(5); } } @@ -176,6 +229,39 @@ void AdcShow(bool json) #endif // USE_WEBSERVER } } + else if (ADC0_CT_POWER == my_adc0 && ( Settings.adc_param1 < 3) ) { + AdcGetCurrentPower(5); + if ( (Settings.adc_param1 == 0) || (Settings.adc_param1 == 2) ){ + char current[33]; + dtostrfd(adc_amps, Settings.flag2.current_resolution, current); + if (json) { + ResponseAppend_P(JSON_SNS_CURRENT, "ANALOG", current); +#ifdef USE_DOMOTICZ + if (0 == tele_period) { + DomoticzSensor(DZ_CURRENT, current); + } +#endif // USE_DOMOTICZ +#ifdef USE_WEBSERVER + } else { + WSContentSend_PD(HTTP_SNS_CURRENT, "", current, D_UNIT_AMPERE); +#endif // USE_WEBSERVER + } + } + if ( (Settings.adc_param1 == 1) || (Settings.adc_param1 == 2) ){ + if (json) { + ResponseAppend_P(JSON_SNS_POWER, "ANALOG", adc_watts); +#ifdef USE_DOMOTICZ + if (0 == tele_period) { + DomoticzSensor(DZ_POWER_ENERGY, adc_watts); + } +#endif // USE_DOMOTICZ +#ifdef USE_WEBSERVER + } else { + WSContentSend_PD(HTTP_SNS_POWER, "", adc_watts, D_UNIT_WATT); +#endif // USE_WEBSERVER + } + } + } } /*********************************************************************************************\ @@ -186,8 +272,8 @@ void AdcShow(bool json) const char kAdcCommands[] PROGMEM = "|" // No prefix D_CMND_ADC "|" D_CMND_ADCS "|" D_CMND_ADCPARAM; -void (* const AdcCommand[])(void) PROGMEM = { - &CmndAdc, &CmndAdcs, &CmndAdcParam }; +void (* const AdcCommand[])(void) PROGMEM = + { &CmndAdc, &CmndAdcs, &CmndAdcParam }; void CmndAdc(void) { @@ -217,7 +303,7 @@ void CmndAdcs(void) void CmndAdcParam(void) { if (XdrvMailbox.data_len) { - if ((ADC0_TEMP == XdrvMailbox.payload) || (ADC0_LIGHT == XdrvMailbox.payload)) { + if ((ADC0_TEMP == XdrvMailbox.payload) || (ADC0_LIGHT == XdrvMailbox.payload) ) { // if ((XdrvMailbox.payload == my_adc0) && ((ADC0_TEMP == my_adc0) || (ADC0_LIGHT == my_adc0))) { if (strstr(XdrvMailbox.data, ",") != nullptr) { // Process parameter entry char sub_string[XdrvMailbox.data_len +1]; @@ -228,7 +314,24 @@ void CmndAdcParam(void) Settings.adc_param1 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 2), nullptr, 10); Settings.adc_param2 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 3), nullptr, 10); Settings.adc_param3 = (int)(CharToFloat(subStr(sub_string, XdrvMailbox.data, ",", 4)) * 10000); - } else { // Set default values based on current adc type + } else { // Set default values based on current adc type + // AdcParam 2 + // AdcParam 3 + Settings.adc_param_type = 0; + AdcInit(); + } + } else if (ADC0_CT_POWER == XdrvMailbox.payload) { + // if ((XdrvMailbox.payload == my_adc0) && ((ADC0_TEMP == my_adc0) || (ADC0_LIGHT == my_adc0))) { + if (strstr(XdrvMailbox.data, ",") != nullptr) { // Process parameter entry + char sub_string[XdrvMailbox.data_len +1]; + // AdcParam 2, 32000, 10000, 3350 + // AdcParam 3, 10000, 12518931, -1.405 + Settings.adc_param_type = XdrvMailbox.payload; + // Settings.adc_param_type = my_adc0; + Settings.adc_param1 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 2), nullptr, 10); + Settings.adc_param2 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 3), nullptr, 10); + Settings.adc_param3 = (int)(CharToFloat(subStr(sub_string, XdrvMailbox.data, ",", 4))); + } else { // Set default values based on current adc type // AdcParam 2 // AdcParam 3 Settings.adc_param_type = 0; @@ -236,7 +339,6 @@ void CmndAdcParam(void) } } } - // AdcParam int value = Settings.adc_param3; uint8_t precision; @@ -263,7 +365,7 @@ bool Xsns02(uint8_t function) result = DecodeCommand(kAdcCommands, AdcCommand); break; default: - if ((ADC0_INPUT == my_adc0) || (ADC0_TEMP == my_adc0) || (ADC0_LIGHT == my_adc0)) { + if ((ADC0_INPUT == my_adc0) || (ADC0_TEMP == my_adc0) || (ADC0_LIGHT == my_adc0) || (ADC0_CT_POWER == my_adc0)) { switch (function) { #ifdef USE_RULES case FUNC_EVERY_250_MSECOND: From 1c199a6eabd1e260dea4d3778bb8109b7b32c32a Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 18:28:58 +0100 Subject: [PATCH 02/10] Updated comments for CT based power measurement Updated comments for scaling factors --- tasmota/xsns_02_analog.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xsns_02_analog.ino b/tasmota/xsns_02_analog.ino index 8279bb4c3583..c5b116e89389 100644 --- a/tasmota/xsns_02_analog.ino +++ b/tasmota/xsns_02_analog.ino @@ -55,8 +55,8 @@ // ADC0 // Default settings for a 20A/1V Current Transformer. Analog peak to peak range is measured and converted to RMS current using ANALOG_CT_MULTIPLIER #define ANALOG_CT_CURRENT_OR_POWER 2 // (uint32_t) 0 for current, 1 for power, 2 for both, 3 or other for none -#define ANALOG_CT_MULTIPLIER 2146 // (uint32_t) Multiplier*100000 to convert raw ADC peak to peak range 0..1023 to RMS current in Amps -#define ANALOG_CT_VOLTAGE 2300 // (int) Convert current in Amps to apparrent power in Watts using voltage in Volts*10 +#define ANALOG_CT_MULTIPLIER 2146 // (uint32_t) Multiplier*100000 to convert raw ADC peak to peak range 0..1023 to RMS current in Amps. Value of 100000 corresponds to 1 +#define ANALOG_CT_VOLTAGE 2300 // (int) Convert current in Amps to apparrent power in Watts using voltage in Volts*10. Value of 2200 corresponds to 220V uint16_t adc_last_value = 0; float adc_temp = 0; From 421812ab1a53baaeb2359021f0dc942acfd4fe83 Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 18:37:05 +0100 Subject: [PATCH 03/10] Aligning with latest dev From cb714947775e45f2951464b4f168c69ae7f1164b Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 18:38:01 +0100 Subject: [PATCH 04/10] Fixed typo --- tasmota/i18n.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index b808bb8fdf5b..c56b61e5c87f 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -110,7 +110,7 @@ #define D_JSON_POWERUSAGE "Power" #define D_JSON_ACTIVE_POWERUSAGE "ActivePower" #define D_JSON_APPARENT_POWERUSAGE "ApparentPower" -#define D_JSON_REACTIVE_D_SNSUSAGE "ReactivePower" +#define D_JSON_REACTIVE_POWERUSAGE "ReactivePower" #define D_JSON_PRESSURE "Pressure" #define D_JSON_PRESSUREATSEALEVEL "SeaPressure" #define D_JSON_PRESSURE_UNIT "PressureUnit" From 26522f1894c2046e68aae3d5e4854ff859257fdb Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 18:39:59 +0100 Subject: [PATCH 05/10] Aligning with latest dev --- tasmota/tasmota_template.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 9c06af90a978..20b2a218d1f6 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -630,8 +630,10 @@ const uint8_t kGpioNiceList[] PROGMEM = { #if defined(USE_I2C) && defined(USE_ADE7953) GPIO_ADE7953_IRQ, // ADE7953 IRQ #endif +#ifdef USE_CSE7766 GPIO_CSE7766_TX, // CSE7766 Serial interface (S31 and Pow R2) GPIO_CSE7766_RX, // CSE7766 Serial interface (S31 and Pow R2) +#endif #ifdef USE_MCP39F501 GPIO_MCP39F5_TX, // MCP39F501 Serial interface (Shelly2) GPIO_MCP39F5_RX, // MCP39F501 Serial interface (Shelly2) From 155634e943fe369fac167ac973acebd881fe9c03 Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 19:09:54 +0100 Subject: [PATCH 06/10] Travis test compliance --- tasmota/tasmota_template.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 20b2a218d1f6..df1c4418f153 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -323,8 +323,7 @@ enum ProgramSelectableAdc0 { const char kAdc0Names[] PROGMEM = D_SENSOR_NONE "|" D_ANALOG_INPUT "|" D_TEMPERATURE "|" D_LIGHT "|" - D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" - D_SENSOR_CT_POWER "|" + D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" D_SENSOR_CT_POWER "|" // D_SENSOR_SWITCH "|" D_SENSOR_SWITCH "i|" ; From 632fc41f28d2fc6bff425d0568210103bbfe232d Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Tue, 3 Dec 2019 19:30:50 +0100 Subject: [PATCH 07/10] Travis compliance --- tasmota/tasmota_template.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index df1c4418f153..27f850b33d77 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -323,9 +323,10 @@ enum ProgramSelectableAdc0 { const char kAdc0Names[] PROGMEM = D_SENSOR_NONE "|" D_ANALOG_INPUT "|" D_TEMPERATURE "|" D_LIGHT "|" - D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" D_SENSOR_CT_POWER "|" + D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" + D_SENSOR_CT_POWER; // D_SENSOR_SWITCH "|" D_SENSOR_SWITCH "i|" - ; + /********************************************************************************************/ From c30f874b4c2260553767a840d334a5d7949c92cd Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Wed, 4 Dec 2019 10:41:33 +0100 Subject: [PATCH 08/10] Implementation of CT based apparent power monitor --- tasmota/i18n.h | 5 +++ tasmota/tasmota_template.h | 4 +- tasmota/xsns_02_analog.ino | 76 ++++++++++++++++++++++++-------------- 3 files changed, 55 insertions(+), 30 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index c56b61e5c87f..deab4c9b5b2b 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -63,6 +63,7 @@ #define D_JSON_EVERY "Every" #define D_JSON_EXPORT_ACTIVE "ExportActive" #define D_JSON_EXPORT_REACTIVE "ExportReactive" +#define D_JSON_ENERGY "Energy" #define D_JSON_FAILED "Failed" #define D_JSON_FALLBACKTOPIC "FallbackTopic" #define D_JSON_FEATURES "Features" @@ -570,7 +571,9 @@ const char JSON_SNS_ILLUMINANCE[] PROGMEM = ",\"%s\":{\"" D_JSON_ILLUMINANCE "\" const char JSON_SNS_GNGPM[] PROGMEM = ",\"%s\":{\"" D_JSON_TOTAL_USAGE "\":%s,\"" D_JSON_FLOWRATE "\":%s}"; const char JSON_SNS_CURRENT[] PROGMEM = ",\"%s\":{\"" D_JSON_CURRENT "\":%s}"; +const char JSON_SNS_VOLTAGE[] PROGMEM = ",\"%s\":{\"" D_JSON_VOLTAGE "\":%s}"; const char JSON_SNS_POWER[] PROGMEM = ",\"%s\":{\"" D_JSON_POWERUSAGE "\":%d}"; +const char JSON_SNS_ENERGY[] PROGMEM = ",\"%s\":{\"" D_JSON_ENERGY "\":%s}"; const char S_LOG_I2C_FOUND_AT[] PROGMEM = D_LOG_I2C "%s " D_FOUND_AT " 0x%x"; @@ -600,6 +603,8 @@ const char HTTP_SNS_GALLONS[] PROGMEM = "{s}%s " D_TOTAL_USAGE "{m}%s " D_UNIT_G const char HTTP_SNS_GPM[] PROGMEM = "{s}%s " D_FLOW_RATE "{m}%s " D_UNIT_GALLONS_PER_MIN" {e}"; // {s} = , {m} = , {e} = const char HTTP_SNS_CURRENT[] PROGMEM = "{s}%s " D_CURRENT "{m}%s " D_UNIT_AMPERE "{e}"; // {s} = , {m} = , {e} = const char HTTP_SNS_POWER[] PROGMEM = "{s}%s " D_POWERUSAGE "{m}%d " D_UNIT_WATT "{e}"; // {s} = , {m} = , {e} = +const char HTTP_SNS_VOLTAGE[] PROGMEM = "{s}%s " D_VOLTAGE "{m}%s " D_UNIT_VOLT "{e}"; // {s} = , {m} = , {e} = +const char HTTP_SNS_ENERGY[] PROGMEM = "{s}%s " D_ENERGY_TOTAL "{m}%s " D_UNIT_KILOWATTHOUR "{e}"; // {s} = , {m} = , {e} = const char S_MAIN_MENU[] PROGMEM = D_MAIN_MENU; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 27f850b33d77..6d074b58524e 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -324,9 +324,9 @@ const char kAdc0Names[] PROGMEM = D_SENSOR_NONE "|" D_ANALOG_INPUT "|" D_TEMPERATURE "|" D_LIGHT "|" D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "i|" - D_SENSOR_CT_POWER; + D_SENSOR_CT_POWER // D_SENSOR_SWITCH "|" D_SENSOR_SWITCH "i|" - +; /********************************************************************************************/ diff --git a/tasmota/xsns_02_analog.ino b/tasmota/xsns_02_analog.ino index c5b116e89389..23fac99621c5 100644 --- a/tasmota/xsns_02_analog.ino +++ b/tasmota/xsns_02_analog.ino @@ -54,14 +54,21 @@ // | // ADC0 // Default settings for a 20A/1V Current Transformer. Analog peak to peak range is measured and converted to RMS current using ANALOG_CT_MULTIPLIER -#define ANALOG_CT_CURRENT_OR_POWER 2 // (uint32_t) 0 for current, 1 for power, 2 for both, 3 or other for none +#define ANALOG_CT_FLAGS 0 // (uint32_t) reserved for possible future use #define ANALOG_CT_MULTIPLIER 2146 // (uint32_t) Multiplier*100000 to convert raw ADC peak to peak range 0..1023 to RMS current in Amps. Value of 100000 corresponds to 1 #define ANALOG_CT_VOLTAGE 2300 // (int) Convert current in Amps to apparrent power in Watts using voltage in Volts*10. Value of 2200 corresponds to 220V +#define CT_FLAG_ENERGY_RESET (1 << 0) // Reset energy total + uint16_t adc_last_value = 0; float adc_temp = 0; float adc_amps = 0; uint16_t adc_watts = 0; +float adc_kwh = 0; +float adc_voltage = 0; +uint32_t previous_millis = 0; + +float adv_voltage = 0; void AdcInit(void) { @@ -81,7 +88,7 @@ void AdcInit(void) } else if (ADC0_CT_POWER == my_adc0) { Settings.adc_param_type = ADC0_CT_POWER; - Settings.adc_param1 = ANALOG_CT_CURRENT_OR_POWER; //(uint32_t) 0 + Settings.adc_param1 = ANALOG_CT_FLAGS; //(uint32_t) 0 Settings.adc_param2 = ANALOG_CT_MULTIPLIER; //(uint32_t) 100000 Settings.adc_param3 = ANALOG_CT_VOLTAGE; //(int) 10 } @@ -117,6 +124,8 @@ void AdcGetCurrentPower(uint8_t factor) uint16_t analog = 0; uint16_t analog_min = 1023; uint16_t analog_max = 0; + uint32_t current_millis =0; + float watts_temp; for (uint32_t i = 0; i < samples; i++) { analog = analogRead(A0); if (analog < analog_min) { @@ -130,7 +139,12 @@ void AdcGetCurrentPower(uint8_t factor) } adc_amps=(float)(analog_max-analog_min)*((float)(Settings.adc_param2)/100000); - adc_watts=(uint16_t)(adc_amps*((float)(Settings.adc_param3)/10)); + adc_voltage=(float)(Settings.adc_param3)/10; + watts_temp=adc_amps*adc_voltage; + adc_watts=(uint16_t)(watts_temp); + current_millis=millis(); + adc_kwh=adc_kwh+((watts_temp*(current_millis-previous_millis))/3600000000); + previous_millis=current_millis; //adc_amps=(float)(analog_max-analog_min); //adc_watts=(uint16_t)adc_amps; @@ -229,37 +243,37 @@ void AdcShow(bool json) #endif // USE_WEBSERVER } } - else if (ADC0_CT_POWER == my_adc0 && ( Settings.adc_param1 < 3) ) { + else if (ADC0_CT_POWER == my_adc0) { AdcGetCurrentPower(5); - if ( (Settings.adc_param1 == 0) || (Settings.adc_param1 == 2) ){ - char current[33]; - dtostrfd(adc_amps, Settings.flag2.current_resolution, current); - if (json) { - ResponseAppend_P(JSON_SNS_CURRENT, "ANALOG", current); + char current[33]; + dtostrfd(adc_amps, Settings.flag2.current_resolution, current); + char kwh[33]; + dtostrfd(adc_kwh, Settings.flag2.energy_resolution, kwh); + char voltage[33]; + dtostrfd(adc_voltage, Settings.flag2.voltage_resolution, voltage); + char watts[33]; + itoa(adc_watts,watts,10); + + if (json) { + ResponseAppend_P(JSON_SNS_CURRENT, "ANALOG", current); + ResponseAppend_P(JSON_SNS_VOLTAGE, "ANALOG", voltage); + ResponseAppend_P(JSON_SNS_POWER, "ANALOG", adc_watts); + ResponseAppend_P(JSON_SNS_ENERGY, "ANALOG", kwh); + #ifdef USE_DOMOTICZ - if (0 == tele_period) { - DomoticzSensor(DZ_CURRENT, current); - } -#endif // USE_DOMOTICZ -#ifdef USE_WEBSERVER - } else { - WSContentSend_PD(HTTP_SNS_CURRENT, "", current, D_UNIT_AMPERE); -#endif // USE_WEBSERVER + if (0 == tele_period) { + DomoticzSensor(DZ_CURRENT, current); + DomoticzSensor(DZ_POWER_ENERGY, watts); + DomoticzSensor(DZ_VOLTAGE, voltage); } - } - if ( (Settings.adc_param1 == 1) || (Settings.adc_param1 == 2) ){ - if (json) { - ResponseAppend_P(JSON_SNS_POWER, "ANALOG", adc_watts); -#ifdef USE_DOMOTICZ - if (0 == tele_period) { - DomoticzSensor(DZ_POWER_ENERGY, adc_watts); - } #endif // USE_DOMOTICZ #ifdef USE_WEBSERVER - } else { - WSContentSend_PD(HTTP_SNS_POWER, "", adc_watts, D_UNIT_WATT); + } else { + WSContentSend_PD(HTTP_SNS_CURRENT, "", current, D_UNIT_AMPERE); + WSContentSend_PD(HTTP_SNS_VOLTAGE, "", voltage, D_UNIT_VOLT); + WSContentSend_PD(HTTP_SNS_POWER, "", adc_watts, D_UNIT_WATT); + WSContentSend_PD(HTTP_SNS_ENERGY, "", kwh, D_UNIT_KILOWATTHOUR); #endif // USE_WEBSERVER - } } } } @@ -331,6 +345,12 @@ void CmndAdcParam(void) Settings.adc_param1 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 2), nullptr, 10); Settings.adc_param2 = strtol(subStr(sub_string, XdrvMailbox.data, ",", 3), nullptr, 10); Settings.adc_param3 = (int)(CharToFloat(subStr(sub_string, XdrvMailbox.data, ",", 4))); + // Process param1 flags + if( (Settings.adc_param1 & CT_FLAG_ENERGY_RESET) > 0){ + adc_kwh = 0; + Settings.adc_param1 ^= CT_FLAG_ENERGY_RESET; // Cancel energy reset flag + } + } else { // Set default values based on current adc type // AdcParam 2 // AdcParam 3 From e9ed593f16849bea0ece1795cc0c1f233366a00b Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Wed, 4 Dec 2019 10:42:17 +0100 Subject: [PATCH 09/10] Implementation of CT based apparent power monitor --- tasmota/language/en-GB.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasmota/language/en-GB.h b/tasmota/language/en-GB.h index a98087a189fb..a5b676b5fce1 100644 --- a/tasmota/language/en-GB.h +++ b/tasmota/language/en-GB.h @@ -625,9 +625,10 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" #define D_SENSOR_EXS_ENABLE "EXS Enable" -#define D_SENSOR_SLAVE_TX "Slave TX" -#define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_TX "Slave TX" +#define D_SENSOR_SLAVE_RX "Slave RX" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" From a8b9fbc09cf94ed6ad890574d474dab292b5eb6a Mon Sep 17 00:00:00 2001 From: Jody Dillon Date: Wed, 4 Dec 2019 11:39:15 +0100 Subject: [PATCH 10/10] Update for CT monitor at A0 --- tasmota/language/bg-BG.h | 3 +- tasmota/language/cs-CZ.h | 3 +- tasmota/language/de-DE.h | 3 +- tasmota/language/el-GR.h | 3 +- tasmota/language/es-ES.h | 7 +- tasmota/language/fr-FR.h | 3 +- tasmota/language/he-HE.h | 3 +- tasmota/language/hu-HU.h | 3 +- tasmota/language/it-IT.h | 3 +- tasmota/language/ko-KO.h | 31 +++++---- tasmota/language/nl-NL.h | 3 +- tasmota/language/pl-PL.h | 145 ++++++++++++++++++++------------------- tasmota/language/pt-BR.h | 3 +- tasmota/language/pt-PT.h | 3 +- tasmota/language/ru-RU.h | 3 +- tasmota/language/sk-SK.h | 3 +- tasmota/language/sv-SE.h | 3 +- tasmota/language/tr-TR.h | 3 +- tasmota/language/uk-UK.h | 3 +- tasmota/language/zh-CN.h | 3 +- tasmota/language/zh-TW.h | 3 +- 21 files changed, 129 insertions(+), 108 deletions(-) diff --git a/tasmota/language/bg-BG.h b/tasmota/language/bg-BG.h index 4bc5feebd029..deab4f00ff50 100644 --- a/tasmota/language/bg-BG.h +++ b/tasmota/language/bg-BG.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/cs-CZ.h b/tasmota/language/cs-CZ.h index 8800368a3c41..6bb48033f86f 100644 --- a/tasmota/language/cs-CZ.h +++ b/tasmota/language/cs-CZ.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/de-DE.h b/tasmota/language/de-DE.h index c50de823f1c1..255dc78114ae 100644 --- a/tasmota/language/de-DE.h +++ b/tasmota/language/de-DE.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/el-GR.h b/tasmota/language/el-GR.h index 4fe47ae6deef..5d9292bee3c3 100644 --- a/tasmota/language/el-GR.h +++ b/tasmota/language/el-GR.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/es-ES.h b/tasmota/language/es-ES.h index 014d822a9be0..002453f5339a 100644 --- a/tasmota/language/es-ES.h +++ b/tasmota/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 v7.0.0.5 + * Updated until v7.0.0.3 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -75,7 +75,7 @@ #define D_COUNTER "Contador" #define D_CURRENT "Corriente" // As in Voltage and Current #define D_DATA "Datos" -#define D_DARKLIGHT "Oscuro" +#define D_DARKLIGHT "Oscura" #define D_DEBUG "Debug" #define D_DISABLED "Deshabilitado" #define D_DISTANCE "Distancia" @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/fr-FR.h b/tasmota/language/fr-FR.h index 4704c49e7391..6e57ef8202e5 100644 --- a/tasmota/language/fr-FR.h +++ b/tasmota/language/fr-FR.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/he-HE.h b/tasmota/language/he-HE.h index 69387ceca2ce..22c35c8459c9 100644 --- a/tasmota/language/he-HE.h +++ b/tasmota/language/he-HE.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/hu-HU.h b/tasmota/language/hu-HU.h index 58f85eb229b3..e4eb885f0286 100644 --- a/tasmota/language/hu-HU.h +++ b/tasmota/language/hu-HU.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/it-IT.h b/tasmota/language/it-IT.h index 3029f37dac93..3a57320988d6 100644 --- a/tasmota/language/it-IT.h +++ b/tasmota/language/it-IT.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/ko-KO.h b/tasmota/language/ko-KO.h index c6236a05fde2..c5c5927b98a3 100644 --- a/tasmota/language/ko-KO.h +++ b/tasmota/language/ko-KO.h @@ -236,7 +236,7 @@ #define D_SECONDS "초" #define D_DEVICE_WILL_RESTART "이 장치는 몇 초 후 재시작됩니다" #define D_BUTTON_TOGGLE "켜기/끄기" -#define D_CONFIGURATION "설정 메뉴" +#define D_CONFIGURATION "설정" #define D_INFORMATION "정보" #define D_FIRMWARE_UPGRADE "펌웨어 업그레이드" #define D_CONSOLE "콘솔" @@ -250,11 +250,11 @@ #define D_CONFIGURE_OTHER "기타 설정" #define D_CONFIRM_RESET_CONFIGURATION "설정 초기화 확인" #define D_RESET_CONFIGURATION "설정 초기화" -#define D_BACKUP_CONFIGURATION "설정 백업" -#define D_RESTORE_CONFIGURATION "설정 복구" +#define D_BACKUP_CONFIGURATION "백업 설정" +#define D_RESTORE_CONFIGURATION "복원 설정" #define D_MAIN_MENU "메인 메뉴" -#define D_MODULE_PARAMETERS "모듈 설정" +#define D_MODULE_PARAMETERS "모듈 파라미터" #define D_MODULE_TYPE "모듈 타입" #define D_PULLUP_ENABLE "버튼 없음/스위치 당김" #define D_ADC "ADC" @@ -262,8 +262,8 @@ #define D_SERIAL_IN "Serial In" #define D_SERIAL_OUT "Serial Out" -#define D_WIFI_PARAMETERS "Wifi 설정" -#define D_SCAN_FOR_WIFI_NETWORKS "Wifi 네트워크를 검색.." +#define D_WIFI_PARAMETERS "Wifi 파리미터" +#define D_SCAN_FOR_WIFI_NETWORKS "Wifi 네트워크를 검색 중.." #define D_SCAN_DONE "검색 완료" #define D_NO_NETWORKS_FOUND "발견된 네트워크가 없습니다" #define D_REFRESH_TO_SCAN_AGAIN "검색 재시도" @@ -278,11 +278,11 @@ #define D_AP2_SSID "AP2 SSId" #define D_AP2_PASSWORD "AP2 비밀번호" -#define D_MQTT_PARAMETERS "MQTT 설정" +#define D_MQTT_PARAMETERS "MQTT 파라미터" #define D_CLIENT "클라이언트" #define D_FULL_TOPIC "Full Topic" -#define D_LOGGING_PARAMETERS "로그 설정" +#define D_LOGGING_PARAMETERS "로그 파라미터" #define D_SERIAL_LOG_LEVEL "Serial 로그 레벨" #define D_MQTT_LOG_LEVEL "Mqtt 로그 레벨" #define D_WEB_LOG_LEVEL "Web 로그 레벨" @@ -292,7 +292,7 @@ #define D_SYSLOG_PORT "시스템로그 포트" #define D_TELEMETRY_PERIOD "보고 주기" -#define D_OTHER_PARAMETERS "기타 설정" +#define D_OTHER_PARAMETERS "기타 파라미터" #define D_TEMPLATE "템플릿" #define D_ACTIVATE "활성화" #define D_WEB_ADMIN_PASSWORD "Web Admin 비밀번호" @@ -304,7 +304,7 @@ #define D_MULTI_DEVICE "다수 장치" #define D_CONFIGURE_TEMPLATE "템플릿 설정" -#define D_TEMPLATE_PARAMETERS "템플릿 설정" +#define D_TEMPLATE_PARAMETERS "템플릿 상세" #define D_TEMPLATE_NAME "이름" #define D_BASE_TYPE "Based on" #define D_TEMPLATE_FLAGS "옵션" @@ -335,7 +335,7 @@ #define D_UPGRADE_BY_WEBSERVER "웹 서버에서 업그레이드" #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "업그레이드 시작" -#define D_UPGRADE_BY_FILE_UPLOAD "파일에서 업로드해 업그레이드" +#define D_UPGRADE_BY_FILE_UPLOAD "업로드 된 파일로 업그레이드" #define D_UPLOAD_STARTED "업로드 시작됨" #define D_UPGRADE_STARTED "업그레이드 시작됨" #define D_UPLOAD_DONE "업그레이드 완료" @@ -387,7 +387,7 @@ #define D_3_RESPONSE_PACKETS_SENT "3 요청 패킷이 전송됨" // xdrv_07_domoticz.ino -#define D_DOMOTICZ_PARAMETERS "Domoticz 설정" +#define D_DOMOTICZ_PARAMETERS "Domoticz 파라미터" #define D_DOMOTICZ_IDX "Idx" #define D_DOMOTICZ_KEY_IDX "Key idx" #define D_DOMOTICZ_SWITCH_IDX "스위치 idx" @@ -406,7 +406,7 @@ // xdrv_09_timers.ino #define D_CONFIGURE_TIMER "타이머 설정" -#define D_TIMER_PARAMETERS "타이머 설정" +#define D_TIMER_PARAMETERS "타이머 파라미터" #define D_TIMER_ENABLE "타이머 사용" #define D_TIMER_ARM "Arm" #define D_TIMER_TIME "시간" @@ -417,7 +417,7 @@ // xdrv_10_knx.ino #define D_CONFIGURE_KNX "KNX 설정" -#define D_KNX_PARAMETERS "KNX 설정" +#define D_KNX_PARAMETERS "KNX 파라미터" #define D_KNX_GENERAL_CONFIG "일반" #define D_KNX_PHYSICAL_ADDRESS "물리적 주소" #define D_KNX_PHYSICAL_ADDRESS_NOTE "( KNX 네트워크 상에서 반드시 고유한 이름이어야 합니다 )" @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/nl-NL.h b/tasmota/language/nl-NL.h index da20ff1d79a8..52a7a6dd231f 100644 --- a/tasmota/language/nl-NL.h +++ b/tasmota/language/nl-NL.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/pl-PL.h b/tasmota/language/pl-PL.h index 7a631f95f0eb..13dd52685c1a 100644 --- a/tasmota/language/pl-PL.h +++ b/tasmota/language/pl-PL.h @@ -64,10 +64,10 @@ #define D_BUTTON "Przycisk" #define D_BY "by" // Written by me #define D_BYTES "Bajtów" -#define D_CELSIUS "Celsiusz" +#define D_CELSIUS "Celsiusza" #define D_CHANNEL "Kanał" -#define D_CO2 "Dwutlenek węgla" -#define D_CODE "Kod" // Button code +#define D_CO2 "Dwutlenku węgla" +#define D_CODE "kod" // Button code #define D_COLDLIGHT "Zimny" #define D_COMMAND "Komenda" #define D_CONNECTED "Połączony" @@ -77,11 +77,11 @@ #define D_DATA "Data" #define D_DARKLIGHT "Ciemny" #define D_DEBUG "Debug" -#define D_DISABLED "Wyłączony" +#define D_DISABLED "Zablokowany" #define D_DISTANCE "Odległość" #define D_DNS_SERVER "Serwer DNS" #define D_DONE "Wykonane" -#define D_DST_TIME "Czas DST" +#define D_DST_TIME "DST" #define D_ECO2 "eCO2" #define D_EMULATION "Emulacja" #define D_ENABLED "Załączony" @@ -102,7 +102,7 @@ #define D_HOST "Serwer" #define D_HOSTNAME "Nazwa serwera" #define D_HUMIDITY "Wilgotność" -#define D_ILLUMINANCE "Podświetlanie" +#define D_ILLUMINANCE "Oświetlenie" #define D_IMMEDIATE "Natychmiastowy" // Button immediate #define D_INDEX "Indeks" #define D_INFO "Informacja" @@ -130,8 +130,8 @@ #define D_POWERUSAGE_REACTIVE "Moc bierna" #define D_PRESSURE "Ciśnienie" #define D_PRESSUREATSEALEVEL "Ciśnienie na poziomie morza" -#define D_PROGRAM_FLASH_SIZE "Rozmiar programu flash" -#define D_PROGRAM_SIZE "Rozmiar programu" +#define D_PROGRAM_FLASH_SIZE "Wielkość programu flash" +#define D_PROGRAM_SIZE "Wielkość programu" #define D_PROJECT "Projekt" #define D_RAIN "Deszcz" #define D_RECEIVED "Otrzymany" @@ -203,15 +203,15 @@ #define D_PATCH_ISSUE_2186 "Błąd poprawki 2186" #define D_CONNECTING_TO_AP "Łączenie z AP" #define D_IN_MODE "w trybie" -#define D_CONNECT_FAILED_NO_IP_ADDRESS "Połączenie nie powiodło się, ponieważ nie otrzymano adresu IP" -#define D_CONNECT_FAILED_AP_NOT_REACHED "Połączenie nie powiodło się, AP nie osiągalny" -#define D_CONNECT_FAILED_WRONG_PASSWORD "Połączenie nie powiodło się, nieprawidlowe hasło" -#define D_CONNECT_FAILED_AP_TIMEOUT "Nie udało się nawiązac połączenia, limit czasu przekroczony" +#define D_CONNECT_FAILED_NO_IP_ADDRESS "Połączenie nie powiodło się, ponieważ nie otrzymano adresu IP." +#define D_CONNECT_FAILED_AP_NOT_REACHED "Połączenie nie powiodło się, AP nie osiągalny." +#define D_CONNECT_FAILED_WRONG_PASSWORD "Połączenie nie powiodło się, nieprawidlowe hasło." +#define D_CONNECT_FAILED_AP_TIMEOUT "Nie udało się nawiązac połączenia, limit czasu przekroczony." #define D_ATTEMPTING_CONNECTION "Próba połączenia..." #define D_CHECKING_CONNECTION "Sprawdzanie połączenia..." -#define D_QUERY_DONE "Zapytanie wykonane" +#define D_QUERY_DONE "Wykonano zapytanie. Znaleziono uslugi MQTT" #define D_MQTT_SERVICE_FOUND "Usługa MQTT została znaleziona" -#define D_FOUND_AT "znaleziono w" +#define D_FOUND_AT "znalezione w" #define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nie znaleziony" // settings.ino @@ -233,7 +233,7 @@ #define D_TRYING_TO_CONNECT "Próbuję połączyć urzadzenie z siecią" #define D_RESTART_IN "Zrestartuj" -#define D_SECONDS "Sekund" +#define D_SECONDS "sekund" #define D_DEVICE_WILL_RESTART "Urządzenie zrestartuje sie za kilka sekund" #define D_BUTTON_TOGGLE "Załącz/Wyłącz" #define D_CONFIGURATION "Konfiguracja" @@ -247,7 +247,7 @@ #define D_CONFIGURE_MQTT "Konfiguracja MQTT" #define D_CONFIGURE_DOMOTICZ "Konfiguracja Domoticza" #define D_CONFIGURE_LOGGING "Konfiguracja dziennika" -#define D_CONFIGURE_OTHER "Inne konfiguracje" +#define D_CONFIGURE_OTHER "Konfiguracja innych" #define D_CONFIRM_RESET_CONFIGURATION "Potwierdź reset ustawień" #define D_RESET_CONFIGURATION "Reset ustawień" #define D_BACKUP_CONFIGURATION "Kopia ustawień" @@ -255,7 +255,7 @@ #define D_MAIN_MENU "Menu główne" #define D_MODULE_PARAMETERS "Parametry modułu" -#define D_MODULE_TYPE "Typ" +#define D_MODULE_TYPE "Typ modułu" #define D_PULLUP_ENABLE "Przełącznik pull-up" #define D_ADC "ADC" #define D_GPIO "GPIO" @@ -263,30 +263,30 @@ #define D_SERIAL_OUT "Wyjście rs" #define D_WIFI_PARAMETERS "Parametry sieci WiFi" -#define D_SCAN_FOR_WIFI_NETWORKS "Skanuj sieci" +#define D_SCAN_FOR_WIFI_NETWORKS "Skanuj sieci WiFi" #define D_SCAN_DONE "Skanowanie wykonane" #define D_NO_NETWORKS_FOUND "Nie znaleziono sieci" -#define D_REFRESH_TO_SCAN_AGAIN "Odśwież aby ponownie wyszukać sieci" -#define D_DUPLICATE_ACCESSPOINT "Duplikuj" +#define D_REFRESH_TO_SCAN_AGAIN "Odswież aby ponownie wyszukać sieci WiFi" +#define D_DUPLICATE_ACCESSPOINT "Powiel AP" #define D_SKIPPING_LOW_QUALITY "Pominięto z powodu niskiej jakości sygnału" #define D_RSSI "RSSI" #define D_WEP "WEP" #define D_WPA_PSK "WPA PSK" #define D_WPA2_PSK "WPA2 PSK" -#define D_AP1_SSID "Nazwa 1" -#define D_AP1_PASSWORD "Hasło 1" -#define D_AP2_SSID "Nazwa 2" -#define D_AP2_PASSWORD "Hasło 2" +#define D_AP1_SSID "AP1 SSID" +#define D_AP1_PASSWORD "Hasło AP1" +#define D_AP2_SSID "AP2 SSID" +#define D_AP2_PASSWORD "Hasło AP2" #define D_MQTT_PARAMETERS "Parametry MQTT" #define D_CLIENT "Klient" #define D_FULL_TOPIC "Pełny temat" #define D_LOGGING_PARAMETERS "Opcje dziennika" -#define D_SERIAL_LOG_LEVEL "Serial - poziom" -#define D_MQTT_LOG_LEVEL "Mqtt - poziom" -#define D_WEB_LOG_LEVEL "Web - poziom" -#define D_SYS_LOG_LEVEL "System - poziom" +#define D_SERIAL_LOG_LEVEL "Serial - poziom dziennika" +#define D_MQTT_LOG_LEVEL "Mqtt - poziom dziennika" +#define D_WEB_LOG_LEVEL "Web - poziom dziennika" +#define D_SYS_LOG_LEVEL "System - poziom dziennika" #define D_MORE_DEBUG "Więcej informacji dziennika" #define D_SYSLOG_HOST "Syslog host" #define D_SYSLOG_PORT "Syslog port" @@ -296,8 +296,8 @@ #define D_TEMPLATE "Szablon" #define D_ACTIVATE "Aktywuj" #define D_WEB_ADMIN_PASSWORD "Hasło administratora" -#define D_MQTT_ENABLE "Załącz MQTT" -#define D_FRIENDLY_NAME "Nazwa" +#define D_MQTT_ENABLE "MQTT aktywne" +#define D_FRIENDLY_NAME "Twoja nazwa" #define D_BELKIN_WEMO "Belkin WeMo" #define D_HUE_BRIDGE "Mostek Hue" #define D_SINGLE_DEVICE "pojedyńcze urządzenie" @@ -313,28 +313,28 @@ #define D_CONFIGURATION_SAVED "Ustawienia zapisane" #define D_CONFIGURATION_RESET "Ustawienia zresetowane" -#define D_PROGRAM_VERSION "Wersja oprogramowania" -#define D_BUILD_DATE_AND_TIME "Data kompilacji" +#define D_PROGRAM_VERSION "Wersja programu" +#define D_BUILD_DATE_AND_TIME "Dzień i godzina kompilacji" #define D_CORE_AND_SDK_VERSION "Wersja Core/SDK" #define D_FLASH_WRITE_COUNT "Liczba zapisów do pamięci" #define D_MAC_ADDRESS "Adres MAC" -#define D_MQTT_HOST "Host" -#define D_MQTT_PORT "Port" -#define D_MQTT_CLIENT "Klient" -#define D_MQTT_USER "Użytkownik" -#define D_MQTT_TOPIC "Temat" -#define D_MQTT_GROUP_TOPIC "Temat grupy" -#define D_MQTT_FULL_TOPIC "Pełny temat" +#define D_MQTT_HOST "Host MQTT" +#define D_MQTT_PORT "Port MQTT" +#define D_MQTT_CLIENT "Klient MQTT" +#define D_MQTT_USER "Użytkownik MQTT" +#define D_MQTT_TOPIC "Temat MQTT" +#define D_MQTT_GROUP_TOPIC "Temat grupy MQTT" +#define D_MQTT_FULL_TOPIC "Pełen temat MQTT" #define D_MDNS_DISCOVERY "Wykrywanie mDNS" #define D_MDNS_ADVERTISE "Rozgłaszanie mDNS" #define D_ESP_CHIP_ID "ID ukladu ESP" -#define D_FLASH_CHIP_ID "ID pamięci flash" +#define D_FLASH_CHIP_ID "ID układu pamięci flash" #define D_FLASH_CHIP_SIZE "Rozmiar pamięci flash" #define D_FREE_PROGRAM_SPACE "Wolna pamięć programu" #define D_UPGRADE_BY_WEBSERVER "Aktualizacja z serwera Web" -#define D_OTA_URL "Adres serwera" -#define D_START_UPGRADE "Aktualizuj" +#define D_OTA_URL "URL serwera" +#define D_START_UPGRADE "Start aktualizacji" #define D_UPGRADE_BY_FILE_UPLOAD "Aktualizacja z pliku" #define D_UPLOAD_STARTED "Wgrywanie rozpoczęte" #define D_UPGRADE_STARTED "Aktualizacja rozpoczęta" @@ -373,23 +373,23 @@ #define D_FAILED_TO_SEND_RESPONSE "Nie udało się wysłać odpowiedzi" #define D_WEMO "WeMo" -#define D_WEMO_BASIC_EVENT "Zdarzenie podstawowe" -#define D_WEMO_EVENT_SERVICE "Zdarzenie serwisowe" -#define D_WEMO_META_SERVICE "Meta dane serwisowe" +#define D_WEMO_BASIC_EVENT "Zdarzenie WeNo" +#define D_WEMO_EVENT_SERVICE "Zdarzenie serwisowe WeMo" +#define D_WEMO_META_SERVICE "Meta dane serwisowe WeMo" #define D_WEMO_SETUP "Ustawienia WeMo" -#define D_RESPONSE_SENT "Wyślij odpowiedź" +#define D_RESPONSE_SENT "Odpowiedź wysłana" #define D_HUE "Hue" #define D_HUE_BRIDGE_SETUP "Ustawienia Hue" -#define D_HUE_API_NOT_IMPLEMENTED "Api nie zaimplementowane" -#define D_HUE_API "API" -#define D_HUE_POST_ARGS "POST argument" +#define D_HUE_API_NOT_IMPLEMENTED "Api Hue nie zaimplementowane" +#define D_HUE_API "API Hue" +#define D_HUE_POST_ARGS "POST argument Hue" #define D_3_RESPONSE_PACKETS_SENT "3 pakiety odpowiedzi wysyłane" // xdrv_07_domoticz.ino #define D_DOMOTICZ_PARAMETERS "Parametry Domoticz" #define D_DOMOTICZ_IDX "Idx" -#define D_DOMOTICZ_KEY_IDX "Klucz Idx" +#define D_DOMOTICZ_KEY_IDX "Key idx" #define D_DOMOTICZ_SWITCH_IDX "Przełącznik Idx" #define D_DOMOTICZ_SENSOR_IDX "Sensor Idx" #define D_DOMOTICZ_TEMP "Temperatura" @@ -402,13 +402,13 @@ #define D_DOMOTICZ_CURRENT "Prąd" #define D_DOMOTICZ_AIRQUALITY "Jakość powietrza" #define D_DOMOTICZ_P1_SMART_METER "Miernik P1" -#define D_DOMOTICZ_UPDATE_TIMER "Aktualizacja zegara" +#define D_DOMOTICZ_UPDATE_TIMER "Zaktualizuj czasomierz" // xdrv_09_timers.ino #define D_CONFIGURE_TIMER "Konfiguracja harmonogramu" #define D_TIMER_PARAMETERS "Parametry harmonogramu" -#define D_TIMER_ENABLE "Załącz harmonogram" -#define D_TIMER_ARM "Załącz" +#define D_TIMER_ENABLE "Włącz harmonogram" +#define D_TIMER_ARM "Włącz" #define D_TIMER_TIME "Czas" #define D_TIMER_DAYS "Dni" #define D_TIMER_REPEAT "Powtarzaj" @@ -421,7 +421,7 @@ #define D_KNX_GENERAL_CONFIG "Konfiguracja ogólna" #define D_KNX_PHYSICAL_ADDRESS "Adres fizyczny" #define D_KNX_PHYSICAL_ADDRESS_NOTE "(Musi być unikalny w sieci KNX)" -#define D_KNX_ENABLE "Załącz" +#define D_KNX_ENABLE "Włącz KNX" #define D_KNX_GROUP_ADDRESS_TO_WRITE "Adresy grupowe do zapisu" #define D_ADD "Dodaj" #define D_DELETE "Usuń" @@ -431,11 +431,11 @@ #define D_KNX_COMMAND_WRITE "Zapisz" #define D_KNX_COMMAND_READ "Czytaj" #define D_KNX_COMMAND_OTHER "Inna komenda" -#define D_SENT_TO "Wyślij do" +#define D_SENT_TO "Wysłane do" #define D_KNX_WARNING "Adres grupy (0/0/0) jest zarezerwowany i nie można go użyć." -#define D_KNX_ENHANCEMENT "Rozszerzenia" -#define D_KNX_TX_SLOT "Gniazdo TX" -#define D_KNX_RX_SLOT "Gniazdo RX" +#define D_KNX_ENHANCEMENT "Rozszerzenia KNX" +#define D_KNX_TX_SLOT "KNX TX" +#define D_KNX_RX_SLOT "KNX RX" // xdrv_03_energy.ino #define D_ENERGY_TODAY "Energia dzisiaj" @@ -450,20 +450,20 @@ // xdrv_28_pcf8574.ino #define D_CONFIGURE_PCF8574 "Konfiguracja PCF8574" #define D_PCF8574_PARAMETERS "Parametry PCF8574" -#define D_INVERT_PORTS "Porty odwrócone" +#define D_INVERT_PORTS "Odwrócone porty" #define D_DEVICE "Urządzenie" #define D_DEVICE_INPUT "Wejście" #define D_DEVICE_OUTPUT "Wyjście" // xsns_05_ds18b20.ino -#define D_SENSOR_BUSY "Czujnik zajęty" -#define D_SENSOR_CRC_ERROR "Błąd CRC czujnika" -#define D_SENSORS_FOUND "Znaleziono czujnik" +#define D_SENSOR_BUSY "Czujnik DS18x20 zajęty" +#define D_SENSOR_CRC_ERROR "Czujnik DS18x20 błąd CRC" +#define D_SENSORS_FOUND "Znaleziono czujnik DS18x20" // xsns_06_dht.ino #define D_TIMEOUT_WAITING_FOR "Trwa oczekiwanie" -#define D_START_SIGNAL_LOW "Sygnał startowy niski" -#define D_START_SIGNAL_HIGH "Sygnał startowy wysoki" +#define D_START_SIGNAL_LOW "sygnał startowy niski" +#define D_START_SIGNAL_HIGH "sygnał startowy wysoki" #define D_PULSE "Impuls" #define D_CHECKSUM_FAILURE "Błędna suma kontrolna" @@ -498,10 +498,10 @@ #define D_CALIBRATION "Kalibrowanie" //xsns_35_tx20.ino -#define D_TX20_WIND_DIRECTION "Kierunek" -#define D_TX20_WIND_SPEED "Prędkość" -#define D_TX20_WIND_SPEED_AVG "Średnia prędkość" -#define D_TX20_WIND_SPEED_MAX "Maksymalna prędkość" +#define D_TX20_WIND_DIRECTION "Kierunek wiatru" +#define D_TX20_WIND_SPEED "Prędkość wiatru" +#define D_TX20_WIND_SPEED_AVG "Średnia prędkość wiatru" +#define D_TX20_WIND_SPEED_MAX "Maksymalna prędkość wiatru" #define D_TX20_NORTH "N" #define D_TX20_EAST "E" #define D_TX20_SOUTH "S" @@ -523,7 +523,7 @@ #define D_SENSOR_BUTTON "Przycisk" // Suffix "1" #define D_SENSOR_RELAY "Przekaźnik" // Suffix "1i" #define D_SENSOR_LED "Led" // Suffix "1i" -#define D_SENSOR_LED_LINK "Led link" // Suffix "i" +#define D_SENSOR_LED_LINK "LedLink" // Suffix "i" #define D_SENSOR_PWM "PWM" // Suffix "1" #define D_SENSOR_COUNTER "Licznik" // Suffix "1" #define D_SENSOR_IRRECV "IRrecv" @@ -540,7 +540,7 @@ #define D_SENSOR_SPI_MISO "SPI MISO" #define D_SENSOR_SPI_MOSI "SPI MOSI" #define D_SENSOR_SPI_CLK "SPI CLK" -#define D_SENSOR_BACKLIGHT "Podświetlanie" +#define D_SENSOR_BACKLIGHT "Backlight" #define D_SENSOR_PMS5003 "PMS5003" #define D_SENSOR_SDS0X1_RX "SDS0X1 Rx" #define D_SENSOR_SDS0X1_TX "SDS0X1 Tx" @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "Załącz EXS" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" @@ -669,7 +670,7 @@ #define D_EXPORT_ACTIVE "Czynna oddana" #define D_IMPORT_REACTIVE "Bierna pobrana" #define D_EXPORT_REACTIVE "Bierna oddana" -#define D_TOTAL_REACTIVE "Bierna całkowita" +#define D_TOTAL_REACTIVE "Całkowita bierna" #define D_UNIT_KWARH "kVArh" #define D_UNIT_ANGLE "Deg" diff --git a/tasmota/language/pt-BR.h b/tasmota/language/pt-BR.h index 2eb81f294597..a1d7887c12da 100644 --- a/tasmota/language/pt-BR.h +++ b/tasmota/language/pt-BR.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/pt-PT.h b/tasmota/language/pt-PT.h index 46bafdef6d0c..354f6d6fa64a 100644 --- a/tasmota/language/pt-PT.h +++ b/tasmota/language/pt-PT.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/ru-RU.h b/tasmota/language/ru-RU.h index 5ff9bff50799..aee408dee519 100644 --- a/tasmota/language/ru-RU.h +++ b/tasmota/language/ru-RU.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "А" diff --git a/tasmota/language/sk-SK.h b/tasmota/language/sk-SK.h index 57ec74f8ad32..888c90e895a9 100644 --- a/tasmota/language/sk-SK.h +++ b/tasmota/language/sk-SK.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/sv-SE.h b/tasmota/language/sv-SE.h index aee8fd25d139..bee38ba583fc 100644 --- a/tasmota/language/sv-SE.h +++ b/tasmota/language/sv-SE.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/tr-TR.h b/tasmota/language/tr-TR.h index 78612dace6c4..94f3b3e7d944 100644 --- a/tasmota/language/tr-TR.h +++ b/tasmota/language/tr-TR.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/uk-UK.h b/tasmota/language/uk-UK.h index f16d66648b21..3a63bbe58a1a 100644 --- a/tasmota/language/uk-UK.h +++ b/tasmota/language/uk-UK.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "А" diff --git a/tasmota/language/zh-CN.h b/tasmota/language/zh-CN.h index 2c8610400833..3a24e962f63b 100644 --- a/tasmota/language/zh-CN.h +++ b/tasmota/language/zh-CN.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "安" diff --git a/tasmota/language/zh-TW.h b/tasmota/language/zh-TW.h index e5ef8926a939..a00238dbb4ef 100644 --- a/tasmota/language/zh-TW.h +++ b/tasmota/language/zh-TW.h @@ -627,7 +627,8 @@ #define D_SENSOR_EXS_ENABLE "EXS Enable" #define D_SENSOR_SLAVE_TX "Slave TX" #define D_SENSOR_SLAVE_RX "Slave RX" -#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_SLAVE_RESET "Slave RST" +#define D_SENSOR_CT_POWER "CT Power" // Units #define D_UNIT_AMPERE "安"