Waze integration, scan_interval error

Tags: #<Tag:0x00007fc41d6fa638>

I am struggling with an format error.
Extract of configuration.yaml:

input_number:
  scan_interval_waze:
    name: Waze refresh-rate in secs (min 300 - max 3600 step 300)
    initial: 3600
    min: 300
    max: 3600
    step: 300
sensor:
  - platform: template
    sensors:
      refresh_interval_waze:
       value_template: "{{ states('input_number.scan_interval_waze') | int }}"
  - platform: waze_travel_time
    name: reistijd
    origin: sensor.origin_address
    destination: sensor.dest_address
    region: 'EU'
    scan_interval: sensor.refresh_interval_waze 

Checking the configuration.yaml gives in the following error:
Invalid config for [sensor]: offset sensor.refresh_interval_waze should be format ‘HH:MM’, ‘HH:MM:SS’ or ‘HH:MM:SS.F’ for dictionary value @ data[‘scan_interval’]. Got None. (See /config/configuration.yaml, line 187).

Remark: The following works fine:

sensor:
  - platform: waze_travel_time
    name: reistijd
    origin: sensor.origin_address
    destination: sensor.dest_address
    region: 'EU'
    scan_interval: 300 #seconds 

Where is the problem?
Thx for the collaboration.

is text.
You should probably have:

scan_interval: {{ states('sensor.refresh_interval_waze') }}

EDIT.
I can’t see scan_inteval as an option in the documentations.
Waze Travel Time - Home Assistant (home-assistant.io)

    scan_interval: {{ states('sensor.refresh_interval_waze') }}

result:
Error loading /config/configuration.yaml: invalid key: “OrderedDict([(“states(‘sensor.refresh_interval_waze’)”, None)])” in “/config/configuration.yaml”, line 224, column 0

scan_interval: "{{ states('sensor.refresh_interval_waze') }}"

result:
Invalid config for [sensor]: offset {{ states(‘sensor.refresh_interval_waze’) }} should be format ‘HH:MM’, ‘HH:MM:SS’ or ‘HH:MM:SS.F’ for dictionary value @ data[‘scan_interval’]. Got None. (See /config/configuration.yaml, line 188).

Indeed, not in the docu. But it works.

Does the sensor work? I see you have a indentation error.
Value_template needs to move out one space.
What is the state of the sensor?

Indentation error corrected, but no impact.
Sensor works:
Schermafbeelding 2021-04-08 om 14.30.11