Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions assets/js/components/Loadpoints/BatteryBoostButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<button
class="root position-relative"
tabindex="0"
:class="{ active, belowLimit, full }"
:class="{ active, belowLimit, batteryHold, full }"
:style="{ '--soc': `${adjustedSoc}%` }"
:disabled="disabled"
:aria-label="ariaLabel"
Expand All @@ -17,17 +17,17 @@
<div class="progress-bar bg-primary progress-bar-striped progress-bar-animated"></div>
</div>
<div class="icon-wrapper" :style="iconStyle">
<BatteryBoost :active="active && !belowLimit" />
<BatteryBoost :active="active && available" />
</div>
<div class="icon-wrapper text-white" :style="iconActiveStyle">
<BatteryBoost :active="active && !belowLimit" />
<BatteryBoost :active="active && available" />
</div>
</button>
</template>

<script lang="ts">
import { defineComponent, type PropType } from "vue";
import { CHARGE_MODE, type Timeout } from "@/types/evcc";
import { BATTERY_MODE, CHARGE_MODE, type Timeout } from "@/types/evcc";
import BatteryBoost from "../MaterialIcon/BatteryBoost.vue";

export default defineComponent({
Expand All @@ -40,6 +40,7 @@ export default defineComponent({
batteryBoostLimit: { type: Number, default: 100 },
mode: String as PropType<CHARGE_MODE>,
batterySoc: { type: Number, default: 0 },
batteryMode: String as PropType<BATTERY_MODE>,
},
emits: ["updated", "status"],
data() {
Expand All @@ -66,6 +67,12 @@ export default defineComponent({
belowLimit(): boolean {
return this.batterySoc < this.batteryBoostLimit;
},
batteryHold(): boolean {
return this.batteryMode === BATTERY_MODE.HOLD;
},
available(): boolean {
return !this.belowLimit && !this.batteryHold;
},
iconStyle() {
return {
clipPath: this.active ? `inset(0 0 calc(var(--soc)) 0)` : undefined,
Expand All @@ -76,6 +83,7 @@ export default defineComponent({
},
ariaLabel(): string {
const t = (key: string) => this.$t(`main.loadpointSettings.batteryBoost.${key}`);
if (this.batteryHold) return t("stateHold");
if (this.active) return t("stateActive");
if (this.belowLimit) return t("stateBelowLimit");
return t("stateReady");
Expand Down Expand Up @@ -105,6 +113,12 @@ export default defineComponent({
});
const newValue = !this.active;

// battery hold: only show message, don't toggle
if (newValue && this.batteryHold) {
status("batteryBoostHold");
return;
}

// below limit: only show message, don't toggle
if (newValue && this.belowLimit) {
status("batteryBoostBelowLimit");
Expand Down Expand Up @@ -157,7 +171,8 @@ export default defineComponent({
color: inherit;
opacity: 0.25;
}
.root.belowLimit:not(:disabled) {
.root.belowLimit:not(:disabled),
.root.batteryHold:not(:disabled) {
opacity: 0.5;
}
.root:before,
Expand Down
2 changes: 2 additions & 0 deletions assets/js/components/Loadpoints/Loadpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ import type {
Vehicle,
Forecast,
SMART_COST_TYPE,
BATTERY_MODE,
} from "@/types/evcc";
import type { PlanStrategy } from "@/components/ChargingPlans/types";

Expand Down Expand Up @@ -160,6 +161,7 @@ export default defineComponent({
batteryBoostLimit: { type: Number, default: 100 },
batteryConfigured: Boolean,
batterySoc: Number,
batteryMode: String as PropType<BATTERY_MODE>,

// session
sessionEnergy: Number,
Expand Down
4 changes: 3 additions & 1 deletion assets/js/components/Loadpoints/Loadpoints.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:pvConfigured="pvConfigured"
:batteryConfigured="batteryConfigured"
:batterySoc="batterySoc"
:batteryMode="batteryMode"
:forecast="forecast"
class="h-100"
:class="{ 'loadpoint-unselected': !selected(loadpoint.id) }"
Expand Down Expand Up @@ -67,7 +68,7 @@ import "@h2d2/shopicons/es/filled/lightning";

import Loadpoint from "./Loadpoint.vue";
import { defineComponent, type PropType } from "vue";
import type { UiLoadpoint, SMART_COST_TYPE, Timeout, Vehicle } from "@/types/evcc";
import type { UiLoadpoint, SMART_COST_TYPE, Timeout, Vehicle, BATTERY_MODE } from "@/types/evcc";

export default defineComponent({
name: "Loadpoints",
Expand All @@ -87,6 +88,7 @@ export default defineComponent({
pvConfigured: Boolean,
batteryConfigured: Boolean,
batterySoc: Number,
batteryMode: String as PropType<BATTERY_MODE>,
forecast: Object, // as PropType<Forecast>,
},
emits: ["id-changed"],
Expand Down
4 changes: 3 additions & 1 deletion assets/js/components/Site/Site.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
:pvConfigured="pvConfigured"
:batteryConfigured="batteryConfigured"
:batterySoc="batterySoc"
:batteryMode="batteryMode"
:forecast="forecast"
:selectedId="selectedLoadpointId"
@id-changed="selectedLoadpointChanged"
Expand Down Expand Up @@ -98,6 +99,7 @@ import type {
Sponsor,
FatalError,
EvOpt,
BATTERY_MODE,
} from "@/types/evcc";
import store from "@/store";
import type { Grid } from "./types";
Expand Down Expand Up @@ -131,7 +133,7 @@ export default defineComponent({
batteryDischargeControl: Boolean,
batteryGridChargeLimit: { type: Number, default: null },
batteryGridChargeActive: Boolean,
batteryMode: String,
batteryMode: String as PropType<BATTERY_MODE>,
battery: { type: Object as PropType<Battery> },
gridCurrents: Array,
prioritySoc: Number,
Expand Down
9 changes: 8 additions & 1 deletion assets/js/components/Vehicles/Vehicle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ import LimitSocSelect from "./LimitSocSelect.vue";
import LimitEnergySelect from "./LimitEnergySelect.vue";
import { distanceUnit, distanceValue } from "@/units.ts";
import { defineComponent, type PropType } from "vue";
import { CHARGE_MODE, type Forecast, type VehicleStatus, type Vehicle } from "@/types/evcc";
import {
CHARGE_MODE,
type BATTERY_MODE,
type Forecast,
type VehicleStatus,
type Vehicle,
} from "@/types/evcc";
import type { PlanStrategy } from "@/components/ChargingPlans/types";
import BatteryBoostButton from "../Loadpoints/BatteryBoostButton.vue";

Expand Down Expand Up @@ -121,6 +127,7 @@ export default defineComponent({
batteryBoostAvailable: Boolean,
batteryBoostLimit: { type: Number, default: 100 },
batterySoc: Number,
batteryMode: String as PropType<BATTERY_MODE>,
enabled: Boolean,
heating: Boolean,
id: [String, Number],
Expand Down
8 changes: 8 additions & 0 deletions assets/js/types/evcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface State {
system?: string;
timezone?: string;
battery?: Battery;
batteryMode?: BATTERY_MODE;
pv?: Meter[];
aux?: Meter[];
ext?: Meter[];
Expand Down Expand Up @@ -357,6 +358,13 @@ export enum CHARGE_MODE {
PV = "pv",
}

export enum BATTERY_MODE {
UNKNOWN = "unknown",
NORMAL = "normal",
HOLD = "hold",
CHARGE = "charge",
}

export enum PHASES {
AUTO = 0,
ONE_PHASE = 1,
Expand Down
2 changes: 2 additions & 0 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@
"once": "Boost ist für diesen Ladevorgang aktiviert.",
"stateActive": "Batterie Boost aktiv",
"stateBelowLimit": "Batterie zu niedrig für Boost",
"stateHold": "Batterie gesperrt",
"stateReady": "Batterie Boost bereit"
},
"batteryUsage": "Hausbatterie",
Expand Down Expand Up @@ -1237,6 +1238,7 @@
"batteryBoostBelowLimit": "Batterie zu niedrig für Boost.",
"batteryBoostDisabled": "Batterie Boost deaktiviert.",
"batteryBoostEnabled": "Boost bis Batterie bei {limit}.",
"batteryBoostHold": "Batterie gesperrt. Boost nicht verfügbar.",
"charging": "Ladevorgang aktiv …",
"cheapEnergyCharging": "Günstige Energie verfügbar.",
"cheapEnergyNextStart": "Günstige Energie in {duration}.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@
"once": "Boost active for this charging session.",
"stateActive": "Battery boost active",
"stateBelowLimit": "Battery too low for boost",
"stateHold": "Battery locked",
"stateReady": "Battery boost ready"
},
"batteryUsage": "Home Battery",
Expand Down Expand Up @@ -1237,6 +1238,7 @@
"batteryBoostBelowLimit": "Battery too low for boost.",
"batteryBoostDisabled": "Battery boost disabled.",
"batteryBoostEnabled": "Boost until battery at {limit}.",
"batteryBoostHold": "Battery locked. Boost not available.",
"charging": "Charging…",
"cheapEnergyCharging": "Cheap energy available.",
"cheapEnergyNextStart": "Cheap energy in {duration}.",
Expand Down
2 changes: 1 addition & 1 deletion server/mcp/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@
},
"/loadpoints/{id}/batteryboost/{enable}": {
"post": {
"description": "Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit.",
"description": "Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit. Note: boost will not work while the battery is on hold (e.g. during fast charging or planned charging with discharge prevention enabled).",
"externalDocs": {
"url": "https://docs.evcc.io/en/docs/features/battery#battery-boost"
},
Expand Down
2 changes: 1 addition & 1 deletion server/mcp/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ call removeLoadpointVehicle {

## setLoadpointBatteryBoost

Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit.
Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit. Note: boost will not work while the battery is on hold (e.g. during fast charging or planned charging with discharge prevention enabled).

**Tags:** loadpoints

Expand Down
2 changes: 1 addition & 1 deletion server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ paths:
post:
operationId: setLoadpointBatteryBoost
summary: Set battery boost
description: "Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit."
description: "Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit. Note: boost will not work while the battery is on hold (e.g. during fast charging or planned charging with discharge prevention enabled)."
externalDocs:
url: https://docs.evcc.io/en/docs/features/battery#battery-boost
tags:
Expand Down
20 changes: 20 additions & 0 deletions tests/battery-settings.evcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ loadpoints:
- title: Carport
charger: charger
mode: now
- title: Garage
charger: charger2
mode: off

chargers:
- name: charger
Expand All @@ -56,6 +59,23 @@ chargers:
source: js
script: |
16
- name: charger2
type: custom
enable:
source: js
script:
enabled:
source: js
script: |
true
status:
source: js
script: |
"C"
maxcurrent:
source: js
script: |
16

tariffs:
currency: EUR
Expand Down
Loading
Loading