diff --git a/source/_integrations/opengarage.markdown b/source/_integrations/opengarage.markdown index 956da1bef45..8ce7357c01f 100644 --- a/source/_integrations/opengarage.markdown +++ b/source/_integrations/opengarage.markdown @@ -79,6 +79,8 @@ covers:

+{% raw %} + ```yaml # Related configuration.yaml entry cover: @@ -94,7 +96,7 @@ sensor: sensors: garage_status: friendly_name: 'Honda Door Status' - value_template: {% raw %}'{% if states.cover.honda %} + value_template: '{% if states.cover.honda %} {% if states.cover.honda.attributes["door_state"] == "open" %} Open {% elif states.cover.honda.attributes["door_state"] == "closed" %} @@ -108,21 +110,30 @@ sensor: {% endif %} {% else %} n/a - {% endif %}'{% endraw %} - garage_car_present: - friendly_name: 'Honda in Garage' - value_template: {% raw %}'{% if states.cover.honda %} - {% if is_state("cover.honda", "open") %} - n/a - {% elif ((states.cover.honda.attributes["distance_sensor"] > 40) and (states.cover.honda.attributes["distance_sensor"] < 100)) %} - Yes - {% else %} - No - {% endif %} - {% else %} - n/a {% endif %}' +binary_sensor: + platform: template + sensors: + honda_in_garage: + friendly_name: "Honda In Garage" + value_template: "{{ state_attr('cover.honda', 'distance_sensor') < 100 }}" + availability_template: >- + {% if is_state('cover.honda','closed') %} + true + {% else %} + unavailable + {% endif %} + icon_template: >- + {% if is_state('binary_sensor.honda_in_garage','on') %} + mdi:car + {% else %} + mdi:car-arrow-right + {% endif %} + unique_id: binary_sensor.honda_in_garage + delay_on: 5 + delay_off: 5 + group: garage: name: Garage @@ -135,8 +146,6 @@ customize: cover.honda: friendly_name: Honda entity_picture: /local/honda.gif - sensor.garage_car_present: - icon: mdi:car ``` {% endraw %}