Invalid config for 'template' at templates.yaml, line 217: required key 'platform' not provided
(line 217 is the -trigger line)
I’ve tried other various formations (including starting with -trigger), but no joy. I’m not sure where to go from here - how can I add trigger based templates to an included templates.yaml file?
That doesn’t work, It seems like the documentation doesn’t translate for a separated templates file. I get the following:
2024-04-16 12:22:02.075 ERROR (MainThread) [homeassistant.config] Invalid config for 'template' at templates.yaml, line 216: 'trigger' is an invalid option for 'template', check: sensor->40->trigger
Invalid config for 'template' at templates.yaml, line 216: required key 'state' not provided
Invalid config for 'template' at templates.yaml, line 222: 'sensor' is an invalid option for 'template', check: sensor->40->sensor
if I adjust the indenting to the left, so that -trigger is “top level” in the file, I get:
2024-04-16 12:25:56.892 ERROR (MainThread) [homeassistant.components.template] while parsing a block mapping
in "templates.yaml", line 1, column 1
expected <block end>, but found '-'
in "templates.yaml", line 216, column 1
If someone has a working chunk of yaml for trigger based templates, in a separate file, I would love to see it. Thanks.
Yes, for some reason I had it in my mind, that once moving to a separate file, you dropped the array ‘-’ part - I struggled with that when splitting my configuration files. Anyway - I’ve learned something new, and it’s all for the better.