Any ideas on how to fix the following error? Have tried various indentations!
bad indentation of a mapping entry at line 96, column 3:
- platform: template
^
while parsing a block mapping in “/config/configuration.yaml”, line 77, column 3 expected <block end>, but found ‘-’ in “/config/configuration.yaml”, line 96, column 3
The error message says it found the hyphen at column 3. All yaml indentation is done in multiples of 2, so if you have something indented to an odd number of spaces it is wrong.
The code you’ve posted has that hyphen indented 6 spaces, which is fine, but you;ve said that’s not your code, but somebody else’s, which doesn’t really help us to help you.
Please post YOUR configuration with the spacing retained in code blocks so we can see where you’ve gone wrong.
YAML has no specification for 2 or any number of spaces for indentation. It is a a matter of what suits you. 2 is a useful number as it is reasonably readable without being over the top.
But you are right that the error message is no use without knowing where line 77 is.
Thanks for the replies and help. I decided to use another (Node Red) approach instead so the initial problem is no longer an issue.
Thanks anyway - the help and guidance is much appreciated!