-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.yaml
53 lines (51 loc) · 1.51 KB
/
configuration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# add this to your configuration.yaml in Home Assistant
sensor:
- platform: ultrasonic
trigger_pin: GPIO27
echo_pin: GPIO14
name: "Distance car"
update_interval: 5s
timeout: 4.0m
binary_sensor:
- name: "Car detected"
state: >
{{ not(is_state('sensor.ultrasonic_control_garage_door_distance_car', 'unknown')) }}
cover:
- platform: template
covers:
garage_door:
device_class: garage
unique_id: garage_door_safe
friendly_name: "Garage door safe"
value_template: >
{{ states('cover.my_actual_garage_door') }}
open_cover:
— if:
- condition: state
entity_id: binary_sensor.car_detected
state: "off"
then:
- service: cover.open_cover
data: {}
target:
entity_id: cover.my_actual_garage_door
else:
- service: notify.all_devices
data:
message: >-
Garage can not be opened: blocked by car
close_cover:
— if:
- condition: state
entity_id: binary_sensor.car_detected
state: "off"
then:
- service: cover.open_cover
data: {}
target:
entity_id: cover.my_actual_garage_door
else:
- service: notify.all_devices
data:
message: >-
Garage can not be closed: blocked by car