LordBravery

Untitled

Jan 11th, 2026
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.70 KB | Help | 0 0
  1. esphome:
  2.   name: espwifi
  3.  
  4. esp32:
  5.   board: esp32dev
  6.   framework:
  7.    #type: arduino
  8.     type: esp-idf  # Better!
  9.  
  10. psram:
  11.   mode: quad
  12.   speed: 80MHz
  13.  
  14. # Enable logging
  15. logger:
  16.   level: DEBUG
  17.  
  18. switch:
  19.   - platform: restart
  20.     name: "Plate01 Restart"
  21.  
  22.  
  23.   - platform: safe_mode
  24.     name: "Plate01 Restart (Safe Mode)"
  25.    
  26. packages:
  27.   wifi: !include common/wifi.yml
  28.  
  29. color:
  30.   - id: my_red
  31.     red: 100%
  32.     green: 0%
  33.     blue: 0%
  34.   - id: my_orange
  35.     red: 100%
  36.     green: 50%
  37.     blue: 0%
  38.   - id: my_yellow
  39.     red: 100%
  40.     green: 100%
  41.     blue: 0%
  42.   - id: my_green
  43.     red: 0%
  44.     green: 100%
  45.     blue: 0%
  46.   - id: my_blue
  47.     red: 0%
  48.     green: 0%
  49.     blue: 100%
  50.   - id: my_teal
  51.     red: 0%
  52.     green: 100%
  53.     blue: 100%
  54.   - id: my_gray
  55.     red: 70%
  56.     green: 70%
  57.     blue: 70%
  58.   - id: my_white
  59.     red: 100%
  60.     green: 100%
  61.     blue: 100%
  62.   - id: my_black
  63.     red: 0%
  64.     green: 0%
  65.     blue: 0%
  66.  
  67. font:
  68.   - file: "fonts/helvetica.ttf"
  69.     id: helvetica_48
  70.     size: 48
  71.   - file: "fonts/helvetica.ttf"
  72.     id: helvetica_36
  73.     size: 36
  74.   - file: "fonts/helvetica.ttf"
  75.     id: helvetica_24
  76.     size: 24
  77.   - file: "fonts/helvetica.ttf"
  78.     id: helvetica_12
  79.     size: 12
  80.  
  81. spi:
  82.   - id: lcd
  83.     clk_pin: GPIO14
  84.     mosi_pin: GPIO13
  85.     miso_pin: GPIO12
  86.   - id: touch
  87.     clk_pin: GPIO25
  88.     mosi_pin: GPIO32
  89.     miso_pin: GPIO39
  90.  
  91. i2c:
  92.   sda: GPIO27
  93.   scl: GPIO22
  94.   scan: true
  95.   id: bus_a
  96.  
  97.  
  98. time:
  99.   - platform: sntp
  100.     id: esp_time
  101.     timezone: "America/New_York"
  102.     on_time_sync:
  103.       then:
  104.         - logger.log: "Synchronized sntp clock"
  105.  
  106. sensor:
  107.   - platform: homeassistant
  108.     entity_id: sensor.openweathermap_temperature
  109.     id: owm_temp
  110.  
  111. display:
  112.   - platform: ili9xxx
  113.     invert_colors: false
  114.     model: ILI9341
  115.     color_palette: 8BIT
  116.     spi_id: lcd
  117.     cs_pin: 15
  118.     dc_pin: 2
  119.     lambda: |-
  120.       int hs = it.get_width() / 2; // Horizontal Spacing = text data horizontal center point
  121.       int hq = it.get_width() / 4; // text data horizontal center for two vertical lines
  122.       int vs = it.get_height() / 8; // Vertical Center = text data vertical center point = how many lines
  123.       int line_gap = 21; // distance of line from center of data text
  124.       it.rectangle(0,  0, it.get_width(), it.get_height(), id(my_blue));
  125.       it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue));
  126.  
  127.       it.strftime(5, 5, id(helvetica_12), id(my_white), TextAlign::TOP_LEFT, "%Y-%m-%d %H:%M:%S", id(esp_time).now());
  128.  
  129.       if (id(owm_temp).has_state()) {
  130.         it.printf(5, 40, id(helvetica_12), id(my_white), "%.1f °F", id(owm_temp).state);
  131.       } else {
  132.         it.print(5, 40, id(helvetica_12), id(my_white), "Loading...");
  133.       }
  134.  
  135.  
  136. # Define pins for backlight display and back LED1
  137. output:
  138.   - platform: ledc
  139.     pin: GPIO21
  140.     id: former_led_pin
  141.   - platform: ledc
  142.     id: output_red
  143.     pin: GPIO4
  144.     inverted: true
  145.   - platform: ledc
  146.     id: output_green
  147.     pin: GPIO16
  148.     inverted: true
  149.   - platform: ledc
  150.     id: output_blue
  151.     pin: GPIO17
  152.     inverted: true
  153.  
  154. # Define a monochromatic, dimmable light for the backlight
  155. light:
  156.   - platform: monochromatic
  157.     output: former_led_pin
  158.     name: "Display Backlight"
  159.     id: back_light
  160.     restore_mode: ALWAYS_ON
  161.   - platform: rgb
  162.     name: LED
  163.     red: output_red
  164.     id: led
  165.     green: output_green
  166.     blue: output_blue
  167.     restore_mode: ALWAYS_OFF
  168.  
  169.  
  170.  
  171. touchscreen:
  172.   platform: xpt2046
  173.   spi_id: touch
  174.   cs_pin: 33
  175.   interrupt_pin: 36
  176.   update_interval: 50ms
  177.   threshold: 400
  178.   calibration:
  179.     x_min: 280
  180.     x_max: 3860
  181.     y_min: 340
  182.     y_max: 3860
  183.   transform:
  184.     mirror_x: true
  185.     mirror_y: false
  186.     swap_xy: false
Advertisement
Add Comment
Please, Sign In to add comment