-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice_base.yaml
90 lines (73 loc) · 1.69 KB
/
device_base.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
---
substitutions:
node_name: base
mac: 'C0FFEE'
release_id: 99999999
pin_led_status: GPIO25
pin_i2c: GPIO18
pin_uart_rx: GPIO17
pin_uart_tx: GPIO16
board: 'esp32dev'
platform: 'ESP32'
flash_write_interval: 5min
log_level: INFO
# BMXX80
bosch_sample_rate: lp # ulp
bme680_temperature_offset: '0'
# deep sleep
run_duration: 60s
sleep_duration: 5min
esphome:
name: ${node_name}
name_add_mac_suffix: true
project:
name: 'stefancrain.${node_name}'
version: ${release_id}
board: ${board}
platform: ${platform}
on_boot:
then:
- deep_sleep.prevent: deep_sleep_control
on_shutdown:
then:
- lambda: |-
id(ts_saved) = id(homeassistant_time).now().timestamp;
preferences:
flash_write_interval: '${flash_write_interval}'
logger:
level: '${log_level}'
logs:
switch: INFO
light: WARN
ota:
password: !secret ota_password
api:
password: !secret api_password
light:
- platform: status_led
name: '${mac} Status LED'
pin: '${pin_led_status}'
restore_mode: ALWAYS_OFF
web_server:
port: 80
packages:
wifi: !include packages/network.yaml
deep_sleep: !include packages/deep_sleep.yaml
globals: !include packages/globals.yaml
binary_sensor:
- <<: !include binary_sensor/connectivity.yaml
- <<: !include binary_sensor/deep_sleep.yaml
text_sensor:
- <<: !include text_sensor/wifi.yaml
- <<: !include text_sensor/uptime.yaml
sensor:
- <<: !include sensor/wifi.yaml
- <<: !include sensor/uptime.yaml
time:
- <<: !include time/sync-homeassistant.yaml
- <<: !include time/sync-sntp.yaml
script:
- <<: !include script/deep_sleep.yaml
sun:
latitude: !secret latitude
longitude: !secret longitude