Waze travel time update

Yes, you’ll still get that error because this waze api is pretty shitty to be honest. Sometimes it responds correctly with nothing. I don’t know why. The main issue is that this is an undocumented & unsupported waze api. So we get what we get.

It just updates every 5 minutes. Nothing more, nothing less.

It’s possible it’s updating but you won’t see those updates in the last_updated and last_changed if the state is the same. That’s how home assistant works in general.

3 Likes

Ok, using this platform for the first time, is it possible to change the scan interval like in other platforms?

Try adding the following to your configuration.yaml, under the waze sensor.

 scan_interval:
    minutes: 1

I think the default 5 minutes is pretty good though…

is that a valid option? i dont see it in the waze documentation?

that should be valid for every entity. I haven’t tried it and I don’t remember if it’s valid. Worse case is that you have to make it a custom component and adjust it in the python file.

thnx @petro

it this the correct syntax? because i dont think it worked, it only updated after 5 minutes
maybe my syntax is wrong, want to know for sure before i load it as a custom

  - platform: waze_travel_time
    name: Reistijd fabio
    origin: person.fabio
    destination: zone.home
    region: EU
    scan_interval:
      minutes: 1

maybe i need to specify it as:

scan_interval: 60
or 2 minutes
scan_interval: 120

I believe you have to specify it in seconds. I’ll have to look at the code later.

I have used this syntax on other sensors, it worked well. Perhaps not gonna do the job here.

I just verified, It extends the normal sensor configuration so scan_interval will work. I don’t know the proper syntax off the top of my head. Either way, scan_interval should be at the same indentation as origin and destination.

Ok, I’ll try again

After a HA restart, the first state is always unknown (known behavior)… So normally if scan interval works, it should update after 60 seconds to xx minutes then?

unless someone changed it again… it should have data on first boot up. Then it should update every 60 seconds if you change it to scan every 60 seconds.

Hmm, I don’t have date on first boot… :wink:
But that’s a good test for me, just wait 60 sec then, if I setup interval to 60

I also don’t get data on first load.
I get the empty response.

2019-08-13 15:01:02 WARNING (SyncWorker_9) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response

Ok, have you tried also interval?

empty response comes from waze, nothing can be done about that.

I made a PR a while ago (6 months or more) that actually fixed the “Unknown” state on first boot. One version later someone removed those code changes for an unknown reason. I’m listed in the update release notes for HA with the fix, but no idea why it was removed. I’m too busy to track it down again and submit another PR.

Yep, happened to me too. Not worth the effort tbh.

ok, seems scan interval works, have setup on 120 secs, so after reboot, its updated within 120 secs

will check again when actually driving :slight_smile:

ok scan interval works

but how can i configire HA, to NOT log messages like below? i want to ignore those warnings
my log file is flooded with those

2019-08-16 06:22:25 WARNING (SyncWorker_4) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-08-16 06:22:25 WARNING (SyncWorker_3) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-08-16 06:24:26 WARNING (SyncWorker_3) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2019-08-16 06:24:27 WARNING (SyncWorker_1) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response