-
Notifications
You must be signed in to change notification settings - Fork 22
/
jura_coffee.yaml
182 lines (158 loc) · 4.66 KB
/
jura_coffee.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
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
substitutions:
devicename: jura_coffee
friendly_name: Coffee Machine
device_description: Jura Coffee Machine in Kitchen
esphome:
name: $devicename
comment: ${device_description}
platform: ESP8266
board: d1_mini
platformio_options:
upload_speed: 115200
includes:
- jura_coffee.h
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: .lan
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “${friendly_name} Fallback AP"
password: !secret fallback_ap_password
captive_portal:
logger:
level: DEBUG
# Enable Home Assistant API & OTA Updates
api:
password: !secret api_password
ota:
password: !secret ota_password
uart:
tx_pin: D1
rx_pin: D2
baud_rate: 9600
id: uart_bus
# UART bytes below have been generated with generate_esphome_jura_yaml.py
# Tested with a Jura Impressa J6
switch:
- platform: template
name: 'Coffee Machine'
icon: "mdi:coffee-maker"
id: jura_on_off_switch
turn_on_action:
- uart.write: [0xDF, 0xDB, 0xDB, 0xDF] ## 'A'
- delay: 8ms
- uart.write: [0xFB, 0xFF, 0xDB, 0xDF] ## 'N'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xFF, 0xDB] ## ':'
- delay: 8ms
- uart.write: [0xDB, 0xDB, 0xFF, 0xDB] ## '0'
- delay: 8ms
- uart.write: [0xDF, 0xDB, 0xFF, 0xDB] ## '1'
- delay: 8ms
- uart.write: [0xDF, 0xFF, 0xDB, 0xDB] ## '\r'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xDB, 0xDB] ## '\n'
turn_off_action:
- uart.write: [0xDF, 0xDB, 0xDB, 0xDF] ## 'A'
- delay: 8ms
- uart.write: [0xFB, 0xFF, 0xDB, 0xDF] ## 'N'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xFF, 0xDB] ## ':'
- delay: 8ms
- uart.write: [0xDB, 0xDB, 0xFF, 0xDB] ## '0'
- delay: 8ms
- uart.write: [0xFB, 0xDB, 0xFF, 0xDB] ## '2'
- delay: 8ms
- uart.write: [0xDF, 0xFF, 0xDB, 0xDB] ## '\r'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xDB, 0xDB] ## '\n'
optimistic: true
assumed_state: true
- platform: template
name: 'Make Hot Water'
icon: "mdi:cup-water"
id: jura_make_hot_water
turn_on_action:
- uart.write: [0xFB, 0xDF, 0xDB, 0xDF] ## 'F'
- delay: 8ms
- uart.write: [0xDF, 0xDB, 0xDB, 0xDF] ## 'A'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xFF, 0xDB] ## ':'
- delay: 8ms
- uart.write: [0xDB, 0xDB, 0xFF, 0xDB] ## '0'
- delay: 8ms
- uart.write: [0xFB, 0xDF, 0xFF, 0xDB] ## '6'
- delay: 8ms
- uart.write: [0xDF, 0xFF, 0xDB, 0xDB] ## '\r'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xDB, 0xDB] ## '\n'
- platform: template
name: 'Make Coffee'
icon: "mdi:coffee"
id: jura_make_coffee
turn_on_action:
- uart.write: [0xFB, 0xDF, 0xDB, 0xDF] ## 'F'
- delay: 8ms
- uart.write: [0xDF, 0xDB, 0xDB, 0xDF] ## 'A'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xFF, 0xDB] ## ':'
- delay: 8ms
- uart.write: [0xDB, 0xDB, 0xFF, 0xDB] ## '0'
- delay: 8ms
- uart.write: [0xDF, 0xFB, 0xFF, 0xDB] ## '9'
- delay: 8ms
- uart.write: [0xDF, 0xFF, 0xDB, 0xDB] ## '\r'
- delay: 8ms
- uart.write: [0xFB, 0xFB, 0xDB, 0xDB] ## '\n'
sensor:
- platform: uptime
name: "${friendly_name} Uptime"
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 60s
- platform: template
id: num_single_espresso
name: "Single Espressos Made"
accuracy_decimals: 0
lambda: "return {};"
- platform: template
id: num_double_espresso
name: "Double Espressos Made"
accuracy_decimals: 0
lambda: "return {};"
- platform: template
id: num_coffee
name: "Coffees Made"
accuracy_decimals: 0
lambda: "return {};"
- platform: template
id: num_double_coffee
name: "Double Coffees Made"
accuracy_decimals: 0
lambda: "return {};"
- platform: template
id: num_clean
name: "Cleanings Performed"
accuracy_decimals: 0
lambda: "return {};"
text_sensor:
- platform: version
name: "${friendly_name} ESPHome version"
- platform: template
id: tray_status
name: "Tray Status"
lambda: "return {};"
- platform: template
id: tank_status
name: "Water Tank Status"
lambda: "return {};"
binary_sensor:
- platform: status
name: "${friendly_name} Status"
# Custom component to poll coffee machine counters & status
custom_component:
- lambda: |-
auto my_jura = new JuraCoffee(id(uart_bus),id(num_single_espresso),id(num_double_espresso),id(num_coffee),id(num_double_coffee),id(num_clean),id(tray_status),id(tank_status));
App.register_component(my_jura);
return {my_jura};