esp32: board: esp32-c3-devkitm-1 variant: ESP32C3 i2c: sda: GPIO6 scl: GPIO7 frequency: 800kHz binary_sensor: - platform: gpio pin: GPIO9 id: boot filters: - delayed_on: 10ms on_release: then: - switch.toggle: clock_active internal: True time: - platform: sntp id: sntp_time on_time: - cron: '/2 * * * * *' then: - if: condition: - switch.is_on: clock_active then: - delay: 500ms - switch.turn_on: relay switch: - platform: template id: clock_active name: "Clock active" optimistic: True restore_mode: ALWAYS_OFF - platform: gpio name: "Relay" id: relay pin: GPIO0 inverted: True on_turn_on: - delay: 1s - switch.turn_off: relay font: - file: "gfonts://Roboto" id: roboto25 size: 25 - file: "gfonts://Roboto" id: roboto14 size: 14 display: - platform: ssd1306_i2c model: "SSD1306 128x32" flip_y: False flip_x: False lambda: |- it.strftime(0, -5, id(roboto25), "%H:%M", id(sntp_time).now()); it.strftime(64, -2, id(roboto14), "%S", id(sntp_time).now()); it.strftime(it.get_width(), -2, id(roboto14), TextAlign::TOP_RIGHT, "%a", id(sntp_time).now()); it.strftime(it.get_width(), 15, id(roboto14), TextAlign::TOP_RIGHT, "%b %d", id(sntp_time).now()); it.draw_pixel_at(id(sntp_time).now().second+1, 30, COLOR_ON); it.line(0,27,61,27); it.draw_pixel_at(0,28,COLOR_ON); it.draw_pixel_at(61,28,COLOR_ON); # it.printf(it.get_width(), 0, id(roboto14), TextAlign::TOP_RIGHT, "%.2f°C", id(temp).state); # it.printf(0, 0, id(roboto14), "%.5f", id(temp).state);