Skip to content
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

Waze error - 0.89.2 #22022

Closed
edif30 opened this issue Mar 14, 2019 · 57 comments
Closed

Waze error - 0.89.2 #22022

edif30 opened this issue Mar 14, 2019 · 57 comments

Comments

@edif30
Copy link
Contributor

edif30 commented Mar 14, 2019

**Home Assistant release with the issue: 0.89.2

**Last working Home Assistant release (if known): 0.88.x

**Operating environment (Hass.io/Docker/Windows/etc.):Docker

**Component/platform: Waze Travel Time

Description of problem:

Waze throws errors and does not update sensor values.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

  - platform: waze_travel_time
    name: Work to Home
    origin: !secret work_park_addy_gps
    destination: !secret home_addy_gps
    region: 'US'

Traceback (if applicable):

2019-03-13 21:01:30 ERROR (SyncWorker_11) [homeassistant.components.sensor.waze_travel_time] Error on retrieving data: empty response
2019-03-13 21:01:30 ERROR (SyncWorker_3) [homeassistant.components.sensor.waze_travel_time] Error on retrieving data: empty response
2019-03-13 21:01:42 ERROR (SyncWorker_4) [homeassistant.components.sensor.waze_travel_time] Error on retrieving data: empty response
2019-03-13 21:01:43 ERROR (SyncWorker_9) [homeassistant.components.sensor.waze_travel_time] Error on retrieving data: empty response

Additional information:

@ikifar2012
Copy link
Member

I have this issue too

@ikifar2012
Copy link
Member

looks like it might be fixed in the next relase @edif30 see #22020

@edif30
Copy link
Contributor Author

edif30 commented Mar 14, 2019

@ikifar2012 I don't know this issue is related. But will keep an eye out. No reference to that error in that PR or other issue.

@ikifar2012
Copy link
Member

@edif30 i think it is read this issue it sounds very similar #21739 and it stopped working around the same time

@Petro31
Copy link
Contributor

Petro31 commented Mar 14, 2019

@edif30 @ikifar2012 none of those issues address the problem. The problem is being addressed in the WazeRouteCalculator. kovacsbalu/WazeRouteCalculator#37

When that PR is merged, this pr will be applied #21632. Once that goes through, I have plans to fix other aspects of the component.

@edif30
Copy link
Contributor Author

edif30 commented Mar 14, 2019

Thanks @Petro31

@ikifar2012
Copy link
Member

Hopefully your pull request gets merged soon @Petro31 !!!

@gcobb321
Copy link

While troubleshooting iCloud3, I found an 'empty response' error being returned from the WazeRouteCalcuator, but not all the time. After putting the call to Waze in a retry loop, I was receiving the normal distance & time data after 1 or 2 retries. I did put in a limit of retrying 4 times in case of drastic problems but have rarely reached the limit.

@dennusb
Copy link

dennusb commented Mar 26, 2019

When is this getting merged? It's broken for a while now..

@gcobb321
Copy link

gcobb321 commented Mar 26, 2019 via email

@edif30
Copy link
Contributor Author

edif30 commented Apr 12, 2019

@Petro31 I had applied your PR that you listed above back on 0.90.x and all the "Error on retrieving data: empty response" messages ERROR/WARNING went away. Now under 0.91.x, they are back. WARNING, but I get them randomly in the logs. Whereas on 0.90.x it was very clean. Not sure if anything changed between then and now.

@ikifar2012
Copy link
Member

Any update on this is it related to PR: #22428 will this be merged any time soon @Petro31

@dennusb
Copy link

dennusb commented Apr 16, 2019 via email

@Petro31
Copy link
Contributor

Petro31 commented Apr 19, 2019

@edif30 is this still the case? I haven't look at this in a while.

@edif30
Copy link
Contributor Author

edif30 commented Apr 19, 2019

@Petro31 yes it is still happening.

@ikifar2012
Copy link
Member

@Petro31 still an issue

@dennusb
Copy link

dennusb commented Apr 30, 2019

When is this going to be merged? It's still an issue and broken for a long time now...

@Petro31
Copy link
Contributor

Petro31 commented Apr 30, 2019

No clue. It's not up to me. The PR has been sitting in limbo for 2 months now with all the correct information. Also according to @edif30 the error persists even with the new PR.

@utamir
Copy link

utamir commented May 25, 2019

Yes, error still there. But the message now is "Error on retrieving data: empty response"

@johntdyer
Copy link
Contributor

Appears #22428 was merged... Does that mean 0.94.1 might actually work ?

@tmchow
Copy link

tmchow commented Jun 16, 2019

I'm still getting this issue on 0.94.3.

@hmmbob
Copy link
Contributor

hmmbob commented Jun 21, 2019

It was merged into dev for 0.95, so verify after that release.

@edif30
Copy link
Contributor Author

edif30 commented Jun 28, 2019

on 0.95.1

2019-06-27 21:09:00 WARNING (SyncWorker_0) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-06-27 21:09:00 WARNING (SyncWorker_18) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-06-27 21:09:00 WARNING (SyncWorker_2) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-06-27 21:09:00 WARNING (SyncWorker_14) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-06-27 21:09:00 WARNING (SyncWorker_8) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-06-27 21:09:00 WARNING (SyncWorker_15) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response

@JamieP83
Copy link

JamieP83 commented Jul 5, 2019

same error on 0.95.4 too

Log Details (WARNING)
Fri Jul 05 2019 09:19:54 GMT+0100 (British Summer Time)
Error on retrieving data: empty response

@darkkatarsis
Copy link

Same here on 0.97.1
Mon Aug 12 2019 09:17:35 GMT+0200 (Central European Summer Time) Error on retrieving data: empty response

@ikifar2012
Copy link
Member

Same here on 0.97.1
Mon Aug 12 2019 09:17:35 GMT+0200 (Central European Summer Time) Error on retrieving data: empty response

Is this going to be fixed?

@ikifar2012
Copy link
Member

This PR has been open for a while #21632

@Disturbx
Copy link

Disturbx commented Oct 2, 2019

Worked yesterday, today again
[homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response

@ragd011
Copy link

ragd011 commented Nov 27, 2019

I'm on 0.101.3 and have the same issue. One out of four routes never gets a response and the others are spotty.

@hmmbob
Copy link
Contributor

hmmbob commented Apr 28, 2020

Still exists on 0.108.9.

@stale stale bot removed the stale label Apr 28, 2020
@lockyt
Copy link

lockyt commented Apr 30, 2020

and 0.109

@TomZegers
Copy link

and 0.110

@ofalvai
Copy link
Contributor

ofalvai commented Jun 10, 2020

and 0.111.0

@ikifar2012
Copy link
Member

ikifar2012 commented Jun 11, 2020

I don't think this issue is getting fixed, who is the codeowner of this integration?

@Twanislas
Copy link

Still exists on 0.112.0

@sstratoti
Copy link

I am seeing the following error in my log, which is different than the original one posted.

I also wanted to add that while I'm seeing this error every 5 minutes in my home-assistant.log file, I -am- receiving travel times from Waze.


2020-07-09 12:49:20 WARNING (SyncWorker_5) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: Cannot get coords for ,
2020-07-09 12:49:20 WARNING (SyncWorker_17) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: Cannot get coords for ,
2020-07-09 12:49:20 WARNING (SyncWorker_16) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2020-07-09 12:49:21 WARNING (SyncWorker_4) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response

So the "Cannot get coords for ," is new to me. Before I was just seeing "empty response". Perhaps they're related, perhaps not. Hope this helps to resolve the issue, and thank you for this integration - its been a favorite of my family - especially when you combine it with calendar events!

@sstratoti
Copy link

Nevermind. My issue was that the lat/long wasn't being populated because my device tracker name changed. Sill getting the regular error everyone else is now that that is fixed. :/

@Twanislas
Copy link

Still exists on 0.113.0

@OppyLock
Copy link

... and also 0.114.x, just for the broken record.

@Petro31
Copy link
Contributor

Petro31 commented Aug 18, 2020

Guys, sorry to say but this response is from them. This and the 'Internal Error' come directly from the Waze response. Meaning if I ask for directions, waze says "I got nothing" or "I had an Internal Error" or "Here's your results".

We can't fix what we don't control. So if they say "I got nothing", then it's reported. Now we can suppress the errors as warnings, but they will still occur.

Also, just make sure your latitude and longitude are correct. If you reverse them, you will always get "I got nothing" because waze can't get directions when 1 location is in the middle of the ocean (or across continents).

@ikifar2012
Copy link
Member

Wow fixed just use zones

@ikifar2012
Copy link
Member

The Documentation beforehand when this issue was initially created showed that you had to use addresses I think that is the issue and also in the example it still shows this

sensor:
  - platform: waze_travel_time
    origin: Montréal, QC
    destination: Québec, QC
    region: 'US'

which doesn't work because they are not coordinates, I believe what happened is that a change was made to only accept GPS coordinates which the documentation did not reflect at the time and aren't fully updated as shown above.

@Petro31
Copy link
Contributor

Petro31 commented Aug 18, 2020

I believe what happened is that a change was made to only accept GPS coordinates which the documentation did not reflect at the time and aren't fully updated as shown above.

That's not correct. It accepts GPS coordinates, addresses, and entities.

@gcobb321
Copy link

I have read about these issues for a while and solved it in iCloud3 a long time ago (and also posted what I did to solve the problem a while ago too). It is a timing issue. In iCloud3, I check the results, and if I didn’t get any, I try the request again. In 99.9% of the time, I get successful location information within 3 retries.

Below is a code snippet of what is in iCloud3. Feel free to use it in any fashion, in any location to help solve your data retrieval issues.

‘‘‘
#--------------------------------------------------------------------
def _get_waze_distance(self, devicename, from_lat, from_long, to_lat,
to_long):
"""
Example output:
Time 72.42 minutes, distance 121.33 km.
(72.41666666666667, 121.325)

    See https://github.com/home-assistant/home-assistant/blob
    /master/homeassistant/components/sensor/waze_travel_time.py
    See https://github.com/kovacsbalu/WazeRouteCalculator
    """

    try:
        from_loc = f"{from_lat},{from_long}"
        to_loc   = f"{to_lat},{to_long}"

        retry_cnt = 0
        while retry_cnt < 3:
            try:
                self.count_waze_locates[devicename] += 1
                waze_call_start_time = time.time()
                route = WazeRouteCalculator.WazeRouteCalculator(
                        from_loc, to_loc, self.waze_region)

                route_time, route_distance = \
                    route.calc_route_info(self.waze_realtime)

                self.time_waze_calls[devicename] += (time.time() - waze_call_start_time)

                route_time     = round(route_time, 0)
                route_distance = round(route_distance, 2)

                return (WAZE_USED, route_distance, route_time)

            except WazeRouteCalculator.WRCError as err:
                retry_cnt += 1
                log_msg = (f"Waze Server Error (#{retry_cnt}), Retrying, Type-{err}")
                self._log_info_msg(log_msg)

    except Exception as err:
        self._set_waze_not_available_error(err)

‘‘‘

@goekhanm
Copy link

goekhanm commented Aug 22, 2020

Hi,
here is my solution which worked for me:

sensor:
    - platform: template
    sensors:
        johndoe_locataion_waze:
            value_template: "{{ '%.6f'%(states.person.johndoe.attributes['latitude']| float) }},{{ '%.6f'%(states.person.johndoe.attributes['longitude']| float) }}"
        home_zone_waze:
            value_template: "{{ '%.6f'%(states.zone.home.attributes['latitude']| float) }},{{ '%.6f'%(states.zone.home.attributes['longitude']| float) }}"
    - platform: waze_travel_time
      name:  Waze John Doe to Home
      origin:  sensor.johndoe_locataion_waze
      destination: sensor.home_zone_waze
      region: 'EU'

Explanation:
To get the current gps position of "John Doe" i am using the google maps integration which provides a seven digit after the decimal point.
The seven digits after the decimal point is a problem for the waze api.
So I cut the gps coordinates after the sixths digit and the waze calls are working.

I hope this helps someone

@sstratoti
Copy link

Interesting. @gcobb321 does your call also use a float to 6 digits?

@gcobb321
Copy link

@sstratoti
Here are the Waze log records for time & distance requests from the iCloud device tracker program running in Home Assistant using the code in a previous post.

[WazeRouteCalculator.WazeRouteCalculator] 

Request Waze Info, CurrentLoc to Home.
From: xx.654572695703923,-yy.36045424923422 - to: xx.726639,-yy.390456
Time 11.83 minutes, distance 10.59 km.

Request Waze Info, CurrentLoc to LastLoc.
From:: xx.694960124291114,-yy.3728750068238 - to: xx.654572695703923,-yy.3604542492342
Waze Server Error (#1), Retrying, Type-empty response
From: xx.694960124291114,-yy.3728750068238 - to: xx.654572695703923,-yy.36045424923422
Time 5.13 minutes, distance 4.81 km.

These results are from two Waze route requests today, one right after the other. As luck would have it, the second failed with no response, followed by an immediate retry resulting in a good response. As you can see, the precision of the locations varies from 6-digits to 15-digits so I don’t think that it’s the issue. A successful retry again points to timing.

The source code for ICloud3 can be found in the device_tracker.py program in the GitHub repository here. The Waze routines start at line 6636.

Hope this helps.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 26, 2021
@Twanislas
Copy link

Hi, still happening in 2021.1.5.

Cheers ! :)

@ikifar2012
Copy link
Member

Hi, still happening in 2021.1.5.

Cheers ! :)

try using zones

@Twanislas
Copy link

Hi, this is already what I am doing :

# Travel times to home
- platform: waze_travel_time
  name: waze_twan_to_home
  origin: person.antoine
  destination: zone.home
  region: "EU"

- platform: waze_travel_time
  name: waze_caro_to_home
  origin: person.caroline
  destination: zone.home
  region: "EU"

# Travel times to work
- platform: waze_travel_time
  name: waze_twan_to_work
  origin: person.antoine
  destination: zone.twan_work
  region: "EU"

- platform: waze_travel_time
  name: waze_caro_to_work
  origin: person.caroline
  destination: zone.caro_work
  region: "EU"

@github-actions github-actions bot removed the stale label Feb 2, 2021
@github-actions
Copy link

github-actions bot commented May 3, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests