@@ -54,6 +54,9 @@ void Evse::setup() {
5454 snprintf (key, 30 , " evPlugged_cId_%u" , connectorId);
5555 trackEvPluggedKey = key;
5656 trackEvPluggedBool = MicroOcpp::declareConfiguration (trackEvPluggedKey.c_str (), false , SIMULATOR_FN, false , false , false );
57+ snprintf (key, 30 , " evsePlugged_cId_%u" , connectorId);
58+ trackEvsePluggedKey = key;
59+ trackEvsePluggedBool = MicroOcpp::declareConfiguration (trackEvsePluggedKey.c_str (), false , SIMULATOR_FN, false , false , false );
5760 snprintf (key, 30 , " evReady_cId_%u" , connectorId);
5861 trackEvReadyKey = key;
5962 trackEvReadyBool = MicroOcpp::declareConfiguration (trackEvReadyKey.c_str (), false , SIMULATOR_FN, false , false , false );
@@ -139,7 +142,7 @@ void Evse::loop() {
139142 }
140143 }
141144
142- bool simulate_isCharging = ocppPermitsCharge (connectorId) && trackEvPluggedBool->getBool () && trackEvReadyBool->getBool () && trackEvseReadyBool->getBool ();
145+ bool simulate_isCharging = ocppPermitsCharge (connectorId) && trackEvPluggedBool->getBool () && trackEvsePluggedBool-> getBool () && trackEvReadyBool->getBool () && trackEvseReadyBool->getBool ();
143146
144147 simulate_isCharging &= limit_power >= 720 .f ; // minimum charging current is 6A (720W for 120V grids) according to J1772
145148
@@ -209,6 +212,17 @@ bool Evse::getEvPlugged() {
209212 return trackEvPluggedBool->getBool ();
210213}
211214
215+ void Evse::setEvsePlugged (bool plugged) {
216+ if (!trackEvsePluggedBool) return ;
217+ trackEvsePluggedBool->setBool (plugged);
218+ MicroOcpp::configuration_save ();
219+ }
220+
221+ bool Evse::getEvsePlugged () {
222+ if (!trackEvsePluggedBool) return false ;
223+ return trackEvsePluggedBool->getBool ();
224+ }
225+
212226void Evse::setEvReady (bool ready) {
213227 if (!trackEvReadyBool) return ;
214228 trackEvReadyBool->setBool (ready);
0 commit comments