-
Notifications
You must be signed in to change notification settings - Fork 3
/
smoker-controller.yaml
145 lines (145 loc) · 3.75 KB
/
smoker-controller.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# esphome-version: next
substitutions:
display_name: Smoker
device_name: camp_chef
esphome:
name: smoker_controller
platform: ESP32
board: nodemcu-32s
on_boot:
priority: 0
then:
- text_sensor.template.publish:
id: active_mode
state: "OFF"
includes:
- sen30008/sen30008.h
- sen30008/PlayingWithFusion_MAX31856.h
- sen30008/PlayingWithFusion_MAX31856.cpp
- sen30008/PlayingWithFusion_MAX31856_STRUCT.h
# wifi:
api:
services:
- service: force_off
then:
- lambda: |-
onForceOff();
- service: activate_feed
then:
- lambda: |-
onActivateFeed();
- service: activate_bypass
then:
- lambda: |-
onBypass();
- service: pid_autotune
then:
- climate.pid.autotune: smoker_pid
- service: pid_integral_reset
then:
- climate.pid.reset_integral_term: smoker_pid
- service: set_pid_params
variables:
kp: float
ki: float
kd: float
then:
- climate.pid.set_control_parameters:
id: smoker_pid
kp: !lambda 'return kp;'
ki: !lambda 'return ki;'
kd: !lambda 'return kd;'
ota:
logger:
level: INFO
text_sensor:
- platform: template
name: "${display_name} - Active Mode"
id: active_mode
internal: no
on_value:
then:
- lambda: |-
onActiveModeUpdate(x);
switch:
- platform: restart
name: "Smoker Restart"
binary_sensor:
- platform: template
name: "${display_name} - Flameout Watch Enabled"
id: flameout_watch
- platform: template
name: "${display_name} - General Timer Enabled"
id: general_timer_enabled
sensor:
- platform: custom
lambda: |-
auto sen30008 = new SEN30008Device(25, 26, 27, 33, 32, 22, 23); // (sck, miso, mosi, tc_0, tc_1, tc_2, tc_3)
App.register_component(sen30008);
return {sen30008->internal_temp, sen30008->tc_0, sen30008->tc_1, sen30008->tc_2, sen30008->tc_3};
sensors:
- name: "${display_name} - SEN-30008 Internal Temp"
unit_of_measurement: °C
id: smoker_cold_junction
accuracy_decimals: 1
- name: "${display_name} - Temperature" # TC_0
id: smoker_temperature
unit_of_measurement: °C
accuracy_decimals: 1
on_value:
then:
- lambda: |-
onSmokerTemperatureUpdate(x);
- name: "${display_name} - Left Thermocouple" # TC_1
unit_of_measurement: °C
accuracy_decimals: 1
- name: "${display_name} - Right Thermocouple" # TC_2
unit_of_measurement: °C
accuracy_decimals: 1
- name: "${display_name} - Looped Thermocouple" # TC_3
# internal: yes
unit_of_measurement: °C
accuracy_decimals: 1
output:
- platform: custom
type: float
lambda: |-
auto pid_output = new PidModeFloatOutput();
App.register_component(pid_output);
return {pid_output};
outputs:
- id: pid_output
climate:
- platform: custom
lambda: |-
auto my_custom_climate = new SmokerController();
App.register_component(my_custom_climate);
return {my_custom_climate};
climates:
- name: "Smoker Control"
internal: no
id: smoker_control
visual:
min_temperature: 70
max_temperature: 260
temperature_step: 5
time:
- platform: sntp
id: sntp_time
on_time:
- cron: "* * * * * *"
then:
- lambda: |-
onClockTick();
uart:
tx_pin: GPIO15
rx_pin: GPIO02
baud_rate: 9600
display:
- platform: nextion
lambda: |-
if (id(active_mode).state != "OFF"){
it.set_backlight_brightness(100);
} else {
it.set_backlight_brightness(0);
}