I feel like I’m probably doing something dumb, but perhaps you can all give me some guidance. I’m still very new to HA.
I have my own custom Raspberry Pi Garage Door Opener and have my own API. I want to setup a super simple cover template for this so that I can see status, and open/close the door from my dashboard.
In my configuration file I have the following:
sensor garage_door:
- platform: rest
scan_interval: 60
resource: http://192.168.10.32:5000/api
name: "Garage Door Sensor"
value_template: "{{ value_json['Default Door']['status']['limitsensorclosed'] }}"
# Switch garage_door
switch garage_door:
- platform: rest
name: "Garage Door"
resource: http://192.168.10.32:5000/api
scan_interval: 60
body_on: '{"DoorButton" : "Default Door"}'
body_off: '{"DoorButton" : "Default Door"}'
is_on_template: "{{ value_json['Default Door']['status']['limitsensorclosed'] }}"
headers:
Content-Type: application/json
verify_ssl: false
# Cover Template Example from: https://www.home-assistant.io/integrations/cover.template/
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
position_template: "{{ states('sensor.garage_door') }}"
open_cover:
- condition: state
entity_id: sensor.garage_door
state: "off"
- service: switch.turn_on
target:
entity_id: switch.garage_door
close_cover:
- condition: state
entity_id: sensor.garage_door
state: "on"
- service: switch.turn_off
target:
entity_id: switch.garage_door
stop_cover:
service: switch.turn_on
target:
entity_id: switch.garage_door
icon_template: >-
{% if states('sensor.garage_door')|float > 0 %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
When I go to edit my dashboard I cannot find the “cover” anywhere. I can see the switch.garage_door
and the sensor.garage_door
which function perfectly as expected by themselves. What am I missing here?