I apologize in advance that I am not a YAML programmer. I am trying to use an article that I found that explains how to use a Shelly 1 to automate your garage door. I was able to get the equipment wired up, and configured in the web interface for the Shelly 1. Then I got to the part about editing the configuration.YAML file. I copied and pasted the info from the article into the file, but when I did a “check configuration” I get an error.
First of all, here is the article I’m trying to use.
Here is my configuration.YAML file with the personal stuff astrisked out.
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Example configuration.yaml entry
light:
- platform: decora_wifi
username: ********************
password: ************
http:
base_url: https://*******************
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
value_template: >-
{% if is_state('binary_sensor.shelly1_e8db84d6db1c_input','on') %}
Open
{% else %}
Closed
{% endif %}
open_cover:
service: switch.turn_on
data:
entity_id: cover.garage_door
close_cover:
service: switch.turn_on
data:
entity_id: cover.garage_door
stop_cover:
service: switch.turn_on
data:
entity_id: cover.garage_door
icon_template: >-
{% if is_state('binary_sensor.shelly1_e8db84d6db1c_input','on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %)
And here is the error I’m getting from the configuration checker.
Invalid config for [cover.template]: invalid template (TemplateSyntaxError: expected token ‘end of statement block’, got ‘%’) for dictionary value @ data[‘covers’][‘garage_door’][‘icon_template’]. Got “{% if is_state(‘binary_sensor.shelly1_e8db84d6db1c_input’,‘on’) %}\n mdi:garage-open\n{% else %}\n mdi:garage\n{% endif %)”. (See ?, line ?).
I’m hoping it is just a formatting error or a simple thing but I’m not good with config files yet. Any help would be apprecaited.
Thank you for your time.