Skip to content

Commit

Permalink
Add UI changes to edit safe dynamic limit settings
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiur committed Sep 18, 2023
1 parent 44850c7 commit 83319c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WebApi_inverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void WebApiInverterClass::onInverterList(AsyncWebServerRequest* request)
obj["reachable_threshold"] = config.Inverter[i].ReachableThreshold;
obj["zero_runtime"] = config.Inverter[i].ZeroRuntimeDataIfUnrechable;
obj["zero_day"] = config.Inverter[i].ZeroYieldDayOnMidnight;
obj["safe_limit_millis"] = config.Inverter[i].SafeLimitMillis;
obj["safe_limit_watts"] = config.Inverter[i].SafeLimitWatts;

auto inv = Hoymiles.getInverterBySerial(config.Inverter[i].Serial);
uint8_t max_channels;
Expand Down Expand Up @@ -288,6 +290,8 @@ void WebApiInverterClass::onInverterEdit(AsyncWebServerRequest* request)
inverter.ReachableThreshold = root["reachable_threshold"] | REACHABLE_THRESHOLD;
inverter.ZeroRuntimeDataIfUnrechable = root["zero_runtime"] | false;
inverter.ZeroYieldDayOnMidnight = root["zero_day"] | false;
inverter.SafeLimitMillis = root["safe_limit_millis"] | 0;
inverter.SafeLimitWatts = root["safe_limit_watts"] | 0;

arrayCount++;
}
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@
"ZeroRuntimeHint": "Zero runtime data (no yield data) if inverter becomes unreachable.",
"ZeroDay": "Zero daily yield at midnight",
"ZeroDayHint": "This only works if the inverter is unreachable. If data is read from the inverter, it's values will be used. (Reset only occours on power cycle)",
"SafeLimitWatts": "Safe Limit (W):",
"SafeLimitWattsHint": "Inverter will fallback automatically to this safe limit if nobody updates its non-persistent limit frequently enough.",
"SafeLimitMillis": "Safe Limit Delay (ms):",
"SafeLimitMillisHint": "Number of milliseconds to wait before falling back to the safe limit since the last non-persistent limit update; or 0 to disable it.",
"Cancel": "@:maintenancereboot.Cancel",
"Save": "@:dtuadmin.Save",
"DeleteMsg": "Are you sure you want to delete the inverter \"{name}\" with serial number {serial}?",
Expand Down
12 changes: 12 additions & 0 deletions webapp/src/views/InverterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@
v-model="selectedInverterData.zero_day"
type="checkbox"
:tooltip="$t('inverteradmin.ZeroDayHint')" wide/>

<InputElement :label="$t('inverteradmin.SafeLimitWatts')"
v-model="selectedInverterData.safe_limit_watts"
type="number" min="1" max="2250"
:tooltip="$t('inverteradmin.SafeLimitWattsHint')" wide/>

<InputElement :label="$t('inverteradmin.SafeLimitMillis')"
v-model="selectedInverterData.safe_limit_millis"
type="number" min="0" max="65535"
:tooltip="$t('inverteradmin.SafeLimitMillisHint')" wide/>
</div>
</div>
</form>
Expand Down Expand Up @@ -269,6 +279,8 @@ declare interface Inverter {
reachable_threshold: number;
zero_runtime: boolean;
zero_day: boolean;
safe_limit_millis: number;
safe_limit_watts: number;
channel: Array<Channel>;
}
Expand Down

0 comments on commit 83319c2

Please sign in to comment.