2024-01-25 13:51:09.750 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] while scanning for the next token
found character '|' that cannot start any token
in "/config/automations/../templates/speech/GoodNite.yaml", line 11, column 10
2024-01-25 13:51:09.751 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: while scanning for the next token
found character '|' that cannot start any token
in "templates/speech/GoodNite.yaml", line 11, column 10. Activating recovery mode
found it
{{ [
'Pardon me, ',
'Excuse me, ',
'I do not mean to interupt, but,',
'I hate to interrupt, but,',
'I beg your pardon, ',
'I do not mean to intrude, but, ',
'I am sorry to interrupt, but. ',
'Just a quick heads up, '
] | random }}
All my working (!) random notifications are failing in the Yaml validators. But they don’t throw errors in HA.
Did you check whether there are hidden characters in your file?
Can you post the whole file content?
{# Event Report #} {%- macro getReport() -%} {% set cc = 0 %}
{{ [
'Pardon me, ',
'Excuse me, ',
'I do not mean to interupt, but,',
'I hate to interrupt, but,',
'I beg your pardon, ',
'I do not mean to intrude, but, ',
'I am sorry to interrupt, but. ',
'Just a quick heads up, '
] | random }}
I Have turn off the Gas Heater and Climate control off.
{{ [
'Thinking... Checking your nite list.',
'looking into it.',
'checking please wait.'
]| random }}
{% if states.sensor.next_alarm_minutes.state | int < 720 %}
{{ [
'Look like there is a alarm Set for in the morning ',
'Face the fact an alarm will be going off. in the morning ',
'Thats it.. back to work making money '
]| random }}
please check the jug is full. So I can turn it on.
{% set cc = 1 %}
{% else %}
{{ states.sensor.next_alarm_stephan_days.state }}
{% endif %}
{% if states.sensor.recycling.state | int == 1 %}
Looks like rubbish day again.. Tomorrow you have to put out the recycling bin the Yellow one.
{% set cc = 2 %}
{% else %}
{% endif %}
{% if states.sensor.landfill.state | int == 1 %}
{% if cc | int == 2 %}
and the landfill bin also the Red one.
{% else %}
Looks like rubbish day again.. Tomorrow have you put out the landfill one the Red one.
{% set cc = 3 %}
{% endif %}
{% else %}
{% endif %}
{% if states.sensor.glass.state | int == 1 %}
{% if cc | int == 3 %}
and the glass bin also the blue one.
{% else %}
Looks like rubbish day again.. Tomorrow you have to put out the glass bin the blue one.
{%endif %}
{% set cc = 4 %}
{% else %}
{% endif %}
{% if states.binary_sensor.garage_door.state == 'on' %}
Guess what the garage door still open someone beater close it.
{% else %}
{% endif %}
{% if is_state('binary_sensor.garage_side_door', 'on') -%}
Garges side door still Open
{% else %}
{% endif %}
{% if is_state('binary_sensor.front_door', 'on') -%}
Frount door still open
{%- else %}
{%- endif %}
{% if cc | int == 0 %}
{{ [
"nothing else to report.",
"mine gone blank.",
"get off to bed now",
"can't think of anything."
] | random }}
{% else %}
{% endif %}
so Good Nite {%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns
formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getReport() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}
looks i did some editing DID NOT DO a CONFIG CHECK
the FIX verson
{%- macro getReport() -%} {% set cc = 0 %}
{{ [
'Pardon me, ',
'Excuse me, ',
'I do not mean to interupt, but,',
'I hate to interrupt, but,',
'I beg your pardon, ',
'I do not mean to intrude, but, ',
'I am sorry to interrupt, but. ',
'Just a quick heads up, '
] | random }}
I Have turn off the Gas Heater and Climate control off.
{{ [
'Thinking... Checking your nite list.',
'looking into it.',
'checking please wait.'
]| random }}
{% if states.sensor.next_alarm_minutes.state | int < 720 %}
{{ [
'Look like there is a alarm Set for in the morning ',
'Face the fact an alarm will be going off. in the morning ',
'Thats it.. back to work making money '
]| random }}
please check the jug is full. So I can turn it on.
{% set cc = 1 %}
{% else %}
{{ states.sensor.next_alarm_stephan_days.state }}
{% endif %}
{% if states.sensor.recycling.state | int == 1 %}
Looks like rubbish day again.. Tomorrow you have to put out the recycling bin the Yellow one.
{% set cc = 2 %}
{% else %}
{% endif %}
{% if states.sensor.landfill.state | int == 1 %}
{% if cc | int == 2 %}
and the landfill bin also the Red one.
{% else %}
Looks like rubbish day again.. Tomorrow have you put out the landfill one the Red one.
{% set cc = 3 %}
{% endif %}
{% else %}
{% endif %}
{% if states.sensor.glass.state | int == 1 %}
{% if cc | int == 3 %}
and the glass bin also the blue one.
{% else %}
Looks like rubbish day again.. Tomorrow you have to put out the glass bin the blue one.
{%endif %}
{% set cc = 4 %}
{% else %}
{% endif %}
{% if states.binary_sensor.garage_door.state == 'on' %}
Guess what the garage door still open someone beater close it.
{% else %}
{% endif %}
{% if is_state('binary_sensor.garage_side_door', 'on') -%}
Garges side door still Open
{% else %}
{% endif %}
{% if is_state('binary_sensor.front_door', 'on') -%}
Frount door still open
{%- else %}
{%- endif %}
{% if cc | int == 0 %}
{{ [
"nothing else to report.",
"mine gone blank.",
"get off to bed now",
"can't think of anything."
] | random }}
{% else %}
{% endif %}
so Good Nite {%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns
formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getReport() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}