kovacsbalu / WazeRouteCalculator

Calculate actual route time and distance with Waze api
GNU General Public License v3.0
144 stars 57 forks source link

Can we have a release with the latest changes please? #65

Closed k-korn closed 2 years ago

k-korn commented 2 years ago

Commit https://github.com/kovacsbalu/WazeRouteCalculator/commit/a502c656320b7f72a57e40c5f3c8867b2f58b708 fixes some issues introduced by Waze API changes. For example, Home Assistant Waze integration is currently broken (https://github.com/home-assistant/core/issues/61251) because HA uses WazeRouteCalculator==0.13 as a dependency.

Could you please release a new version of this awesome library with the latest changes included so HA bug can be fixed without hacks like manual replacement of WazeRouteCalculator?

Latest code works perfectly and needs no changes - only a new release is needed.

Smandurlo commented 2 years ago

It does not work perfectly, it doesn't calculate the correct time.

kovacsbalu commented 2 years ago

@Smandurlo can you please give an example?

Smandurlo commented 2 years ago

https://github.com/home-assistant/core/issues/61572

fi-sch commented 2 years ago

home-assistant/core#61572

This is not caused by the changes that @k-korn asked to release. Your issue is probably caused by something else.

Smandurlo commented 2 years ago

But it is not working perfectly as stated. Why to release something that is still buggy?

Il mar 4 gen 2022, 12:01 fi-sch @.***> ha scritto:

home-assistant/core#61572 https://github.com/home-assistant/core/issues/61572

This is not caused by the changes that @k-korn https://github.com/k-korn asked to release. Your issue is probably caused by something else.

— Reply to this email directly, view it on GitHub https://github.com/kovacsbalu/WazeRouteCalculator/issues/65#issuecomment-1004713208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXTCZNDIE5YS4OQBJ45C63UULHRRANCNFSM5LFLT75A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

fi-sch commented 2 years ago

But it is not working perfectly as stated. Why to release something that is still buggy?

What makes you conclude that the issue is on this library's side, not Home Assistant's side?

Smandurlo commented 2 years ago

From A to B time is totally wrong, from B to A time is wrong, but at least possible. HA gets the minutes from the integration, isn't it? So, if A to B is 6 min and B to A is 1630 min, I think the problem is the one who calculates the minutes, not the one that shows the results. But of course I might be wrong. Anyway, there is something buggy somewhere.

Il giorno mar 4 gen 2022 alle ore 12:10 fi-sch @.***> ha scritto:

But it is not working perfectly as stated. Why to release something that is still buggy?

What makes you conclude that the issue is on this library's side, not Home Assistant's side?

— Reply to this email directly, view it on GitHub https://github.com/kovacsbalu/WazeRouteCalculator/issues/65#issuecomment-1004719005, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXTCZP2QE7NNEXXAZQAYK3UULISTANCNFSM5LFLT75A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

kovacsbalu commented 2 years ago

@Smandurlo, could you provide more accurate information about the calculated route? From - to address? Not your own address, just some similar. I'm not using this lib in HA so I don't know how is it work. You can clone my repo and fill example.py with your data. Can you test with previous version also?

@k-korn Let me check these issues and I will release soon.

@fi-sch thanks ;)

Smandurlo commented 2 years ago

@kovacsbalu I will try to, but I am not that skilled with linux, so not sure I will be able to. I can give you coordinates, I don't mind. They are "pubblic places", you can both see and rent them on airbnb and booking :-)

latitude: 42.6688309 longitude: 13.6820182

latitude: 37.138199 longitude: -7.5953

fi-sch commented 2 years ago

@kovacsbalu Take a peek here: https://github.com/home-assistant/core/issues/61572#issuecomment-1004742067

Smandurlo commented 2 years ago

I tried your code with just the cities and it works. I need to understand how to use the coordinates :-)

@.***:~/WazeRouteCalculator # python3 example.py From: Teramo, Italy - to: Cabanas de Tavira, Portugal Start coords: (42.673004150390625, 13.739128112792969) End coords: (37.139888763427734, -7.594666957855225) Time 1361.15 minutes, distance 2626.32 km

Il giorno mar 4 gen 2022 alle ore 13:16 fi-sch @.***> ha scritto:

@kovacsbalu https://github.com/kovacsbalu Take a peek here: home-assistant/core#61572 (comment) https://github.com/home-assistant/core/issues/61572#issuecomment-1004742067

— Reply to this email directly, view it on GitHub https://github.com/kovacsbalu/WazeRouteCalculator/issues/65#issuecomment-1004759208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXTCZLBFYCJT6MPLFLOX6DUULQK5ANCNFSM5LFLT75A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

Smandurlo commented 2 years ago

@.***:~/WazeRouteCalculator # python3 example.py From: 42.6688, 13.6820 - to: 37.1381, -7.5953 Start coords: (42.6688, 13.6820) End coords: (37.1381, -7.5953) Internal Error

I tried 3 previous releases (git checkout -b xxxxx) and I get Internal Error in every version.

k-korn commented 2 years ago

Time 1361.15 minutes, distance 2626.32 km

As far as I know, Waze in general is more city-oriented and works well with routes up to couple hundreds of km. On long routes like this there may be some issues (unable to calculate the route, etc) even in Waze app itself.

For example, on the LiveMap this route takes 15-20 seconds for Waze servers to compute, and the response is a 3 megabyte JSON containing 3 alternate routes with 25k points each: https://i.imgur.com/mXQIN3C.png

Smandurlo commented 2 years ago

I checked with the app and it works, never had an issue. The problem is not to calculate this long distance travel (it is useless), but at the moment it shows less than 10 minutes to home and it messes up with other automations based on short distance.

Some people will have the same problem when too far, but very close for HA.

Il mar 4 gen 2022, 16:07 Korn @.***> ha scritto:

Time 1361.15 minutes, distance 2626.32 km

As far as I know, Waze in general is more city-oriented and works well with routes up to couple hundreds of km. On long routes like this there may be some issues (unable to calculate the route, etc) even in Waze app itself.

For example, on the LiveMap https://www.waze.com/en-GB/live-map/directions?to=ll.37.1381%2C-7.5953&from=ll.42.6688%2C13.682 this route takes 15-20 seconds for Waze servers to compute, and the response is a 3 megabyte JSON containing 3 alternate routes with 25k points each: https://i.imgur.com/mXQIN3C.png

— Reply to this email directly, view it on GitHub https://github.com/kovacsbalu/WazeRouteCalculator/issues/65#issuecomment-1004889929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXTCZLEKZLFYASB7W3WG2TUUMEMVANCNFSM5LFLT75A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

kovacsbalu commented 2 years ago

@k-korn, 0.14 relased :) @Smandurlo, I tried your coords with waze editor route calculator and also received an "Internal error". I don't know why....let me investigate this further.

k-korn commented 2 years ago

Thanks!

kovacsbalu commented 2 years ago

@Smandurlo: probably your issue is relates to #63. I checked long routes and got internal error over 5000 road segment (size of json data). With #63 fix AVOID_TOLL_ROADS:f the segment number decreased from 4917 to 1911 in my longest test route. I will cretae release 0.15 soon and you can check your route or edit the code and add self.route_options.append('AVOID_TOLL_ROADS:f') line to def get_route(... function for testing.

Smandurlo commented 2 years ago

Thanks :-) I will test my linux skills first to test it 😂

Smandurlo commented 2 years ago

@kovacsbalu I think I was able to follow your instructions (I am self impressed and pleased LOL) and it seems I get a proper route and time! I will try to replace the file in my HA in Portugal and report. Should I write here or somewhere else?

root@omv:~/WazeRouteCalculator # python3 example.py From: 42.6688, 13.6820 - to: 37.1381, -7.5953 Start coords: (42.6688, 13.6820) End coords: (37.1381, -7.5953) Time 1366.08 minutes, distance 2628.80 km