forked from nicolaij/esphomes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp01dht.yaml
115 lines (99 loc) · 2.38 KB
/
esp01dht.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
substitutions:
num: "1"
name: floor_$num
network: "192.168.1"
server: $network.20
esphome:
name: esp01dht-$num
on_boot:
priority: 250
then:
- component.update: dht_id
esp8266:
board: esp01_1m
# framework:
# type: esp-idf
wifi:
ssid: !secret wifi_ssid_home
password: !secret wifi_password_home
reboot_timeout: 0s
ap:
ssid: AP_$name
password: !secret ap_password
# power_save_mode: HIGH
manual_ip:
static_ip: $network.2$num
gateway: $network.1
subnet: 255.255.255.0
dns1: $network.1
#captive_portal:
# Enable logging
logger:
#level: VERY_VERBOSE
#level: DEBUG
# Enable Home Assistant API
api:
reboot_timeout: 0s
ota:
# Активация web сервера
web_server:
port: 80
ota: false
version: 1
http_request:
useragent: esphome/device
timeout: 5s
# Individual sensors
sensor:
- platform: uptime
name: Uptime Sensor
update_interval: 5min
- platform: dht
id: dht_id
model: DHT11
pin: 2
update_interval: never
temperature:
name: "Living Room Temperature"
id: dht_temp_id
on_value:
then:
- delay: 5s
- http_request.post:
url: !lambda |-
char buf[128];
sprintf(buf, "http://%s/number/%s_sensor_temperature_data/set?value=%f","$server", "$name", id(dht_temp_id).state * 10);
return buf;
humidity:
name: "Living Room Humidity"
id: dht_hum_id
on_value:
then:
- delay: 10s
- http_request.post:
url: !lambda |-
char buf[128];
sprintf(buf, "http://%s/number/%s_sensor_humidity_data/set?value=%f","$server", "$name", id(dht_hum_id).state);
return buf;
- component.update: vcc_id
- platform: adc
pin: VCC
name: "VCC Voltage"
id: vcc_id
update_interval: never
on_value:
then:
- http_request.post:
url: !lambda |-
char buf[128];
sprintf(buf, "http://%s/number/%s_sensor_vcc_data/set?value=%f","$server", "$name", id(vcc_id).state * 1000);
return buf;
- delay: 30s
- deep_sleep.enter:
id: deep_sleep_1
sleep_duration: 9min
# Example configuration entry
deep_sleep:
run_duration: 3min
sleep_duration: 10min
id: deep_sleep_1