Waze Travel Time - error: state is unknown

Hi,
I can not get waze component to work. it doesnt calculate the time and distance and shows state to “unknown”.
This is what i add in configuration files.

Any ideas ?

sensor:
  - platform: template
    sensors:
      hline_1:
        value_template: hline
  - platform: waze_travel_time
    origin: XXX,XXX
    destination: XXX,XXX
    region: 'IL'
    name: To Work
 
  - platform: waze_travel_time
    origin: XXX,XXX
    destination: XXX,XXX
    region: 'IL'
    name: Back Home
  - platform: template
    sensors:
      to_wotk_distance:
        unit_of_measurement: 'KM'
        value_template: '{{ states.sensor.to_work.attributes.distance }}'
        friendly_name: 'Distance'
        icon_template: mdi:map-marker-distance
  - platform: template
    sensors:
      to_wotk_route:
        value_template: '{{ states.sensor.to_work.attributes.route }}'
        friendly_name: 'Route'
        icon_template: mdi:routes
 
  - platform: template
    sensors:
      back_home_distance:
        unit_of_measurement: 'KM'
        value_template: '{{ states.sensor.back_home.attributes.distance }}'
        friendly_name: 'Distance'
        icon_template: mdi:map-marker-distance
 
  - platform: template
    sensors:
      back_home_route:
        value_template: '{{ states.sensor.back_home.attributes.route }}'
        friendly_name: 'Route'
        icon_template: mdi:routes

Why does work sometimes have a t in it? :wink: wotk

Please format your code as per the instructions at the top of the page

Also, you should remove your home GPS coordinates from this post.

1 Like

Thank for your comment. I edited this post.

To me at startup is always Unknown and it takes some minutes to show the correct amount of minutes.

My problem is that since 0.89 the minutes are bananas, should be 15 (as is in Waze website), but in HASS is 303

Same here since update to 0.89.
I didn’t see anything mentioned in the Breaking changes, but something broke/changed!
Bummer as I just got this working last week and now it won’t.
-------------------------EDIT----------------------
I changed my address to home as that was all I was worried about and it started working for me again.

Just wanted to say mine broke as well, in case someone opens an incident with the developer

Mine also stoped working after i Updated to 0.89.2 it was working in 0.89.1

Maybe I was not paying enough attention, but I just realized my waze sensors seem to be taking a crazy amount of time to update, and even then not consistent. I think in my case it may be related to my zones for origin and destination.

  # Pauls commute to home
  - platform: waze_travel_time
    name: Pauls Time to Home
    origin: device_tracker.paul_all
    destination: zone.home
    region: 'US'

I use coordinates for my zones, and device trackers as my origin. I noticed this morning, that when my wife left the house and went to work, that the sensor for her time to home stopped updating. It had been updated all night, then suddenly it was 56 minutes since the last update. I have a few different sensors that were all over the place, one had updated in the past 5 minutes, one had been over 20 minutes, etc.

I restarted HA, and it took about 15-20 minutes but at the moment they all seem to be updated.

not sure if it is related or not , but after updating to HA 0.95.4 , the sensor is allways in " unknown" state .

i see this on the logs

019-07-02 17:06:41 WARNING (SyncWorker_3) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: Internal Error

Same here… did you use a life360 device tracker for the origin?

I tried different options , even hard setting the origin , so I think the problem may be within the component itself .

Internal error comes from the response from Waze. Something is wrong in your config, most likely you are using the wrong region. Or your area isn’t supported by the Waze api that is used.

@petro, it most probably is , but the issue is that it WAS WORKING for my region in south america , by using region = US , now no matter what it is not working anymore , that is why i think that something changed in the last three weeks …
and of course i know nothing about it, so just describing what i can tell , thanks

an update went through to the resource used called wazeroutecalculator. The dev added functionality to properly use the correct region instead of pinging all 3 at the same time. Find the correct region and it should work. You also may need to include your country in your addresses.

Also, before you ask, wazeroutecalculator is managed by some random dude unaffiliated with home assistant. If you want to revert or argue the change, you need to take it up on GitHub on that page.

@petro, thanks for your answer, i looked at the code on that github repo, but the latest modification seams to be from two month ago, in that case it can not be it as it was working well beyond that date , so the modifications should have happened on other place more recently .

should region matter if instead of addresses i use lat,lon coords ?

home assistant ran on v0.9 for the last 6 months and just moved to 0.10 in 95. So the changes from 2 months ago are brand new in home assistant.

if you use lat, Lon, the region does not matter as much because it skips the requests from the address to lat,lon server.

Got it , tks

@petro, i have tested with several coordinates from south, and it is not working , so probably the error introduced in the last change is deeper .
Do you know if Is there other free travel-time calculator available from HA ?, thanks