@Djiest wrote:
Is it possible to use templating in a sensor? I have the following
- platform: google_travel_time name: Morning Commute scan_interval: >- {% if is_state("binary_sensor.workday_sensor", "on") and now().hour > 7 and now().hour < 9 -%} 480 {% else %} 10000 {% endif %} api_key: !secret google_maps_api origin: zone.home destination: zone.work
but when I check the config I get
Invalid config for [sensor]: offset {% if is_state("binary_sensor.workday_sensor", "on") and now().hour > 7 and now().hour < 9 -%} 480 {% else %} 10000 {% endif %} should be format 'HH:MM' or 'HH:MM:SS' for dictionary value @ data['scan_interval']. Got None. (See ?, line ?).
Posts: 5
Participants: 3