Skip to content

Commit

Permalink
Feature: DPL: support setups without power meter
Browse files Browse the repository at this point in the history
without a power meter configured, the DPL now sets the base load as the
inverter limit if the battery charge allows it. it also takes
solar-passthrough into account, i.e., if the battery is in a charge
cycle but the solar output (Victron MPPT) is significant, the solar
power will be used up until the base load. if the battery reaches the
full solar passthrough threshold, the DPL will match the inverter limit
to the MPPT solar output.
  • Loading branch information
schlimmchen committed Apr 10, 2024
1 parent 0d95b36 commit 427cb5c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 0 additions & 2 deletions include/PowerLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class PowerLimiterClass {
DisabledByConfig,
DisabledByMqtt,
WaitingForValidTimestamp,
PowerMeterDisabled,
PowerMeterPending,
InverterInvalid,
InverterChanged,
Expand All @@ -38,7 +37,6 @@ class PowerLimiterClass {
NoVeDirect,
NoEnergy,
HuaweiPsu,
Settling,
Stable,
};

Expand Down
10 changes: 1 addition & 9 deletions src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ frozen::string const& PowerLimiterClass::getStatusText(PowerLimiterClass::Status
{
static const frozen::string missing = "programmer error: missing status text";

static const frozen::map<Status, frozen::string, 20> texts = {
static const frozen::map<Status, frozen::string, 19> texts = {
{ Status::Initializing, "initializing (should not see me)" },
{ Status::DisabledByConfig, "disabled by configuration" },
{ Status::DisabledByMqtt, "disabled by MQTT" },
{ Status::WaitingForValidTimestamp, "waiting for valid date and time to be available" },
{ Status::PowerMeterDisabled, "no power meter is configured/enabled" },
{ Status::PowerMeterPending, "waiting for sufficiently recent power meter reading" },
{ Status::InverterInvalid, "invalid inverter selection/configuration" },
{ Status::InverterChanged, "target inverter changed" },
Expand Down Expand Up @@ -174,13 +173,6 @@ void PowerLimiterClass::loop()
return unconditionalSolarPassthrough(_inverter);
}

// the normal mode of operation requires a valid
// power meter reading to calculate a power limit
if (!config.PowerMeter.Enabled) {
shutdown(Status::PowerMeterDisabled);
return;
}

// concerns both power limits and start/stop/restart commands and is
// only updated if a respective response was received from the inverter
auto lastUpdateCmd = std::max(
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
"ConfigHintRequirement": "Erforderlich",
"ConfigHintOptional": "Optional",
"ConfigHintsIntro": "Folgende Hinweise zur Konfiguration des Dynamic Power Limiter (DPL) sollen beachtet werden:",
"ConfigHintPowerMeterDisabled": "Zum Betrieb des DPL muss der Power Meter konfiguriert sein und Daten liefern.",
"ConfigHintPowerMeterDisabled": "Der DPL stellt ohne Stromzählerschnittstelle lediglich die konfigurierte Grundlast als Limit am Wechselrichter ein (Ausnahme: (Full) Solar-Passthrough).",
"ConfigHintNoInverter": "Vor dem Festlegen von Einstellungen des DPL muss mindestens ein Inverter konfiguriert sein.",
"ConfigHintInverterCommunication": "Das Abrufen von Daten und Senden von Kommandos muss für den zu regelnden Wechselrichter aktiviert sein.",
"ConfigHintNoChargeController": "Die Solar-Passthrough Funktion kann nur mit aktivierter VE.Direct Schnittstelle genutzt werden.",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
"ConfigHintRequirement": "Required",
"ConfigHintOptional": "Optional",
"ConfigHintsIntro": "The following notes regarding the Dynamic Power Limiter (DPL) configuration shall be considered:",
"ConfigHintPowerMeterDisabled": "Operating the DPL requires the Power Meter being configured and delivering data.",
"ConfigHintPowerMeterDisabled": "Without a power meter interface, the inverter limit the DPL will configure equals the configured base load (exception: (full) solar-passthrough).",
"ConfigHintNoInverter": "At least one inverter must be configured prior to setting up the DPL.",
"ConfigHintInverterCommunication": "Polling data from and sending commands to the target inverter must be enabled.",
"ConfigHintNoChargeController": "The solar-passthrough feature can only be used if the VE.Direct interface is configured.",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
"ConfigHintRequirement": "Required",
"ConfigHintOptional": "Optional",
"ConfigHintsIntro": "The following notes regarding the Dynamic Power Limiter (DPL) configuration shall be considered:",
"ConfigHintPowerMeterDisabled": "Operating the DPL requires the Power Meter being configured and delivering data.",
"ConfigHintPowerMeterDisabled": "Without a power meter interface, the inverter limit the DPL will configure equals the configured base load (exception: (full) solar-passthrough).",
"ConfigHintNoInverter": "At least one inverter must be configured prior to setting up the DPL.",
"ConfigHintInverterCommunication": "Polling data from and sending commands to the target inverter must be enabled.",
"ConfigHintNoChargeController": "The solar-passthrough feature can only be used if the VE.Direct interface is configured.",
Expand Down
11 changes: 7 additions & 4 deletions webapp/src/views/PowerLimiterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
v-model="powerLimiterConfigList.verbose_logging"
type="checkbox" wide/>

<InputElement v-show="isEnabled()"
<InputElement v-show="isEnabled() && hasPowerMeter()"
:label="$t('powerlimiteradmin.TargetPowerConsumption')"
:tooltip="$t('powerlimiteradmin.TargetPowerConsumptionHint')"
v-model="powerLimiterConfigList.target_power_consumption"
Expand Down Expand Up @@ -99,7 +99,8 @@
placeholder="800" :min="(powerLimiterConfigList.base_load_limit + 1).toString()" postfix="W"
type="number" wide/>

<InputElement :label="$t('powerlimiteradmin.InverterIsBehindPowerMeter')"
<InputElement v-show="hasPowerMeter()"
:label="$t('powerlimiteradmin.InverterIsBehindPowerMeter')"
v-model="powerLimiterConfigList.is_inverter_behind_powermeter"
type="checkbox" wide/>

Expand Down Expand Up @@ -275,8 +276,7 @@ export default defineComponent({
var hints = [];
if (meta.power_meter_enabled !== true) {
hints.push({severity: "requirement", subject: "PowerMeterDisabled"});
this.configAlert = true;
hints.push({severity: "optional", subject: "PowerMeterDisabled"});
}
if (typeof meta.inverters === "undefined" || Object.keys(meta.inverters).length == 0) {
Expand Down Expand Up @@ -305,6 +305,9 @@ export default defineComponent({
isEnabled() {
return this.powerLimiterConfigList.enabled;
},
hasPowerMeter() {
return this.powerLimiterMetaData.power_meter_enabled;
},
canUseSolarPassthrough() {
var cfg = this.powerLimiterConfigList;
var meta = this.powerLimiterMetaData;
Expand Down

0 comments on commit 427cb5c

Please sign in to comment.