Last active 1719118046

using ESPHome

Revision ae8db165887e0ed09c71f344ec9fb7f77d7abf88

esp32-clock.yaml Raw
1esp32:
2 board: esp32-c3-devkitm-1
3 variant: ESP32C3
4
5i2c:
6 sda: GPIO6
7 scl: GPIO7
8 frequency: 800kHz
9
10font:
11 - file: "gfonts://Roboto"
12 id: roboto
13 size: 12
14
15time:
16 - platform: sntp
17 id: sntp_time
18 on_time:
19 - cron: '/2 * * * * *'
20 then:
21 - switch.turn_off: relay
22
23display:
24 - platform: ssd1306_i2c
25 model: "SSD1306 128x32"
26 lambda: |-
27 it.strftime(0, 0, id(roboto), "%Y-%m-%d", id(sntp_time).now());
28 it.strftime(0, 16, id(roboto), "%H:%M %a", id(sntp_time).now());
29
30switch:
31 - platform: gpio
32 name: "Relay"
33 id: relay
34 pin: GPIO3
35 inverted: False
36 on_turn_off:
37 - delay: 1s
38 - switch.turn_on: relay