matth-x / MicroOcppSimulator

GNU General Public License v3.0
98 stars 44 forks source link

Energy, Power, Current, Voltage value are always 0 #36

Open vcba79 opened 1 week ago

vcba79 commented 1 week ago

Hi,

I am evaluating this simulator. Simulator and web are built smoothly but energy, power, current, voltage in web are always 0, before charge and after charge. I searched around but can not find a solution. Do I have to modify any file to get those values displayed? I modify evse.h and evse.cpp and those values can display constantly but setchargingprofile will not limit power value.

any hint?

Thanks,

vcba79 commented 1 week ago

I found this patch will display values after charging started. Please correct me if I am doing wrong.

diff --git a/src/evse.cpp b/src/evse.cpp index a0261d6..3310300 100644 --- a/src/evse.cpp +++ b/src/evse.cpp @@ -119,14 +119,13 @@ void Evse::setup() { }

void Evse::loop() {

 auto curStatus = getChargePointStatus(connectorId);

 if (status.compare(MicroOcpp::cstrFromOcppEveState(curStatus))) {
     status = MicroOcpp::cstrFromOcppEveState(curStatus);
 }

diff --git a/src/evse.h b/src/evse.h index eaf37dc..bf028d5 100644 --- a/src/evse.h +++ b/src/evse.h @@ -26,11 +26,11 @@ private: std::string trackEvseReadyKey;

 const float SIMULATE_POWER_CONST = 11000.f;