Waze Travel Time - error

This issue of the waze platform loading before device tracker or sensor platforms and giving an “unavailable” time and corresponding error in the log has been fixed with a PR. I don’t think the PR made it into 0.74 though.

https://github.com/home-assistant/home-assistant/pull/15455

Yes, it updates every 5 minutes.

Interesting, I thought I removed the , True)… Oh well. Good catch.

didn’t see if this was fully resolved, but can you use the device sensor and parse just the lat/long or no? Edit: dissregard looks like it works ok.

HI @petro

would this error be related, I see it since updaing to 0.80.0b0:

2018-10-09 10:49:46 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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 74, in <lambda>
    EVENT_HOMEASSISTANT_START, lambda _: sensor.update())
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/waze_travel_time.py", line 204, in update
    routes = params.calc_all_routes_info(real_time=self._realtime)
  File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 145, in calc_all_routes_info
    routes = self.get_route(npaths, time_delta)
  File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 95, in get_route
    response_json = response.json()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Does it happen every 5 minutes (Which is the update cycle)?

No, it does so at startup, 3 times after another which at my latest boot was 13.16.56 and following that reappeared at 13.43.58 for a separate waze_sensor;

2018-10-09 13:43:58 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.waze_m_home fails
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
        await self.async_device_update()
      File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
        await 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 204, in update
        routes = params.calc_all_routes_info(real_time=self._realtime)
      File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 145, in calc_all_routes_info
        routes = self.get_route(npaths, time_delta)
      File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 95, in get_route
        response_json = response.json()
      File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 896, in json
        return complexjson.loads(self.text, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 518, in loads
        return _default_decoder.decode(s)
      File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
        obj, end = self.raw_decode(s)
      File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
        return self.scan_once(s, idx=_w(s, idx).end())
    simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

and another:

2018-10-09 13:49:00 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.waze_route fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await 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 204, in update
    routes = params.calc_all_routes_info(real_time=self._realtime)
  File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 145, in calc_all_routes_info
    routes = self.get_route(npaths, time_delta)
  File "/usr/local/lib/python3.6/site-packages/WazeRouteCalculator/WazeRouteCalculator.py", line 95, in get_route
    response_json = response.json()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

hmmm, that’s almost 5 minutes :wink:
and again at 13.53.50. definitely not 5 minutes…still close though. is this to be expected?

No, this means every update is failing. They may have changed the api again… which sensors is it using?

Im only doing this:

  - platform: waze_travel_time
    name: Waze location1-location 2
    origin: Location1, NL
    destination: location2, NL
    region: 'EU'

for a few places, and between 2 device_trackers. they show fine btw.

Hey guys,

Anyone able to help me out?
I’m trying to set a simple sensor up like the following;

  - platform: waze_travel_time
    name: A to B
    origin: 123 Queen St, Melbourne
    destination: 525 Collins St, Melbourne
    region: 'AU'

I’m getting the following error;
Invalid config for [sensor.waze_travel_time]: value is not allowed for dictionary value @ data['region']. Got 'AU'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.waze_travel_time/

Except the AU region is listed in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/waze_travel_time.py
REGIONS = ['US', 'NA', 'EU', 'IL', 'AU']

put your origin and destination in quotes:

  - platform: waze_travel_time
    name: A to B
    origin: '123 Queen St, Melbourne'
    destination: '525 Collins St, Melbourne'
    region: 'AU'

Same issue :frowning:

  • platform: waze_travel_time
    name: Home to Work
    origin: ‘123 Queen St, Melbourne’
    destination: ‘525 Collins St, Melbourne’
    region: ‘AU’

Invalid config for [sensor.waze_travel_time]: value is not allowed for dictionary value @ data['region']. Got 'AU'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.waze_travel_time/

Scratch everything I just posted. You’re trying to use the beta but you must not have it installed. The current master does not have AU as an option:

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

Either use the beta or wait until the beta is released.

This might be a silly question but what would i need to type to update to the beta in terminal?

Everything in this thread is old… very old. You shouldn’t need to update anything, everything posted here has been released at this point. In fact, other people have even changed the component.

@petro
Hey, any idea why Waze is creating the following log entry on startup, but functions as expected?

2018-12-05 09:00:45 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 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2018-12-05 09:00:45 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 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/srv/homeassistant/lib/python3.5/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I saw in this thread that it was supposed to be fixed a while back, but it never was fixed for me. I’m US. I’ve just grown to expect it, but definitely would not mind if the issue was resolved.

This is the same startup error that we’ve seen in the past. What version are you running?

I’m running 81.6

I’m interpreting your reply to mean that maybe this has been fixed.
But I’m still getting these errors on startup too (v 0.83.2)