diff --git a/include/PowerLimiter.h b/include/PowerLimiter.h index df2f057e9..96baaf7c1 100644 --- a/include/PowerLimiter.h +++ b/include/PowerLimiter.h @@ -16,7 +16,7 @@ typedef enum { typedef enum { EMPTY_WHEN_FULL= 0, - EMPTY_AT_NIGTH + EMPTY_AT_NIGHT } batDrainStrategy; diff --git a/lib/VeDirectFrameHandler/VeDirectFrameHandler.h b/lib/VeDirectFrameHandler/VeDirectFrameHandler.h index df97dc498..d96f6f827 100644 --- a/lib/VeDirectFrameHandler/VeDirectFrameHandler.h +++ b/lib/VeDirectFrameHandler/VeDirectFrameHandler.h @@ -25,7 +25,7 @@ #define VE_MAX_VALUE_LEN 33 // VE.Direct Protocol: max value size is 33 including /0 typedef struct { - uint16_t PID; // pruduct id + uint16_t PID; // product id char SER[VE_MAX_VALUE_LEN]; // serial number char FW[VE_MAX_VALUE_LEN]; // firmware release number bool LOAD; // virtual load output state (on if battery voltage reaches upper limit, off if battery reaches lower limit) diff --git a/src/PowerLimiter.cpp b/src/PowerLimiter.cpp index a838c943c..138b0b757 100644 --- a/src/PowerLimiter.cpp +++ b/src/PowerLimiter.cpp @@ -105,7 +105,7 @@ void PowerLimiterClass::loop() } if (!canUseDirectSolarPower()) { - if (config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGTH) + if (config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGHT) _plState = STATE_NORMAL_OPERATION; else _plState = STATE_OFF; @@ -122,7 +122,7 @@ void PowerLimiterClass::loop() _plState = STATE_OFF; break; } - if (canUseDirectSolarPower() && (config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGTH)) { + if (canUseDirectSolarPower() && (config.PowerLimiter_BatteryDrainStategy == EMPTY_AT_NIGHT)) { _plState = STATE_CONSUME_SOLAR_POWER_ONLY; break; } diff --git a/src/WebApi_ws_live.cpp b/src/WebApi_ws_live.cpp index 24fadf418..9e76fe686 100644 --- a/src/WebApi_ws_live.cpp +++ b/src/WebApi_ws_live.cpp @@ -6,6 +6,8 @@ #include "Configuration.h" #include "MessageOutput.h" #include "WebApi.h" +#include "Battery.h" +#include "VeDirectFrameHandler.h" #include "defaults.h" #include @@ -186,13 +188,17 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root) JsonObject vedirectObj = root.createNestedObject("vedirect"); vedirectObj[F("enabled")] = Configuration.get().Vedirect_Enabled; - + JsonObject totalVeObj = vedirectObj.createNestedObject("total"); + addTotalField(totalVeObj, "Power", VeDirect.veFrame.PPV, "W", 1); + addTotalField(totalVeObj, "YieldDay", VeDirect.veFrame.H20 * 1000, "Wh", 0); + addTotalField(totalVeObj, "YieldTotal", VeDirect.veFrame.H19, "kWh", 2); + JsonObject huaweiObj = root.createNestedObject("huawei"); huaweiObj[F("enabled")] = Configuration.get().Huawei_Enabled; JsonObject batteryObj = root.createNestedObject("battery"); batteryObj[F("enabled")] = Configuration.get().Battery_Enabled; - + addTotalField(batteryObj, "soc", Battery.stateOfCharge, "%", 0); } void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId, String topic) diff --git a/webapp/src/components/InverterTotalInfo.vue b/webapp/src/components/InverterTotalInfo.vue index 5952c24cd..678312d54 100644 --- a/webapp/src/components/InverterTotalInfo.vue +++ b/webapp/src/components/InverterTotalInfo.vue @@ -1,57 +1,123 @@ \ No newline at end of file diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 510ff4c8f..da25cf6b5 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -326,9 +326,13 @@ "Unit": "Einheit" }, "invertertotalinfo": { - "TotalYieldTotal": "Gesamtertrag Insgesamt", - "TotalYieldDay": "Gesamtertrag Heute", - "TotalPower": "Gesamtleistung" + "InverterTotalYieldTotal": "Inverter Gesamtertrag Insgesamt", + "InverterTotalYieldDay": "Inverter Gesamtertrag Heute", + "InverterTotalPower": "Inverter Gesamtleistung", + "MpptTotalYieldTotal": "MPPT Gesamtertrag Insgesamt", + "MpptTotalYieldDay": "MPPT Gesamtertrag Heute", + "MpptTotalPower": "MPPT Gesamtleistung", + "BatterySoc": "Ladezustand" }, "inverterchannelproperty": { "Power": "Leistung", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index 06d6e80fb..537db46a9 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -326,9 +326,13 @@ "Unit": "Unit" }, "invertertotalinfo": { - "TotalYieldTotal": "Total Yield Total", - "TotalYieldDay": "Total Yield Day", - "TotalPower": "Total Power" + "InverterTotalYieldTotal": "Inverter Total Yield Total", + "InverterTotalYieldDay": "Inverter Total Yield Day", + "InverterTotalPower": "Inverter Total Power", + "MpptTotalYieldTotal": "MPPT Total Yield Total", + "MpptTotalYieldDay": "MPPT Total Yield Day", + "MpptTotalPower": "MPPT Total Power", + "BatterySoc": "State of charge" }, "inverterchannelproperty": { "Power": "Power", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index 660a13bf6..c91fc0dc0 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -325,9 +325,13 @@ "Unit": "Unité" }, "invertertotalinfo": { - "TotalYieldTotal": "Rendement total", - "TotalYieldDay": "Rendement du jour", - "TotalPower": "Puissance de l'installation" + "InverterTotalYieldTotal": "Onduleurs rendement total", + "InverterTotalYieldDay": "Onduleurs rendement du jour", + "InverterTotalPower": "Onduleurs puissance de l'installation", + "MpptTotalYieldTotal": "MPPT rendement total", + "MpptTotalYieldDay": "MPPT rendement du jour", + "MpptTotalPower": "MPPT puissance de l'installation", + "BatterySoc": "State of charge" }, "inverterchannelproperty": { "Power": "Puissance", diff --git a/webapp/src/types/LiveDataStatus.ts b/webapp/src/types/LiveDataStatus.ts index fbd60ccdc..a6fdac2ec 100644 --- a/webapp/src/types/LiveDataStatus.ts +++ b/webapp/src/types/LiveDataStatus.ts @@ -49,6 +49,7 @@ export interface Hints { export interface Vedirect { enabled: boolean; + total: Total; } export interface Huawei { @@ -57,6 +58,7 @@ export interface Huawei { export interface Battery { enabled: boolean; + soc: ValueObject; } export interface LiveData { diff --git a/webapp/src/views/HomeView.vue b/webapp/src/views/HomeView.vue index a84e11423..58fe4097b 100644 --- a/webapp/src/views/HomeView.vue +++ b/webapp/src/views/HomeView.vue @@ -1,7 +1,7 @@