Waze Travel Time - error

agree. zones don’t work. GPS coords as well as full street addresses do.

That makes sense, the component just passes the undoctored string from your config to the waze API.

yes if i put the cordenates works fine, but zone no.

anyone here willing to try a new version of the component? I rewrote it so it can handle zones, device trackers, and sensors.

It’s working on my end with my device trackers and zones. Just need more eyes on it.

@Rodolfo_Vieira, @creakyshrimp, @geoffrey, @firstof9, @VirtualL

2 Likes

Count me in @petro. Do you know if it automatically overrides the default component?

if you place it in hass_loc/custom_components/sensor/ it will override it.

Heres a link to the source. Paste the code into a file named waze_travel_time.py in the directory above. Here’s a link to the code:

I made a PR, so it should get into the regular HA build in the next release.

I have the same issue of not having any values at startup as mentioned in the other thread where your code is. The zones themselves seem to work.

@creakyshrimp @petro: I am experiencing the same issue. Two or three times a day it takes a route which is not the fastest, It would be great if the component could be configured which route to take (i.e. fastest or shortest).

The waze app is giving that back. So it happens to be the shortest route at that time. The way the api works is that it returns a list of routes that are sorted by shortest duration. This duration can change depending on traffic, at least I’ve noticed that. I can verify that it uses the shortest at all times. That means there is a slowdown on the other routes for some reason. It is possible that the waze api doesn’t work, but that is out of our hands because the updates would need to happen waze side (not ha side).

Since the Google Maps API asks for some fee, it makes sense to make a better Waze component. I would like to use the device_tracker from gps component and the zone to estimate the time travel. This time could be used as input for some automation, like turning on the heating or AC. At the moment, I tried it and I got a HA not not fully responsive :frowning: It doesn’t show up in the dashboard and my hass.io on raspberry is very slow now. Removing the component seems not to solve the issue completly. I am investigating…

I did, you haven’t read the post have you?

I read it, but since I use hass.io I am afraid I can’t do it or, at least, I am not able to do it.

I run hass.io and I use it. Literally just place the file inside the location specified in that comment and it will use that over the official release.

I am sorry I didn’t reply anymore, I didn’t have much time to investigate on it. So, I tried again today, Hass.io 0.74

I would like to have a travel to home time, so I created an origin with a device_tracker (the one from google maps) and destination zone.home
It says that it cannot find the device_tracker. I tried with some random latitude and longitude as origin and the calculation was done and correct.

What is the problem with the device_tracker? Should I still replace some file into hass.io ?

Thank you!

did you have a typo? I exclusively use this with device tracker. Check your known_devices and make sure you are using the correct name with the domain ‘device_tracker’

EDIT: Also, everything before this is out of date. You no longer have to make a custom component, the PR went through and waze travel time now supports entity id’s

I copy/paste the device_tracker from the list, I think I cannot be wrong with it

the component requests the entity_id from home assistant. If it returns nothing, that means home assistant couldn’t find it. So there is a disconnect there. Can you post your ‘list’ and your yaml please?
EDIT: and the error in the logs.

Sure:

  • Unable to find entity device_tracker.google_maps_xxxxxxxxxxxxx (the number connected with my google maps tracker)

  • platform: waze_travel_time
    origin: device_tracker.google_maps_xxxxxxxxxxxx
    destination: zone.home
    region: ‘EU’

The entity should be visible:
source_type: gps latitude: 42.xxxxx longitude: 13.xxxxx gps_accuracy: 16 address: xxxxxxx, xxxxx, Italy full_name: xxxxxxx id: xxxxxxx last_seen: 2018-07-23T17:30:33.200000 nickname: xxxx friendly_name: google maps xxxxxxxx entity_picture: https://lh5.googleusercontent.com/-2jgTS1ky6ns/AAAAAAAAAAI/AAAAAAAABRM/zzzzzzzzzzzz/photo.jpg

EDIT: the yaml is ok, I don’t know how to keep the correct spaces here. If I use latitude and longitude it is ok.

2018-07-23 18:04:35 ERROR (SyncWorker_4) [homeassistant.components.sensor.waze_travel_time] Unable to find entity device_tracker.google_maps_xxxxxxxxxxxxxxxxx

Sounds like the platform isn’t setup during startup so when waze searches for it, the entity doesn’t exist. Try placing waze lower in your config or the google device tracker higher.