Waze travel time - Interval Update

Hi
I try to create evrey 1 minute update the waze vis sensore
its not work to me.
Somone know how do it ?

  - platform: waze_travel_time
    origin: device_tracker.mi9
    destination: zone.home
    region: 'IL'
    name: Travel Back Home
    scan_interval: 1

The scan_interval is seconds - not minutes. Once a minute however would likely cause you to be blocked.

My recommendation (and my own approach) is to set the scan interval really high (I use 604800) and use an update of device_tracker.mi9 to trigger an update of the travel sensor, but only when not at home. Something like this

automation:
- initial_state: 'on'
  alias: 'mi9 on the move'
  - platform: state
    entity_id: device_tracker.mi9
  condition:
  - condition: template
    value_template: "{{ not is_state('device_tracker.mi9','home') }}"
  action:
  - service: homeassistant.update_entity
    entity_id: sensor.travel_back_home

That way you’re only updating the travel time when it matters.

Wow !!! great answer
I do what you posted here
and get this error :

Configuration validation

Validate your configuration if you recently made some changes to your configuration and want to make sure that it is all valid

Configuration invalidCHECK CONFIG

Invalid config for [automation]: [platform] is an invalid option for [automation]. Check: automation->platform. (See /config/configuration.yaml, line 167). Please check the docs at https://home-assistant.io/integrations/automation/

I used HA
In my configuration yaml line 166-168 :

  debug: False
group: !include groups.yaml
automation: !include automations.yaml

The automation yaml file :

	- initial_state: 'on'
  alias: 'mi9 on the move'
  platform: state
  entity_id: device_tracker.mi9
  condition:
  - condition: template
    value_template: "{{ not is_state('device_tracker.mi9','home') }}"
  action:
  - service: homeassistant.update_entity
    entity_id: sensor.Travel_Back_Home
- id: '1572561732627'
  alias: Oven turn off after 20m
  description: ''
  trigger:
  - entity_id: switch.sonoff_10005bf441
    for: 00:20:00
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - alias: ''
    data:
      entity_id: switch.sonoff_10005bf441
    service: switch.turn_off

Sorry, that’s what happens when I quickly type an automation on the fly

automation:
- initial_state: 'on'
  alias: 'mi9 on the move'
  - trigger: state
    entity_id: device_tracker.mi9
  condition:
  - condition: template
    value_template: "{{ not is_state('device_tracker.mi9','home') }}"
  action:
  - service: homeassistant.update_entity
    entity_id: sensor.travel_back_home

Sorry, to revive an old thread.

If you trigger the entity like that, does that not count against the waze api call limits ? If my wife would be traveling for an hour, would that not cause a lot of updates?

also scan_interval i can’t seem to configure in the gui anymore, i guess that got removed.

Yes, so you pick the approach that works for you.

I use a complex setup that updates less often the further away somebody is, but also depending on what zone they’re in.

1 Like

Makes sense. And that looks pretty amazing.