Vehicles: add maximum power, improves planner (#25303)
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de> Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
parent
b6c3d55608
commit
38e86fe73d
8 changed files with 57 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ type ActionConfig struct {
|
|||
Priority int `mapstructure:"priority,omitempty"` // Priority
|
||||
MinCurrent float64 `mapstructure:"minCurrent,omitempty"` // Minimum Current
|
||||
MaxCurrent float64 `mapstructure:"maxCurrent,omitempty"` // Maximum Current
|
||||
MaxPower float64 `mapstructure:"maxPower,omitempty"` // Maximum Charging Power
|
||||
}
|
||||
|
||||
// String implements Stringer and returns the ActionConfig as comma-separated key:value string
|
||||
|
|
@ -38,6 +39,10 @@ func (a ActionConfig) GetMaxCurrent() (float64, bool) {
|
|||
return a.MaxCurrent, a.MaxCurrent > 0
|
||||
}
|
||||
|
||||
func (a ActionConfig) GetMaxPower() (float64, bool) {
|
||||
return a.MaxPower, a.MaxPower > 0
|
||||
}
|
||||
|
||||
func (a ActionConfig) GetPriority() (int, bool) {
|
||||
return a.Priority, a.Priority > 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,21 @@
|
|||
</FormRow>
|
||||
</div>
|
||||
|
||||
<FormRow
|
||||
id="vehicleParamMaxPower"
|
||||
:label="$t('config.vehicle.maximumPower')"
|
||||
:help="$t('config.vehicle.maximumPowerHelp')"
|
||||
>
|
||||
<PropertyField
|
||||
id="vehicleParamMaxPower"
|
||||
v-model="values.maxPower"
|
||||
type="Float"
|
||||
unit="W"
|
||||
size="w-25 w-min-200"
|
||||
class="me-2"
|
||||
/>
|
||||
</FormRow>
|
||||
|
||||
<FormRow
|
||||
id="vehicleParamPriority"
|
||||
:label="$t('config.vehicle.priority')"
|
||||
|
|
@ -149,7 +164,15 @@ const initialValues = {
|
|||
yaml: undefined,
|
||||
template: null,
|
||||
};
|
||||
const CUSTOM_FIELDS = ["minCurrent", "maxCurrent", "priority", "identifiers", "phases", "mode"];
|
||||
const CUSTOM_FIELDS = [
|
||||
"minCurrent",
|
||||
"maxCurrent",
|
||||
"maxPower",
|
||||
"priority",
|
||||
"identifiers",
|
||||
"phases",
|
||||
"mode",
|
||||
];
|
||||
|
||||
export default defineComponent({
|
||||
name: "VehicleModal",
|
||||
|
|
|
|||
|
|
@ -232,5 +232,10 @@ func (lp *Loadpoint) EffectiveMaxPower() float64 {
|
|||
|
||||
// effectiveMaxPower returns the effective max power taking vehicle capabilities and phase scaling into account
|
||||
func (lp *Loadpoint) effectiveMaxPower() float64 {
|
||||
if lp.vehicle != nil {
|
||||
if maxPower, ok := lp.vehicle.OnIdentified().GetMaxPower(); ok {
|
||||
return maxPower
|
||||
}
|
||||
}
|
||||
return Voltage * lp.effectiveMaxCurrent() * float64(lp.maxActivePhases())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ type vehicleStruct struct {
|
|||
LimitSoc int `json:"limitSoc,omitempty"`
|
||||
MinCurrent float64 `json:"minCurrent,omitempty"`
|
||||
MaxCurrent float64 `json:"maxCurrent,omitempty"`
|
||||
MaxPower float64 `json:"maxPower,omitempty"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
Features []string `json:"features,omitempty"`
|
||||
Plan *planStruct `json:"plan,omitempty"`
|
||||
|
|
@ -60,6 +61,7 @@ func (site *Site) publishVehicles() {
|
|||
LimitSoc: v.GetLimitSoc(),
|
||||
MinCurrent: ac.MinCurrent,
|
||||
MaxCurrent: ac.MaxCurrent,
|
||||
MaxPower: ac.MaxPower,
|
||||
Priority: ac.Priority,
|
||||
Features: lo.Map(instance.Features(), func(f api.Feature, _ int) string { return f.String() }),
|
||||
Plan: plan,
|
||||
|
|
|
|||
|
|
@ -640,6 +640,8 @@
|
|||
"maximumCurrentHelp": "Muss größer als der minimale Strom sein.",
|
||||
"maximumPhases": "Maximale Phasen",
|
||||
"maximumPhasesHelp": "Mit wie vielen Phasen kann dieses Fahrzeug laden? Wird zur Berechnung der Mindestladeleistung und im Planer verwendet.",
|
||||
"maximumPower": "Maximale Ladeleistung",
|
||||
"maximumPowerHelp": "Maximale Leistung die das Fahrzeug beziehen kann.",
|
||||
"minimumCurrent": "Minimaler Strom",
|
||||
"minimumCurrentHelp": "Nur unter 6A, wenn du weißt, was du tust.",
|
||||
"online": "Fahrzeuge mit Schnittstelle",
|
||||
|
|
|
|||
|
|
@ -640,6 +640,8 @@
|
|||
"maximumCurrentHelp": "Must be greater than minimum current.",
|
||||
"maximumPhases": "Maximum phases",
|
||||
"maximumPhasesHelp": "How many phases can this vehicle charge with? Used to calculate required minimum solar surplus and plan duration.",
|
||||
"maximumPower": "Maximum charging power",
|
||||
"maximumPowerHelp": "Maximum power the vehicle can consume",
|
||||
"minimumCurrent": "Minimum current",
|
||||
"minimumCurrentHelp": "Only go below 6A if you know what you're doing.",
|
||||
"online": "Vehicles with online API",
|
||||
|
|
|
|||
|
|
@ -166,6 +166,15 @@ params:
|
|||
en: The maximum amperage per connected phase that can be used
|
||||
example: 16
|
||||
type: int
|
||||
- name: maxpower
|
||||
unit: W
|
||||
description:
|
||||
de: Maximale Ladeleistung des Fahrzeugs
|
||||
en: Maximum vehicle charging power
|
||||
help:
|
||||
de: Definiert die maximale Ladeleistung des Fahrzeugs. Hilft, die Ladeplanung zu verbessern, wenn das Fahrzeug üblicherweise weniger Strom nutzt als angeboten oder höhere Ströme bei einphasigem Laden erlaubt als bei dreiphasigem. Der bereitgestellte Strom des Ladepunktes wird nicht beeinflusst.
|
||||
en: Defines the maximum charging power of the vehicle. Helps improve charge plan accuracy when the vehicle typically uses less than the offered current or supports higher single-phase current compared to three-phase. The offered current of the loadpoint is not affected.
|
||||
type: int
|
||||
- name: identifiers
|
||||
description:
|
||||
de: Identifikation
|
||||
|
|
@ -469,6 +478,8 @@ presets:
|
|||
advanced: true
|
||||
- name: maxCurrent
|
||||
advanced: true
|
||||
- name: maxPower
|
||||
advanced: true
|
||||
- name: identifiers
|
||||
advanced: true
|
||||
- name: priority
|
||||
|
|
@ -490,6 +501,8 @@ presets:
|
|||
advanced: true
|
||||
- name: maxCurrent
|
||||
advanced: true
|
||||
- name: maxPower
|
||||
advanced: true
|
||||
- name: identifiers
|
||||
advanced: true
|
||||
- name: priority
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ capacity: {{ .capacity }}
|
|||
phases: {{ .phases }}
|
||||
{{- end }}
|
||||
|
||||
{{- if or .mode .minCurrent .maxCurrent .priority }}
|
||||
{{- if or .mode .minCurrent .maxCurrent .maxPower .priority }}
|
||||
onIdentify:
|
||||
{{- if .mode }}
|
||||
mode: {{ .mode }}
|
||||
|
|
@ -23,6 +23,9 @@ onIdentify:
|
|||
{{- if .maxCurrent }}
|
||||
maxCurrent: {{ .maxCurrent }}
|
||||
{{- end }}
|
||||
{{- if .maxPower }}
|
||||
maxPower: {{ .maxPower }}
|
||||
{{- end }}
|
||||
{{- if .priority }}
|
||||
priority: {{ .priority }}
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue