Code:
template:
- sensor:
- name: “Garage Door”
state: >
{% if is_state(‘binary_sensor.garage_sensor’, ‘off’) and is_state(‘switch.garage_door’, ‘on’) %}
opening
{% elif is_state(‘binary_sensor.garage_sensor’, ‘off’) and is_state(‘switch.garage_door’, ‘off’) %}
closing
{% elif is_state(‘binary_sensor.garage_sensor’, ‘on’) %}
open
{% else %}
closed
{% endif %}
- name: “Garage Door”
sensor:
- platform: openweathermap_all
api_key:<redacted>
latitude:<redacted>
longitude:<redacted>
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: “Garage Door”
value_template: “{{ states(‘sensor.garage_door’) }}”
open_cover:
- condition: state
entity_id: sensor.garage_door
state: “closed”
- service: switch.toggle
target:
entity_id: switch.garage_door
close_cover:
- condition: state
entity_id: sensor.garage_door
state: “open”
- service: switch.toggle
target:
entity_id: switch.garage_door
stop_cover:
service: switch.toggle
target:
entity_id: switch.garage_door
icon_template: >-
{% if is_state(‘cover.garage_door’, ‘opening’) or is_state(‘cover.garage_door’, ‘closing’) %}
mdi:garage-alert
{% elif is_state(‘cover.garage_door’, ‘open’) %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
Error:
duplicated mapping key (65:1)
62 | closed
63 | {% endif %}
64 |
65 | sensor:
------^
66 | - platform: openweathermap_all
67 | api_key: 00b5c3a6d111778706df2d98554e1e7da62c
Question: Should I be looking for another instance of line 67 API Key ? I cant find one. Or is it the use of Sensor I have screwed up with ?