-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchickendoor.yaml
117 lines (97 loc) · 2.3 KB
/
chickendoor.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
esphome:
name: chicken_door
platform: ESP8266
board: d1_mini
packages:
wifi: !include wifi.yaml
i2c:
sda: D2
scl: D1
scan: True
id: bus_a
logger:
level: DEBUG
captive_portal:
# Enable Home Assistant API
api:
ota:
time:
- platform: sntp
id: sntp_time
on_time:
- seconds: /10
then:
- if:
condition:
for:
time: 70s
condition:
sensor.in_range:
id: lux_sensor_chicken
below: 300
then:
- logger.log:
format: "Chicken door state is: %.1f"
args: [ 'id(chicken_door).position' ]
- cover.close: chicken_door
- if:
condition:
for:
time: 70s
condition:
sensor.in_range:
id: lux_sensor_chicken
above: 1000
then:
- logger.log:
format: "Chicken door state is: %.1f"
args: [ 'id(chicken_door).position' ]
- cover.open: chicken_door
sensor:
- platform: bh1750
name: "BH1750 Illuminance"
id: lux_sensor_chicken
address: 0x23
update_interval: 10s
# on_value_range:
# - below: 400
# then:
# - cover.close: chicken_door
# - above: 1000
# then:
# - cover.open: chicken_door
- platform: bme280
temperature:
name: "BME280-1 Temperature"
oversampling: 16x
pressure:
name: "BME280-1 Pressure"
humidity:
name: "BME280-1 Humidity"
address: 0x76
switch:
- platform: gpio
pin: D3
name: "Close Chicken Door"
id: close_cover_switch
restore_mode: always off
- platform: gpio
pin: D6
name: "Open Chicken Door"
id: open_cover_switch
restore_mode: always off
cover:
- platform: time_based
name: "Chicken Door"
id: chicken_door
open_action:
- switch.turn_on: open_cover_switch
open_duration: 60s
close_action:
- switch.turn_on: close_cover_switch
close_duration: 60s
stop_action:
- switch.turn_off: open_cover_switch
- switch.turn_off: close_cover_switch
web_server:
port: 80