diff --git a/packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue b/packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue index 68103c089d..b1aac0ac68 100644 --- a/packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue +++ b/packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue @@ -18,7 +18,7 @@ :max="300" :step="1" unit="kW" - v-model="pvMinDcCurrent.value" + v-model="pvMinDcPower.value" class="q-mt-md" /> @@ -89,6 +89,17 @@ v-model="pvMinSocCurrent.value" class="q-mt-md" /> + +
Anzahl Phasen Mindest-SoC
@@ -158,10 +169,14 @@ const pvMinCurrent = computed(() => const dcCharging = computed(() => mqttStore.dcChargingEnabled); -const pvMinDcCurrent = computed(() => +const pvMinDcPower = computed(() => mqttStore.chargePointConnectedVehiclePvDcChargePower(props.chargePointId), ); +const pvMinDcMinSocPower = computed(() => + mqttStore.chargePointConnectedVehiclePvDcMinSocPower(props.chargePointId), +); + const numPhases = computed(() => mqttStore.chargePointConnectedVehiclePvChargePhases(props.chargePointId), ); diff --git a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts index 00f481b9c8..a7cba6a1de 100644 --- a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts +++ b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts @@ -981,7 +981,7 @@ export const useMqttStore = defineStore('mqtt', () => { chargePointConnectedVehicleChargeTemplate(chargePointId).value ?.chargemode?.instant_charging?.dc_current; if (dcCurrent !== undefined) { - return (dcCurrent * 3 * 230) / 1000; + return Math.round((dcCurrent * 3 * 230) / 1000); } else { return 0; } @@ -1144,7 +1144,7 @@ export const useMqttStore = defineStore('mqtt', () => { chargePointConnectedVehicleChargeTemplate(chargePointId).value ?.chargemode?.pv_charging?.dc_min_current; if (dcMinCurrent !== undefined) { - return (dcMinCurrent * 3 * 230) / 1000; + return Math.round((dcMinCurrent * 3 * 230) / 1000); } else { return 0; } @@ -1162,6 +1162,38 @@ export const useMqttStore = defineStore('mqtt', () => { }); }; + /** + * Get or set the charge point connected vehicle PV charging DC minimum SoC Power identified by the charge point id + * @param chargePointId charge point id + * @returns number + */ + const chargePointConnectedVehiclePvDcMinSocPower = ( + chargePointId: number, + ) => { + return computed({ + get() { + const dcMinSocCurrent = + chargePointConnectedVehicleChargeTemplate(chargePointId).value + ?.chargemode?.pv_charging?.dc_min_soc_current; + if (dcMinSocCurrent !== undefined) { + return Math.round((dcMinSocCurrent * 3 * 230) / 1000); + } else { + return 0; + } + }, + set(newValue: number) { + console.debug('set instant charging power', newValue, chargePointId); + const newPower = (newValue * 1000) / 230 / 3; + return updateTopic( + `openWB/chargepoint/${chargePointId}/set/charge_template`, + newPower, + 'chargemode.pv_charging.dc_min_soc_current', + true, + ); + }, + }); + }; + /** * Get or set the charge point connected vehicle pv min SoC identified by the charge point id * @param chargePointId charge point id @@ -1405,7 +1437,7 @@ export const useMqttStore = defineStore('mqtt', () => { chargePointConnectedVehicleChargeTemplate(chargePointId).value ?.chargemode?.eco_charging?.dc_current; if (dcCurrent !== undefined) { - return (dcCurrent * 3 * 230) / 1000; + return Math.round((dcCurrent * 3 * 230) / 1000); } else { return 0; } @@ -2762,6 +2794,7 @@ export const useMqttStore = defineStore('mqtt', () => { chargePointConnectedVehiclePvChargeMinSoc, chargePointConnectedVehiclePvChargeMinSocCurrent, chargePointConnectedVehiclePvDcChargePower, + chargePointConnectedVehiclePvDcMinSocPower, chargePointConnectedVehiclePvChargePhasesMinSoc, chargePointConnectedVehiclePvChargeFeedInLimit, chargePointConnectedVehicleEcoChargeCurrent,