From 8aa80f81030402c1c060df9ff68f30481ca4483d Mon Sep 17 00:00:00 2001
From: 3D <3d@n3rd3d.com>
Date: Sun, 18 Dec 2022 20:41:07 +0100
Subject: [PATCH] change popcorn to esp32

---
 .../templates/config/esphome_popcorn.yaml     | 121 ++++++++----------
 1 file changed, 52 insertions(+), 69 deletions(-)

diff --git a/intern/docker_esphome/templates/config/esphome_popcorn.yaml b/intern/docker_esphome/templates/config/esphome_popcorn.yaml
index 043f49bd..1e64af81 100644
--- a/intern/docker_esphome/templates/config/esphome_popcorn.yaml
+++ b/intern/docker_esphome/templates/config/esphome_popcorn.yaml
@@ -1,7 +1,7 @@
 {% set devicename = "esphome_popcorn"  %}
 
 {% include "/includes/ansible.inc.yaml" %}
-{% include "/includes/board.d1_mini.inc.yaml" %}
+{% include "/includes/board.esp32-doit-devkit-v1.inc.yaml" %}
 
   on_boot:
     priority: 250
@@ -13,77 +13,60 @@
 
 
 spi:
-  miso_pin: GPIO12
-  clk_pin: GPIO14
+  miso_pin: GPIO19
+  mosi_pin: GPIO23
+  clk_pin: GPIO18
 
-climate:
-  - platform: pid
-    id: pid_heater
-    name: "PID Heater Controller"
-    sensor: pot_sensor
-    default_target_temperature: 264
-    heat_output: pot_heater
-    control_parameters:
-      kp: 0.0
-      ki: 0.0
-      kd: 0.0
-    visual:
-      min_temperature: 0
-      max_temperature: 275
-      temperature_step: 1
+font:
+  - file: "gfonts://Roboto"
+    id: my_font
+    size: 115
+  - file: "04B03.ttf"
+    id: b03
+    size: 20
+    
+color:
+  - id: my_red
+    red: 100%
+    green: 0%
+    blue: 0%
+  - id: my_green
+    red: 0%
+    green: 100%
+    blue: 0%
+  - id: my_blue
+    red: 0%
+    green: 0%
+    blue: 100%
+  - id: my_yellow
+    red: 100%
+    green: 100%
+    blue: 0%
 
-button:
-  - platform: template
-    name: "PID Heater Autotune"
-    on_press:
-      - climate.pid.autotune: pid_heater
+display:
+  - platform: ili9341
+    model: TFT 2.4
+    cs_pin: GPIO5
+    dc_pin: GPIO16
+    reset_pin: GPIO17
+    rotation: 90°
 
-sensor:
-  - platform: max31855
-    name: "Pot Temperature"
-    id: pot_sensor
-    cs_pin: GPIO15
-    update_interval: 30s
-  - platform: pid
-    name: "PID Heater Result"
-    type: RESULT
-  - platform: pid
-    name: "PID PROPORTIONAL Result"
-    type: PROPORTIONAL
-  - platform: pid
-    name: "PID INTEGRAL Result"
-    type: INTEGRAL
-  - platform: pid
-    name: "PID DERIVATIVE Result"
-    type: DERIVATIVE
-  - platform: pid
-    name: "PID HEAT Result"
-    type: HEAT
+    lambda: |-
+      it.printf(160,120,id(my_font),TextAlign::CENTER,"264°C");
+
+time:
+  - platform: sntp
+    id: ntp_time
+    timezone: 'Europe/Berlin'
 
 output:
-  - platform: slow_pwm
-    pin: GPIO0
-    id: pot_heater
-    period: 15s
+  - platform: ledc
+    pin: GPIO4
+    id: gpio_4_backlight_pwm
 
-binary_sensor:
-- platform: gpio
-  pin: 
-    number: GPIO13
-    inverted: true
-    mode:
-      input: true
-      pullup: true
-  name: "Heat Button"
-  id: heat_button
-  on_release:
-    then:
-      - climate.control:
-          id: pid_heater
-          mode: "OFF"
-  on_press:
-    then:
-      - climate.control:
-          id: pid_heater
-          mode: HEAT
-          target_temperature: 264
\ No newline at end of file
+light:
+  - platform: monochromatic
+    output: gpio_4_backlight_pwm
+    name: "ILI9341 Display Backlight"
+    id: back_light
+    restore_mode: ALWAYS_ON
\ No newline at end of file
-- 
GitLab