-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgarage_motion_2.yaml
54 lines (43 loc) · 981 Bytes
/
garage_motion_2.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
54
substitutions:
device_name: garage_motion_2
upper_device_name: Garage Motion 2
esphome:
name: $device_name
platform: ESP8266
board: d1_mini
wifi: !include include/wifi_iot.yaml
captive_portal:
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
# api:
ota:
mqtt: !include include/mqtt.yaml
globals:
- id: signal_start
type: unsigned long int
binary_sensor:
- platform: gpio
pin: GPIO13
name: $upper_device_name
device_class: motion
filters:
- delayed_on_off: 2950ms
state_topic: $device_name/state
on_press:
then:
- lambda:
id(signal_start) = millis();
on_release:
then:
- lambda:
ESP_LOGD("custom","Signal Length %d", (millis() - id(signal_start)));
sensor:
- platform: wifi_signal
name: $upper_device_name WiFi Signal
update_interval: 30min
icon: mdi:wifi
button:
- platform: restart
name: $upper_device_name Restart