mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
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:
parent
56a7d50196
commit
4c3ac3f4d4
@ -79,6 +79,8 @@ covers:
|
||||
<img src='{{site_root}}/images/integrations/opengarage/cover_opengarage_details.jpg' />
|
||||
</p>
|
||||
|
||||
{% 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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user