-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_board_config.yaml
83 lines (72 loc) · 2.79 KB
/
sample_board_config.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
#####
# ESPHome Layout Control
# Sample Board Configuration
# Use this as your starting point
esphome:
name: sta-bd-01
# Randomly delay the boot of the ESP from 3 to 10 seconds
on_boot:
- priority: 600
then:
- lambda: |-
int random_delay = random(3000, 10001); // milliseconds
ESP_LOGI("main", "Delaying boot for %d milliseconds", random_delay);
int delay_step = 100; // 100 ms delay steps to feed the watchdog
for (int i = 0; i < random_delay / delay_step; i++) {
delay(delay_step);
// Feed the watchdog
App.feed_wdt();
}
// Handle the remainder of the delay
delay(random_delay % delay_step);
ESP_LOGI("main", "Boot delay completed, continuing initialization");
# the type of board. If you bought the 38 pin one on my README, you don't need to change this.
esp32:
board: nodemcu-32s
# We selectively enable/disable logging components here.
logger:
level: DEBUG
logs:
number: NONE # required to be at DEBUG when you are calibrating servos
block_sensors: INFO
# upstream components we dont care about
servo: NONE
ledc: DEBUG
esp32.preferences: NONE
binary_sensor: NONE
sensor: DEBUG
# service logging
# This is where we import component-specific configuration. For each template you bring across and modify,
# simply uncomment a line that matches the file you copied.
# if you have multiple files - simply make the key (the left hand side of the colon) unique for each file.
# the reason for chunking this up is to make it easier to read and group similar bits of code together.
packages:
#gpio: !include sta-bd-01/gpio_01.yaml
#servos_01: !include sta-bd-01/servos_01.yaml
#signals: !include kia-bd-01/wled_signal.yaml
# Configure the connection to MQTT. JMRI also connects to this server, and this is
# how your ESPHome nodes and JMRI will exchange messages.
mqtt:
broker: !secret layout_mqtt_broker_ip # connect to the layout control MQTT Broker.
id: mqtt_server
discovery: false
on_message:
- topic: /trains/track/turnout/ADM/ResetESPs
payload: "THROWN"
then:
- button.press: reboot_esp
# Over-The-Air (OTA) updates allow you to update config on your ESPs once they are registered on your
# Dashboard. A very useful feature especially for things like Servo configuration which
# can be done wirelessly whilst still installed in the layout.
ota:
password: !secret ota_password # connecting back to the esphome dashboard
safe_mode: false
# lastly the wifi connection. We can't talk to anything unless we're on the network
wifi:
ssid: !secret layout_wifi_ssid
password: !secret layout_wifi_password
power_save_mode: none
button:
- platform: restart
id: reboot_esp
name: "ESP Restart"