@@ -981,7 +981,7 @@ export const useMqttStore = defineStore('mqtt', () => {
981981 chargePointConnectedVehicleChargeTemplate ( chargePointId ) . value
982982 ?. chargemode ?. instant_charging ?. dc_current ;
983983 if ( dcCurrent !== undefined ) {
984- return ( dcCurrent * 3 * 230 ) / 1000 ;
984+ return Math . round ( ( dcCurrent * 3 * 230 ) / 1000 ) ;
985985 } else {
986986 return 0 ;
987987 }
@@ -1144,7 +1144,7 @@ export const useMqttStore = defineStore('mqtt', () => {
11441144 chargePointConnectedVehicleChargeTemplate ( chargePointId ) . value
11451145 ?. chargemode ?. pv_charging ?. dc_min_current ;
11461146 if ( dcMinCurrent !== undefined ) {
1147- return ( dcMinCurrent * 3 * 230 ) / 1000 ;
1147+ return Math . round ( ( dcMinCurrent * 3 * 230 ) / 1000 ) ;
11481148 } else {
11491149 return 0 ;
11501150 }
@@ -1162,6 +1162,38 @@ export const useMqttStore = defineStore('mqtt', () => {
11621162 } ) ;
11631163 } ;
11641164
1165+ /**
1166+ * Get or set the charge point connected vehicle PV charging DC minimum SoC Power identified by the charge point id
1167+ * @param chargePointId charge point id
1168+ * @returns number
1169+ */
1170+ const chargePointConnectedVehiclePvDcMinSocPower = (
1171+ chargePointId : number ,
1172+ ) => {
1173+ return computed ( {
1174+ get ( ) {
1175+ const dcMinSocCurrent =
1176+ chargePointConnectedVehicleChargeTemplate ( chargePointId ) . value
1177+ ?. chargemode ?. pv_charging ?. dc_min_soc_current ;
1178+ if ( dcMinSocCurrent !== undefined ) {
1179+ return Math . round ( ( dcMinSocCurrent * 3 * 230 ) / 1000 ) ;
1180+ } else {
1181+ return 0 ;
1182+ }
1183+ } ,
1184+ set ( newValue : number ) {
1185+ console . debug ( 'set instant charging power' , newValue , chargePointId ) ;
1186+ const newPower = ( newValue * 1000 ) / 230 / 3 ;
1187+ return updateTopic (
1188+ `openWB/chargepoint/${ chargePointId } /set/charge_template` ,
1189+ newPower ,
1190+ 'chargemode.pv_charging.dc_min_soc_current' ,
1191+ true ,
1192+ ) ;
1193+ } ,
1194+ } ) ;
1195+ } ;
1196+
11651197 /**
11661198 * Get or set the charge point connected vehicle pv min SoC identified by the charge point id
11671199 * @param chargePointId charge point id
@@ -1405,7 +1437,7 @@ export const useMqttStore = defineStore('mqtt', () => {
14051437 chargePointConnectedVehicleChargeTemplate ( chargePointId ) . value
14061438 ?. chargemode ?. eco_charging ?. dc_current ;
14071439 if ( dcCurrent !== undefined ) {
1408- return ( dcCurrent * 3 * 230 ) / 1000 ;
1440+ return Math . round ( ( dcCurrent * 3 * 230 ) / 1000 ) ;
14091441 } else {
14101442 return 0 ;
14111443 }
@@ -2817,6 +2849,7 @@ export const useMqttStore = defineStore('mqtt', () => {
28172849 chargePointConnectedVehiclePvChargeMinSoc,
28182850 chargePointConnectedVehiclePvChargeMinSocCurrent,
28192851 chargePointConnectedVehiclePvDcChargePower,
2852+ chargePointConnectedVehiclePvDcMinSocPower,
28202853 chargePointConnectedVehiclePvChargePhasesMinSoc,
28212854 chargePointConnectedVehiclePvChargeFeedInLimit,
28222855 chargePointConnectedVehicleEcoChargeCurrent,
0 commit comments