-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace old counter from OpenEVSE module with new EnergyMeter class on ESP #556
Conversation
Hi @KipK , these lines were a workaround for reading the updated total energy register during a charging session: The OCPP class expects the energy regsiter reading which accumulates all energy consumption over the lifetime of the EVSE. With the newest EnergyMeter class the workaround should be obsolete and can be removed: return (int32_t) evse->getTotalEnergy(); Can you replace those lines? |
done thanks |
Didn't see that you already updated it in the meantime. Yes, looks perfect 👍 |
cc5c245
to
7cdd51e
Compare
I've rebased the branch for review not network manager has merged. |
Can you remove the draft status if good to go? |
6d476cc
to
be3a376
Compare
I still have one last problem with this branch, the input.cpp loop doesn't seems to run as I don't get the create_rapi_json esach 30 sec anymore. |
I have found, it's because I've removed the getEnergyFromEvse(), was called each 2 sec and was triggering: without this input.cpp is not waken up anymore while not charging |
I need to check, but I think all you have to do is remove |
Thanks, looks clear now. I'm fixing this |
ok fixed & rebased |
…module Published properties: - session_elapsed : sec - session_energy : wh - total_energy : kwh - total_day : kwh - total_week : kwh - total_month : kwh - total_year : kwh - total_switches : number of times the relay has been commutated Evse counter is imported one time only. If counter is manually reset again, it won't import it the second time. add new api endpoint /emeter DELETE { "hard": 0|1 , "import": 0|1} edited api.yml
|
||
void EnergyMeter::increment_switch_counter() | ||
{ | ||
if (_switch_state != _monitor->isActive()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spotted a bug, I think this should be isCharging
to reflect switches of the relay, isActive will increent the count in other cases, eg if the car is not plugged it and the state toggeles from active to disabled.
Depends new network branch to be migrated first.
now gives :
Old OpenEvse total is imported to new counter when migrating first time, then a flag prevent to import it again if counters are reset.
fix #484