-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_esphome.yml
87 lines (71 loc) · 1.98 KB
/
example_esphome.yml
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
```
### This is a basic esphome firmware definition for the sole purpose
### of demonstrating the Dynamic Cron external component.
esphome:
name: dynamicron
friendly_name: Dynamic Cron Scheduler
on_boot:
- then:
- lambda: |-
printf("[I] Dynamic Cron firmware timestamp: %i\n", esphome::dynamic_cron::TIMESTAMP);
esp32:
board: esp32doit-devkit-v1
framework:
type: arduino
# Enables logging
logger:
# Enables Home Assistant API
# api:
# reboot_timeout: 0s # Never reboots due to home-assistant connection.
# encryption:
# key: !secret api_encryption_key
### Over-the-air updates
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 0s # Never reboots due to wifi connection.
# Enables fallback hotspot (captive portal, if that's enabled) in case wifi connection fails
ap:
ssid: "dynamicron"
password: !secret wifi_password
ap_timeout: 10s # Enables access-point ssid if can't connect to wifi ssid.
web_server:
version: 3
port: 80
local: true
# Enables wifi-setup and flashing interface if we fallback to ap mode (see ap:).
captive_portal:
# We need 'time' for any scheduler to work properly.
time:
#- platform: homeassistant
- platform: sntp
servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
id: esp_time
### EXTERNAL COMPONENTS
external_components:
- source:
type: git
url: https://github.com/ginjo/esphome-dynamic-cron
dynamic_cron:
- name: Lawn
id: lawn_schedule
disabled: true
crontab: "0 0 2 * * *"
lambda: |-
ESP_LOGD("lawn", "Lawn schedule lambda running @ %s", lawn_schedule->timeToString().c_str());
return {true};
- name: Drip
id: drip_schedule
crontab: "0 0 1 * * *"
remember_next: false
clear_prefs: false
lambda: |-
ESP_LOGD("drip", "Drip schedule lambda running @ %s", drip_schedule->timeToString().c_str());
return {true};
```