Replies: 9 comments 2 replies
-
I will have a look in the source code HyundaiBlueLinkAPIUSA.py to see what is available in hyundai_kia_connect_api. In the mean time, can you post a screenshot of monitor.dailystats spreadsheet and also the standard output of running dailystats.py? So I better understand what is provided in USA in combination with the source code. |
Beta Was this translation helpful? Give feedback.
-
I looked at the source code and also at the PDF and monitor.dailystats.csv.
For 1. this could be fixed by sorting when assigning this to vehicle.daily_stats (via setter) instead of doing this at each implementation For 2. this could be fixed by figuring out the information in the bluelink API, e.g. by execution hyundai_kia_connect_monitor.debug.py and see if the trip information is available in the returned data for HyundaiBlueLinkAPIUSA.py. Note that you could look at the implementation of method update_day_trip_info in KiaUvoApiEU.py, KiaUvoApiAU.py and KiaUvoApiCN.py. But then the API has to be figured out, like in method _get_trip_info in the previous mentioned implementations.
This is because the trip data is other information, the dailystats only shows the last entry of a day. Trip info must be implemented in update_day_trip_info to have the trip information. Hope this makes sense for you. |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your observations regarding the cause of the anomalies. |
Beta Was this translation helpful? Give feedback.
-
For problem 1 I made a fix, based on hyundai_kia_connect_api-3.22.7 by sorting in the setter in Vehicle.py. See attached the zip with the changes. Just unpack and move the files in hyundai_kia_connect_api to hyundai_kia_connect_monitor.hyundai_kia_connect_api For problem 2 we need further discussion how we can find the api for the trip information (if available). |
Beta Was this translation helpful? Give feedback.
-
Well, the trip turned out to have 4 legs:
|
Beta Was this translation helpful? Give feedback.
-
Seems that my changes did not work, there is still a repetition in the data.....
Is the sorting not working? Can you mail me the output of "python debug.py" to my gmail account zuinige.rijder, because debug logging shows if it sorts and the sorting before and after. |
Beta Was this translation helpful? Give feedback.
-
Another IONIQ 5 USA user did mail me a debug.log file and I see that the dailystats API returns different information than in Europe. More specific, in USA you have daily stats information for all trips (so no cumulative value, but for each trip the actual values), in Europe only the cumulative latest value per day. I was expecting only one dailystats value per day in monitor.py. So besides the sorting, something else has to be done. I need to think for an elegant solution......because the data is really different if you talk about cumulative data on a day (Europe) or for each trip the exact data (USA). One simple solution is to also compute the cumulative values for USA in HyundaiBlueLinkAPIUSA.py, so the returned data is the same. Actually the DailyStats USA data is richer than in Europe, but in Europe we have separate trip data call with start and end-time and other information. In DailyStats USA it is a combination, there is a start date and duration is in the returned data, including speed, etc.. So probably with the information returned in USA you could compose DailyStats and trip information........but this is complex. Maybe we should move this discussion to hyundai_kia_connect_api, so others can also contribute? |
Beta Was this translation helpful? Give feedback.
-
Yes, let's move this to gitHub (without the debug log files I and the other Ioniq 5 user uploaded).
I suppose that this means that trip information is available in the U.S. after all - it's just in a different place than in Europe.
I wonder why Hyundai goes to all the trouble of writing significantly different apis for different markets.
--Ian
On Thursday, August 22, 2024 at 01:01:22 PM PDT, Zuinige Rijder ***@***.***> wrote:
Another IONIQ 5 USA user did mail me a debug.log file and I see that the dailystats API returns different information than in Europe.
In Europe only the latest server values of a day are returned, In USA multiple server values of a day are returned, including the timestamp.
More specific, in USA you have daily stats information for all trips (so no cumulative value, but for each trip the actual values), in Europe only the cumulative latest value per day.
I was expecting only one dailystats value per day in monitor.py. So besides the sorting, something else has to be done. I need to think for an elegant solution......because the data is really different if you talk about cumulative data on a day (Europe) or for each trip the exact data (USA).
One simple solution is to also compute the cumulative values for USA in HyundaiBlueLinkAPIUSA.py, so the returned data is the same. Actually the DailyStats USA data is richer than in Europe, but in Europe we have separate trip data call with start and end-time and other information. In DailyStats USA it is a combination, there is a start date and duration is in the returned data, including speed, etc.. So probably with the information returned in USA you could compose DailyStats and trip information........but this is complex.
Maybe we should move this discussion to hyundai_kia_connect_api, so others can also contribute?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Discussion continues with this issue in hyundai_kia_connect_api. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your advice regarding not exceeding the api access limitation. I have devised a daily schedule that provides the data I need without exceeding this limitation. Since I started using the schedule, run_monitor_once.sh appears to run consistently and updates the monitor.csv file and the monitor spreadsheet with data that makes sense.
That said, I’m curious as to what is meant in README.md by “only available for Europe” with reference to monitor.dailystats.csv and monitor.tripinfo.csv. run_monitor_once.sh appears to update monitor.dailystats.csv and the monitor.dailystats spreadsheet, but appears not to update monitor.tripinfo.csv. Moreover, although some of the data with which monitor.dailystats.csv is updated makes sense, the data for each trip in a given day is repeated at hourly intervals from the time at which it first appears until data for the first trip of the next day appears (and repeats). Also the monitor.dailystats spreadsheet only displays data for the last trip of the day, no matter how short. So it looks like the dailystats data is available in the U.S, but monitor.dailystats.py is not handling it correctly.
Can this be fixed?
Beta Was this translation helpful? Give feedback.
All reactions