From 491a0f9141de8b5d30a449b4082874ae2ff4fc86 Mon Sep 17 00:00:00 2001
From: 3D <3d@n3rd3d.com>
Date: Sat, 17 Dec 2022 23:27:51 +0100
Subject: [PATCH] add popcorn machine

---
 functions                                     |  2 +-
 intern/docker_esphome/tasks/main.yml          |  1 +
 .../templates/config/esphome_popcorn.yaml     | 44 +++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 intern/docker_esphome/templates/config/esphome_popcorn.yaml

diff --git a/functions b/functions
index e8a04941..900377e4 160000
--- a/functions
+++ b/functions
@@ -1 +1 @@
-Subproject commit e8a049414bca2b14b158444dac1b94c2ca90d9be
+Subproject commit 900377e4f72486f6699ecf736f96adfbc04e92da
diff --git a/intern/docker_esphome/tasks/main.yml b/intern/docker_esphome/tasks/main.yml
index 334dc132..5176bbf6 100644
--- a/intern/docker_esphome/tasks/main.yml
+++ b/intern/docker_esphome/tasks/main.yml
@@ -55,6 +55,7 @@
     - config/esphome_plug06.yaml
     - config/esphome_plug07.yaml
     - config/esphome_plug08.yaml
+    - config/esphome_popcorn.yaml
   register: config
 
 - name: "stop {{ servicename }} docker"
diff --git a/intern/docker_esphome/templates/config/esphome_popcorn.yaml b/intern/docker_esphome/templates/config/esphome_popcorn.yaml
new file mode 100644
index 00000000..2e1da231
--- /dev/null
+++ b/intern/docker_esphome/templates/config/esphome_popcorn.yaml
@@ -0,0 +1,44 @@
+{% set devicename = "esphome_popcorn"  %}
+
+{% include "/includes/ansible.inc.yaml" %}
+{% include "/includes/board.d1_mini.inc.yaml" %}
+{% include "/includes/common.inc.yaml" %}
+
+
+spi:
+  miso_pin: GPIO12
+  clk_pin: GPIO14
+
+climate:
+  - platform: pid
+    id: pid_climate
+    name: "PID Climate Controller"
+    sensor: pot_sensor
+    default_target_temperature: 21°C
+    heat_output: heater
+    control_parameters:
+      kp: 0.0
+      ki: 0.0
+      kd: 0.0
+
+button:
+  - platform: template
+    name: "PID Climate Autotune"
+    on_press:
+      - climate.pid.autotune: pid_climate
+
+sensor:
+  - platform: pid
+    name: "PID Climate Result"
+    type: RESULT
+  - platform: max31855
+    name: "Pot Temperature"
+    id: pot_sensor
+    cs_pin: GPIO15
+    update_interval: 30s
+
+output:
+  - platform: slow_pwm
+    pin: GPIO0
+    id: heater
+    period: 15s
\ No newline at end of file
-- 
GitLab