@CodeFinder wrote:
Hi all,
I have the following automation:
- alias: Disable Pi-Hole trigger: platform: state entity_id: input_select.pihole_time condition: # valid if in the format 'HH:MM:SS' - condition: template value_template: "{{ states('input_select.pihole_time')|regex_match('^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$', ignorecase=FALSE) }}" action: service: pi_hole.disable data_template: duration: "{{ states('input_select.pihole_time') }}"
but I am getting the errors:
Error loading /config/configuration.yaml: while scanning a double-quoted scalar in "/config/automations.yaml", line 298, column 23 found unknown escape character 'd' in "/config/automations.yaml", line 298, column 92
Line 298 is the line with the regular expression. What’s wrong here? Please note that the expression works correctly in the template editor. Also tried double quotes with no luck.
Thanks!
Posts: 3
Participants: 3