Waze travel time update

If you are up to date with home assistant, you don’t need to do any of this by the way. just use the built in component:

im not really, I a bit reluctant to do so given all the confusion on the new authorization system and issues I read here and on the Github. So still on 75.3…

only thing I found yet was the link I posted above, which is the current component in the HA system. wait, found it: WazeRouteCalculator · PyPI :slight_smile:

0.76.2 is safe as the user system is in the Release Candidate phase in this version and not enabled by default. I just updated to it yesterday without any issues. That’s what fixed my Waze issues.

I’m on the same version. You can still safely use the component.

@petro Im on 0.77.3 using the built in component and it’s working well.
Thank you

1 Like

@petro
good day. I may have come across a bug. Im currently traveling and the component is unable to cacluate the time from where I am to say zone.home and it’s generating these errors in HA.

2018-09-17 00:48:21 ERROR (SyncWorker_20) [homeassistant.components.sensor.waze_travel_time] Error on retrieving data: Internal Error

I believe it’s related to me being so far away from home as the component is reporting correctly for my wife.

Understand the limitation in estimating when so far away, but perhaps theres a way to prevent the error logging.

That error isn’t actually coming from the component. HA is producing that error, not sure why.

I think you may need to turn on DEBUG to see what in waze component could lead to that error.

Good evening, turned on debug in logger (homeassistant.components.sensor.waze_travel_time: debug) and getting nothing additional

HI,

Is there any way we can set a travel mode in Waze, just like in the Google component? I do tend to walk (hike) a lot and the Waze calculator keeps giving me timed estimates as if I am driving :wink:

I am a fast walker, but that obviously isn’t very helpful. In fact, I hoped it would sense the speed itself and set a mode automatically, a bit like the Fitbit tracker?

Hi, I got this since upgrade to 0.78.3 , any idea. Seems to be only on startup, then all is ok.

2018-09-25 20:36:56 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/waze_travel_time.py", line 74, in <lambda>
    EVENT_HOMEASSISTANT_START, lambda _: sensor.update())
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/waze_travel_time.py", line 204, in update
    routes = params.calc_all_routes_info(real_time=self._realtime)
  File "/srv/homeassistant/lib/python3.5/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 145, in calc_all_routes_info
    routes = self.get_route(npaths, time_delta)
  File "/srv/homeassistant/lib/python3.5/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 95, in get_route
    response_json = response.json()
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Write a PR against it. Someone changed the startup process and this error appears to be a result.

Hi there!

I cannot get multiple routes to work.

If I create 3 sensors (one with a specific include filter) I only see data on the “default route”, the others are giving me this:

Update for sensor.huis_naar_werk_via_n34 fails
Traceback (most recent call last):
_ File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 223, in async_update_ha_state_
_ yield from self.async_device_update()_
_ File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 352, in async_device_update_
_ yield from self.hass.async_add_job(self.update)_
_ File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run_
_ result = self.fn(*self.args, **self.kwargs)_
_ File “/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/waze_travel_time.py”, line 214, in update_
_ route = sorted(routes, key=(lambda key: routes[key][0]))[0]_
IndexError: list index out of range

Sensors I’m using:

  • platform: waze_travel_time
    name: “Huis naar werk via A7”
    origin: xx
    destination: xx
    region: ‘EU’
    incl_filter: A7
  • platform: waze_travel_time
    name: “Huis naar werk via N34”
    origin: xx
    destination: xx
    region: ‘EU’
    incl_filter: N34
  • platform: waze_travel_time
    name: “Huis naar werk via Westerbroek”
    origin: xx
    destination: xx
    region: ‘EU’
    incl_filter: N860

The Waze Android app does show me N34 and N860 in alternative routes.
Is there any way I can see the output of calc_all_routes_info so I know which incl_filter I can use?
Guess only 1 routes is beeing calculated?

Thnx for your help @petro

Not without making a custom component to output that information in an attribute or to the debugger. You could also download the resource file (WazeRouteCalculator) and grab the results using python.

Is it possible to use “excl_filter” to filter out more than one string at a time? If so, how should it be formatted?
I’ve tried having 2 things comma separated and separated by a space with no luck. I’m trying to filter out both “Toll” and “HOV” from the calculated directions.

Nope, the current implementation is a bit restricted. Only one item can be filtered at a time.

I’ve been fighting two issues with this component for a while.

  1. the component used to update after platform was initialized without throwing an error thanks to a PR that I submitted but with one caveat where it would say “unknown” until the first API request. For some reason or another, that PR was overwritten by another PR that claimed to fix this issue, and we are back to square one of multiple and frequent errors.

  2. after a period of up time, the component just stops updating and the only error in the log says it took longer than the expected update interval of 0:05:00. The travel time stays stuck on the last value it got from the last successful API request. The only way to fix this that I have found is to restart my HA docker, which honestly is less than ideal as I have many Zwave devices that take a while to initialize.

EDIT: Yes I am on the latest version of HA (actually 0.84.6 since 0.85 just came out and there was no PR for the waze component in 0.85. And actually there was no PR for waze in 0.84 either.). No I have not tried any custom version of the waze travel time component or the waze route calculator. I am running a docker version of HA, so any Hassio “fix” won’t work unless it’s loading a custom component.

Yes, I’ve been battling someone too. My original rewrite had it update on the first API request. :man_shrugging:

I haven’t seen this myself. Are there any other errors in your logs when it occurs?

Ok, I haven’t touched this since may/july. All other PRs have been other people. Not sure what’s been updated since then.

I just rebooted and it’s working again, but when the sensors stop updating again I will grab some logs. If I remember though, there were no other errors other than the “took longer than the expected update interval of 0:05:00”. I have my logging settings set pretty low (less logging), so I may set the logging for this component to “Detail” and reboot again so we can grab some more info on what’s going on.

A quick aside (but I’d love to stop getting those errors on start up too :slight_smile:)

How do you set a logging level for just one component?