Ez2517
Posts: 5
Joined: Thu Aug 27, 2020 12:53 am
Delivery Date: 27 Jun 2020
Location: Vienna, Austria

pycarwings2 / get_latest_battery_status

Wed Dec 23, 2020 6:42 am

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

GerryAZ
Gold Member
Posts: 2954
Joined: Mon Nov 22, 2010 6:47 pm
Delivery Date: 12 Jun 2011
Location: Phoenix, AZ

Re: pycarwings2 / get_latest_battery_status

Wed Dec 23, 2020 8:46 pm

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).
Gerry
Silver LEAF 2011 SL rear ended (totaled) by in-attentive driver 1/4/2015 at 50,422 miles
Silver LEAF 2015 SL purchased 2/7/2015; traded 8/10/2019 at 82,436 miles
White LEAF 2019 SL Plus purchased 8/10/2019

Ez2517
Posts: 5
Joined: Thu Aug 27, 2020 12:53 am
Delivery Date: 27 Jun 2020
Location: Vienna, Austria

Re: pycarwings2 / get_latest_battery_status

Wed Mar 03, 2021 9:25 am

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

Return to “Range / Efficiency / Carwings”