Good day,
I am still new to Home Assistant and coding and would like to reach out to the community for assistance with the configuration of a cover for my gate status sensors.
I have set-up contact sensors to indicate the status of my gate and it is working as a door or garage door, but would like to configure a gate cover, in order for the gate icon to be displayed in an open or closed position, depending on the status of the sensor and to change colour based on the status.
I have entered the code below in my configuration.yaml and the cover is available in my dashboard, but it is returning an “Unavailable status” if I add the entity card in the my dashboard
cover:
- platform: template
covers:
large_gate:
device_class: gate
friendly_name: "Gates Sensors Large Gate"
value_template: "{{ states('binary_sensor.gates_sensors_large_gate')|float > 0 }}"
open_cover:
service: script.open_gate
data:
entity_id: binary_sensor.gates_sensors_large_gate
close_cover:
service: script.close_gate
data:
entity_id: binary_sensor.gates_sensors_large_gate
stop_cover:
service: script.stop_gate
data:
entity_id: binary_sensor.gates_sensors_large_gate
icon_template: >-
{% if is_state('binary_sensor.gates_sensors_large_gate', 'open') %}
mdi:gate-open
{% else %}
mdi:gate
{% endif %}
Any advice from members to get the cover working would be highly appreciated.
Kind regards
