Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: espwifi
- esp32:
- board: esp32dev
- framework:
- #type: arduino
- type: esp-idf # Better!
- psram:
- mode: quad
- speed: 80MHz
- # Enable logging
- logger:
- level: DEBUG
- switch:
- - platform: restart
- name: "Plate01 Restart"
- - platform: safe_mode
- name: "Plate01 Restart (Safe Mode)"
- packages:
- wifi: !include common/wifi.yml
- color:
- - id: my_red
- red: 100%
- green: 0%
- blue: 0%
- - id: my_orange
- red: 100%
- green: 50%
- blue: 0%
- - id: my_yellow
- red: 100%
- green: 100%
- blue: 0%
- - id: my_green
- red: 0%
- green: 100%
- blue: 0%
- - id: my_blue
- red: 0%
- green: 0%
- blue: 100%
- - id: my_teal
- red: 0%
- green: 100%
- blue: 100%
- - id: my_gray
- red: 70%
- green: 70%
- blue: 70%
- - id: my_white
- red: 100%
- green: 100%
- blue: 100%
- - id: my_black
- red: 0%
- green: 0%
- blue: 0%
- font:
- - file: "fonts/helvetica.ttf"
- id: helvetica_48
- size: 48
- - file: "fonts/helvetica.ttf"
- id: helvetica_36
- size: 36
- - file: "fonts/helvetica.ttf"
- id: helvetica_24
- size: 24
- - file: "fonts/helvetica.ttf"
- id: helvetica_12
- size: 12
- spi:
- - id: lcd
- clk_pin: GPIO14
- mosi_pin: GPIO13
- miso_pin: GPIO12
- - id: touch
- clk_pin: GPIO25
- mosi_pin: GPIO32
- miso_pin: GPIO39
- i2c:
- sda: GPIO27
- scl: GPIO22
- scan: true
- id: bus_a
- time:
- - platform: sntp
- id: esp_time
- timezone: "America/New_York"
- on_time_sync:
- then:
- - logger.log: "Synchronized sntp clock"
- sensor:
- - platform: homeassistant
- entity_id: sensor.openweathermap_temperature
- id: owm_temp
- display:
- - platform: ili9xxx
- invert_colors: false
- model: ILI9341
- color_palette: 8BIT
- spi_id: lcd
- cs_pin: 15
- dc_pin: 2
- lambda: |-
- int hs = it.get_width() / 2; // Horizontal Spacing = text data horizontal center point
- int hq = it.get_width() / 4; // text data horizontal center for two vertical lines
- int vs = it.get_height() / 8; // Vertical Center = text data vertical center point = how many lines
- int line_gap = 21; // distance of line from center of data text
- it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
- it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue));
- it.strftime(5, 5, id(helvetica_12), id(my_white), TextAlign::TOP_LEFT, "%Y-%m-%d %H:%M:%S", id(esp_time).now());
- if (id(owm_temp).has_state()) {
- it.printf(5, 40, id(helvetica_12), id(my_white), "%.1f °F", id(owm_temp).state);
- } else {
- it.print(5, 40, id(helvetica_12), id(my_white), "Loading...");
- }
- # Define pins for backlight display and back LED1
- output:
- - platform: ledc
- pin: GPIO21
- id: former_led_pin
- - platform: ledc
- id: output_red
- pin: GPIO4
- inverted: true
- - platform: ledc
- id: output_green
- pin: GPIO16
- inverted: true
- - platform: ledc
- id: output_blue
- pin: GPIO17
- inverted: true
- # Define a monochromatic, dimmable light for the backlight
- light:
- - platform: monochromatic
- output: former_led_pin
- name: "Display Backlight"
- id: back_light
- restore_mode: ALWAYS_ON
- - platform: rgb
- name: LED
- red: output_red
- id: led
- green: output_green
- blue: output_blue
- restore_mode: ALWAYS_OFF
- touchscreen:
- platform: xpt2046
- spi_id: touch
- cs_pin: 33
- interrupt_pin: 36
- update_interval: 50ms
- threshold: 400
- calibration:
- x_min: 280
- x_max: 3860
- y_min: 340
- y_max: 3860
- transform:
- mirror_x: true
- mirror_y: false
- swap_xy: false
Advertisement
Add Comment
Please, Sign In to add comment