opengarage docs - made the previously template sensor based garage_car_present a template binary_sensor (#14319)

Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com>
This commit is contained in:
cydia2020 2020-08-29 01:21:43 +10:00 committed by GitHub
parent 56a7d50196
commit 4c3ac3f4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,8 @@ covers:
<img src='{{site_root}}/images/integrations/opengarage/cover_opengarage_details.jpg' /> <img src='{{site_root}}/images/integrations/opengarage/cover_opengarage_details.jpg' />
</p> </p>
{% raw %}
```yaml ```yaml
# Related configuration.yaml entry # Related configuration.yaml entry
cover: cover:
@ -94,7 +96,7 @@ sensor:
sensors: sensors:
garage_status: garage_status:
friendly_name: 'Honda Door 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" %} {% if states.cover.honda.attributes["door_state"] == "open" %}
Open Open
{% elif states.cover.honda.attributes["door_state"] == "closed" %} {% elif states.cover.honda.attributes["door_state"] == "closed" %}
@ -108,21 +110,30 @@ sensor:
{% endif %} {% endif %}
{% else %} {% else %}
n/a 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 %}' {% 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: group:
garage: garage:
name: Garage name: Garage
@ -135,8 +146,6 @@ customize:
cover.honda: cover.honda:
friendly_name: Honda friendly_name: Honda
entity_picture: /local/honda.gif entity_picture: /local/honda.gif
sensor.garage_car_present:
icon: mdi:car
``` ```
{% endraw %} {% endraw %}