-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathesphome-ge-dryer-uart.yml
193 lines (170 loc) · 4.14 KB
/
esphome-ge-dryer-uart.yml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
substitutions:
name: dryer
upper_name: Dryer
init: 'component_geUART::instance(id(uart_bus));'
esphome:
name: dryer
platform: esp32
board: nodemcu-32s
includes:
- esphome-ge-dryer-uart.h
# Enable logging via web interface only
logger:
baud_rate: 0 #115200
# Enable Home Assistant API
api:
ota:
password: !secret esp_home_ota_pw
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional manual IP
manual_ip:
static_ip: 192.168.0.191
gateway: 192.168.0.9
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
#ap:
# ssid: ${upper_name} Fallback Hotspot
# password: !secret esp_home_captive_pw
#captive_portal:
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
#Half Duplex Config
uart:
id: uart_bus
tx_pin:
number: GPIO18
inverted: true
rx_pin:
number: GPIO19
inverted: true
baud_rate: 19200
debug:
direction: TX
after:
timeout: 50ms
sequence:
- lambda: UARTDebug::log_hex(direction, bytes, ' ');
#Full Duplex GEA3 Config
#uart:
# - id: uart_bus
# tx_pin:
# number: GPIO17
# inverted: false
# rx_pin:
# number: GPIO16
# inverted: false
# baud_rate: 230400
# debug:
# direction: BOTH
# after:
# timeout: 50ms
# sequence:
# - lambda: UARTDebug::log_hex(direction, bytes, ' ');
#
custom_component:
- lambda: |-
auto c_ge_uart = ${init}
return {c_ge_uart};
sensor:
# Uptime sensor.
- platform: uptime
name: ${upper_name} Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: ${upper_name} WiFi Signal
update_interval: 60s
- platform: custom
lambda: |-
auto c_ge_uart = ${init}
return {
c_ge_uart->sensor_remainingTime,
c_ge_uart->sensor_cycleCount
};
sensors:
- name: ${upper_name} Time Remaining
unit_of_measurement: min
accuracy_decimals: 1
icon: mdi:progress-clock
- name: ${upper_name} Cycle Count
accuracy_decimals: 0
icon: mdi:progress-clock
# Text sensors with general information.
text_sensor:
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: ${upper_name} IP
- platform: custom
lambda: |-
auto c_ge_uart = ${init}
return {
c_ge_uart->textsensor_State,
c_ge_uart->textsensor_Cycle,
c_ge_uart->textsensor_SubState,
c_ge_uart->textsensor_endOfCycle,
c_ge_uart->textsensor_DrynessSetting,
c_ge_uart->textsensor_HeatSetting,
c_ge_uart->textsensor_Door
};
text_sensors:
- name: ${upper_name} State
icon: mdi:tumble-dryer
- name: ${upper_name} Cycle
icon: mdi:tumble-dryer
- name: ${upper_name} SubState
icon: mdi:tumble-dryer
- name: ${upper_name} End of Cycle
icon: mdi:alarm-check
- name: ${upper_name} Dryness Setting
icon: mdi:water-circle
- name: ${upper_name} Heat Setting
icon: mdi:thermometer
- name: ${upper_name} Door
icon: mdi:door
# Example configuration entry
#binary_sensor:
# - platform: gpio
# pin:
# number: GPIO14
# mode:
# input: true
# pullup: true
# inverted: True
# id: push_button
# filters:
# - delayed_off: 10ms
# - delayed_on: 10ms
# on_press:
# then:
# - output.turn_on: green_led
# on_release:
# then:
# - output.turn_off: green_led
output:
- platform: gpio
pin: GPIO2
id: onboard_led
inverted: True
- platform: gpio
pin: GPIO13
id: green_led
inverted: false
#turn on blue led on at boot and back off when connected to wifi
interval:
- interval: 1s
then:
if:
condition:
wifi.connected:
then:
- output.turn_on: green_led
else:
- output.turn_off: green_led
button:
#HA button to restart.
- platform: restart
name: ${upper_name} Restart