Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Created May 8, 2021 23:05
Show Gist options
  • Save TheGroundZero/22a12fdbfdfd3b7bd985fdb105ff3faf to your computer and use it in GitHub Desktop.
Save TheGroundZero/22a12fdbfdfd3b7bd985fdb105ff3faf to your computer and use it in GitHub Desktop.
TTGO T5 v2.3.1 2.13" display in ESPHome
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment