Repository navigation
Expand file tree
/
Copy pathproflame2_test.yaml
More file actions
203 lines (170 loc) · 5.24 KB
/
Copy pathproflame2_test.yaml
File metadata and controls
203 lines (170 loc) · 5.24 KB
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
194
195
196
197
198
199
200
201
202
203
esphome:
name: proflame2-test
on_boot:
priority: -100
then:
- logger.log: "ProFlame2 Debug System Started"
- delay: 2s
- lambda: |-
auto* fireplace = id(my_fireplace);
fireplace->debug_check_config();
esp32:
board: denky32
framework:
type: arduino
external_components:
- source:
type: local
path: ./components
components: [proflame2]
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "ProFlame2-Debug"
password: !secret ap_password
# VERBOSE logging for debugging
logger:
level: VERBOSE
logs:
proflame2: VERBOSE # Maximum logging
api:
encryption:
key: !secret api_encryption_key
spi:
clk_pin: GPIO18
miso_pin: GPIO19
mosi_pin: GPIO23
proflame2:
id: my_fireplace
cs_pin: GPIO27
gdo0_pin: GPIO25
serial_number: 0xAA9402 # Your serial number
frequency: 314.973MHz
# Error-detection constants for THIS remote (0xAA9402), derived from and verified
# against all 15 distinct command frames in the SDR captures.
checksum_c1: 0xF
checksum_d1: 0xE
checksum_c2: 0xE
checksum_d2: 0x2
power:
name: "Fireplace Power"
icon: "mdi:fireplace"
pilot:
name: "Fireplace Pilot Mode"
icon: "mdi:fire"
entity_category: config
aux:
name: "Fireplace Aux Power"
icon: "mdi:power-plug"
flame:
name: "Fireplace Flame Height"
icon: "mdi:fire"
mode: slider
fan:
name: "Fireplace Fan Speed"
icon: "mdi:fan"
mode: slider
light:
name: "Fireplace Light Level"
icon: "mdi:lightbulb"
mode: slider
front:
name: "Fireplace Front Flame"
icon: "mdi:fire"
thermostat:
name: "Fireplace Thermostat Mode"
icon: "mdi:thermostat"
sensor:
- platform: wifi_signal
name: "Fireplace WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Fireplace Uptime"
binary_sensor:
- platform: status
name: "Fireplace Connection Status"
button:
- platform: restart
name: "Fireplace Controller Restart"
icon: "mdi:restart"
# DEBUG BUTTONS
- platform: template
name: "DEBUG: Check CC1101 Config"
icon: "mdi:chip"
on_press:
- lambda: |-
auto* fireplace = id(my_fireplace);
fireplace->debug_check_config();
- platform: template
name: "DEBUG: Verify CC1101 Hardware"
icon: "mdi:chip"
on_press:
- lambda: |-
auto* fireplace = id(my_fireplace);
ESP_LOGI("hw", "=== CC1101 HARDWARE CHECK ===");
// Read chip info
uint8_t partnum = fireplace->read_status_register(0x30);
uint8_t version = fireplace->read_status_register(0x31);
ESP_LOGI("hw", "Part Number: 0x%02X (should be 0x00)", partnum);
ESP_LOGI("hw", "Version: 0x%02X (should be 0x14 or 0x04)", version);
if (partnum != 0x00) {
ESP_LOGE("hw", "WRONG CHIP! This is not a CC1101!");
}
// Test register read/write (restore CHANNR=0 afterwards - leaving 0xA5
// here would detune the radio by ~20 MHz!)
fireplace->write_register(0x0A, 0xA5); // CHANNR test value
uint8_t readback = fireplace->read_register(0x0A);
ESP_LOGI("hw", "Register test: wrote 0xA5, read 0x%02X %s", readback,
readback == 0xA5 ? "(OK)" : "(FAIL - check SPI wiring)");
fireplace->write_register(0x0A, 0x00); // restore
// Check GDO0 pin voltage (if connected)
fireplace->write_register(0x02, 0x29); // Set GDO0 to output high
delay(10);
ESP_LOGI("hw", "Set GDO0 high - measure ~3.3V on GDO0 pin");
fireplace->write_register(0x02, 0x2E); // Set GDO0 to output low
delay(10);
ESP_LOGI("hw", "Set GDO0 low - measure ~0V on GDO0 pin");
fireplace->write_register(0x02, 0x02); // restore TX FIFO threshold function
- platform: template
name: "DEBUG: Minimal TX Test"
icon: "mdi:radio-tower"
on_press:
- lambda: |-
id(my_fireplace)->debug_minimal_tx();
# Transmits the exact state captured from the real remote on Dec 29
# (thermostat on, power off, fan 2, flame 6). rtl_433 -f 315M -R 207 must
# decode our transmission EXACTLY like the remote's:
# id: aa9402 cmd1: 02 cmd2: 26 err1: bc err2: 46 mic: CHECKSUM
- platform: template
name: "DEBUG: Replay Captured Frame"
icon: "mdi:radio-tower"
on_press:
- lambda: |-
auto* fp = id(my_fireplace);
fp->set_power(false);
fp->set_pilot_mode(false);
fp->set_thermostat(true);
fp->set_front_flame(false);
fp->set_aux_power(false);
fp->set_light_level(0);
fp->set_fan_level(2);
fp->set_flame_level(6);
fp->transmit_command(); // force a send even if state was already set
ESP_LOGI("replay", "Expect rtl_433: id=aa9402 cmd1=02 cmd2=26 err1=bc err2=46");
text_sensor:
- platform: version
name: "Fireplace ESPHome Version"
- platform: wifi_info
ip_address:
name: "Fireplace IP Address"
ssid:
name: "Fireplace Connected SSID"
web_server:
port: 80
auth:
username: admin
password: !secret web_password
time:
- platform: homeassistant
id: homeassistant_time