Skip to content

Instantly share code, notes, and snippets.

@ttonyh
Forked from TheGroundZero/esp32_ttgo_t5_213.yaml
Created January 13, 2024 20:00
Show Gist options
  • Save ttonyh/c824d2421d5be2472c205a1b14af882c to your computer and use it in GitHub Desktop.
Save ttonyh/c824d2421d5be2472c205a1b14af882c to your computer and use it in GitHub Desktop.

Revisions

  1. @TheGroundZero TheGroundZero created this gist May 8, 2021.
    104 changes: 104 additions & 0 deletions esp32_ttgo_t5_213.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,104 @@
    # Board
    # https://s.click.aliexpress.com/e/_9IDl91
    # ESPHome docs:
    # - https://esphome.io/components/display/waveshare_epaper.html
    # - https://esphome.io/components/spi.html#spi
    # - https://esphome.io/components/display/index.html#formatted-text

    substitutions:
    esphome_name: esp32_ttgo_t5

    esphome:
    name: "${esphome_name}"
    platform: ESP32
    board: esp32dev

    wifi:
    ssid: !secret iot_wifi_ssid
    password: !secret iot_wifi_pass
    domain: .iot.local

    # Enable logging
    logger:

    # Enable Home Assistant API
    api:
    reboot_timeout: 60min
    password: !secret esphome_api_pass

    ota:
    password: !secret esphome_ota_pass

    web_server:
    port: 80

    time:
    - platform: homeassistant
    id: homeassistant_time

    spi:
    clk_pin: 18
    mosi_pin: 23

    font:
    - file: "_fonts/Roboto-Regular.ttf"
    id: roboto
    size: 16

    display:
    - platform: waveshare_epaper
    cs_pin: 5
    dc_pin: 17
    busy_pin: 4
    reset_pin: 16
    model: 2.13in-ttgo
    update_interval: 1s
    full_update_every: 30
    lambda: |-
    it.printf(0, 0, id(roboto), "Hello World!");
    it.strftime(0, 16, id(roboto), "%Y-%m-%d %H:%M", id(homeassistant_time).now());
    it.printf(0, 32, id(roboto), "Button is %s", id(button).state ? "PRESSED" : "RELEASED");
    sensor:
    # General
    - platform: uptime
    name: "${esphome_name} - Uptime Sensor"
    - platform: wifi_signal
    name: "${esphome_name} - WiFi Signal"
    update_interval: 60s

    binary_sensor:
    - platform: gpio
    pin:
    number: 39
    inverted: True
    mode: INPUT_PULLUP
    name: "${esphome_name} - Button"
    id: button

    switch:
    # General
    - platform: gpio
    name: "${esphome_name} - Onboard LED"
    pin: 19
    id: onboard_led
    - platform: restart
    name: "${esphome_name} - Restart"
    id: restart_switch

    text_sensor:
    # ESPHome version
    - platform: version
    name: "${esphome_name} ESPHome Version"
    # WiFi information
    - platform: wifi_info
    ip_address:
    name: "${esphome_name} IP"
    id: ip_address
    ssid:
    name: "${esphome_name} SSID"
    id: ssid
    bssid:
    name: "${esphome_name} BSSID"
    id: bssid