Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - platform: template
- covers:
- gate:
- unique_id: gate_template
- device_class: gate
- friendly_name: "Gate"
- availability_template : '{{ not (is_state("cover.brama", "unavailable") or is_state("cover.brama", "unknown")) }}'
- value_template: >
- {% if states("binary_sensor.gate_left_closing") == "on" or states("binary_sensor.gate_right_closing") == "on" %}
- closing
- {% elif states("binary_sensor.gate_left_opening") == "on" or states("binary_sensor.gate_right_opening") == "on" %}
- opening
- {% elif states("cover.brama") == "closed" %}
- closed
- {% else %}
- open
- {% endif %}
- position_template: >
- {% if states("cover.brama") == "closed" %}
- 0
- {% elif states("input_boolean.gate_open") == "on" %}
- 100
- {% else %}
- 50
- {% endif %}
- open_cover:
- service: script.gate_open
- close_cover:
- service: script.gate_close
- stop_cover:
- service: script.gate_stop
- icon_template: >
- {% if states("binary_sensor.gate_left_closing") == "on" or states("binary_sensor.gate_right_closing") == "on" %}
- mdi:format-horizontal-align-center
- {% elif states("binary_sensor.gate_left_opening") == "on" or states("binary_sensor.gate_right_opening") == "on" %}
- mdi:arrow-expand-horizontal
- {% elif states("cover.brama") == "closed" %}
- mdi:gate
- {% else %}
- mdi:gate-open
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement