pycarwings2 / get_latest_battery_status

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Ez2517

Member
Joined
Aug 27, 2020
Messages
17
Location
Vienna, Austria
Hi all,

maybe here is someone who played around with carwings and the pycarwings2 library.

I use the library to retrieve car information to use it in my home automation. I am calling the get_latest_battery_status function, however it seems that this function retrieves not the actual status (battery percentage) but the status at the time the previous call was made. Since I call the function only every 15 minutes, I always receive a 15 min old status.

Any ideas on how to retrieve the CURRENT battery status (except calling the function twice ?) Is there anything I am missing ?

Thanks a lot in advance
Brandy
 
Hi Brandy,

I am not familiar with pycarwings2, but I know that EV Connect (Nissan's application) calls the car (via text message) to obtain the status after a user request and it takes a little time to get the updated information. If the application is opened again, it displays the last status unless the user requests another update. Therefore, I believe the data you retrieve from Nissan's servers will be from the last update that was requested (so it will be 15 minutes old if you request data every 15 minutes).
 
Hi,

yes, seems something like that is the case. Anyway, I figured out how to change the leaf-python-mqtt.py file to get the most recent values from the car. One needs to call the request_update() call from pycarwings2 prior to calling the get_latest_battery_status(). Now I receive the current value.

Brandy
 
Back
Top