-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.yaml
309 lines (282 loc) · 8.22 KB
/
test.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# This sample is intended for testing code changes and sould work with any ESP32 board.
# You can monitor TFT commands in the console logs to see what would be displayed on screen.
# TFT reboot is simulated on boot.
# Note: To use this sample, create a Home Assistant instance with the `demo:` entry in the configuration.yaml
# Example TFT commands (use the `simulate_tft_message` service call):
# Note: you can find the page and item uuids at the bottom of the main.cpp build file `.build/nspanel-test/src/main.cpp`
# - Simulate TFT reboot (EU model, firmware version 53): `event,startup,53,eu`
# - Navigate to Extras 1 Card: `event,buttonPress2,navigate.uuid.extras_1_card,button`
# - Navigate to screensaver: `event,buttonPress2,navigate.uuid.1,button`
# - Navigate to first card: `event,buttonPress2,screensaver,bExit`
# - Close the current page / go back to screensaver: `event,sleepReached,`
# - Open a popupPage (open the page where the entity exists first):
# - Timer: `event,pageOpenDetail,popupTimer,uuid.15`
# - Start timer with time 0:35:40: `event,buttonPress2,uuid.15,timer-start,0:35:40`
# - RGBW Light: `event,pageOpenDetail,popupLight,uuid.12`
# - Input Select: `event,pageOpenDetail,popupInSel,climate.ecobee`
substitutions:
node_name: nspanel-test
esphome:
name: $node_name
name_add_mac_suffix: true
comment: "NSPanel test device"
build_path: ./.build/${node_name}
platformio_options:
build_flags:
- -DTEST_DEVICE_MODE
- -DFAKE_TFT_UPLOAD
esp32:
board: lolin32_lite
framework:
type: esp-idf
# version: latest
# platform_version: '6.9.0'
external_components:
- source: components
components: [nspanel_lovelace]
nspanel_lovelace:
id: nspanel
locale:
temperature_unit: celcius
language: en
sleep_timeout: 10
screensaver:
time_id: homeassistant_time
weather:
entity_id: weather.forecast_home
## WARNING: There is not enough RAM to support lots of cards on a basic ESP32 without PSRAM
## If you have memory issues, try disabling a few unused cards and try again.
cards:
- type: cardGrid
id: lights_card
title: Lights
sleep_timeout: 10
# hidden: true
entities:
- entity_id: switch.decorative_lights
name: switch
- entity_id: light.ceiling_lights
name: color_temp,hs
- entity_id: light.entrance_color_white_lights
name: hs,white
- entity_id: light.office_rgbw_lights
name: rgbw
- entity_id: light.living_room_rgbww_lights
name: rgbww
- type: cardEntities
id: extras_1_card
title: Extras 1
sleep_timeout: 30
entities:
- entity_id: timer.test_timer
name: Timer
- entity_id: delete
- entity_id: fan.living_room_fan
name: Fan
- entity_id: cover.garage_door
name: Cover (Garage)
- type: cardEntities
id: extras_2_card
title: Extras 2
sleep_timeout: 30
entities:
- entity_id: sensor.total_energy_kwh
name: Energy Sensor
- entity_id: sensor.outside_temperature
name: Temp Sensor
- entity_id: weather.demo_weather_south
name: Weather
- entity_id: navigate.qr_card
name: QR Card
- type: cardGrid2
id: extras_3_card
title: Extras 3
entities:
- entity_id: cover.living_room_window
name: Tilt Cover (Window)
- entity_id: climate.ecobee
name: Climate Ecobee
- entity_id: climate.hvac
name: Climate HVAC
- entity_id: select.speed
name: Select Speed
- type: cardEntities
id: extras_4_card
title: Extras 4
sleep_timeout: 30
entities:
- entity_id: number.pwm_1
name: Number Decimal
- entity_id: lock.openable_lock
name: Openable Lock
- entity_id: fan.percentage_limited_fan
name: Fan
- entity_id: vacuum.5_fifth_floor
name: Vacuum 5
- type: cardEntities
id: extras_5_card
title: Extras 5
sleep_timeout: 30
entities:
- entity_id: sun.sun
name: Sun
- entity_id: person.oliver
name: Person
- entity_id: text.text
name: Text
- entity_id: alarm_control_panel.security
name: Alarm
- type: cardQR
id: qr_card
title: WiFi
sleep_timeout: 30
hidden: true
qr_text: WIFI:S:SSID;T:WPA;P:PASSWORD;;
entities:
- entity_id: iText.ssid
name: SSID
icon: wifi
- entity_id: iText.password
name: Password
icon: key
- type: cardAlarm
id: alarm_card
sleep_timeout: 60
title: Alarm
alarm_entity_id: alarm_control_panel.security
- type: cardThermo
id: thermo_card_1
sleep_timeout: 60
title: Thermo Ecobee
thermo_entity_id: climate.ecobee
- type: cardThermo
id: thermo_card_2
sleep_timeout: 60
title: Thermo HVAC
thermo_entity_id: climate.hvac
- type: cardThermo
id: thermo_card_3
sleep_timeout: 60
title: Thermo heatpump
thermo_entity_id: climate.heatpump
- type: cardMedia
id: media_card
sleep_timeout: 60
title: Media Lounge
media_entity_id: media_player.lounge_room
# entities:
# - entity_id: sensor.carbon_dioxide
logger:
baud_rate: 115200
level: DEBUG #[NONE,ERROR,WARN,DEBUG,VERBOSE,VERY_VERBOSE]
logs:
adc: INFO
api: INFO
app: INFO
uart: INFO
time: INFO
switch: INFO
sensor: INFO
button: INFO
text_sensor: INFO
resistance: INFO
mdns: INFO
ntc: INFO
ota: INFO
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# IMPORTANT: Keep this to connect to hidden network
fast_connect: true
reboot_timeout: 30min
api:
services:
# Service to send a command directly to the display. Useful for testing
- service: send_tft_command
variables:
cmd: string
then:
- lambda: 'id(nspanel).send_display_command(cmd);'
- service: upload_tft
variables:
url: string
then:
- lambda: 'id(nspanel).upload_tft(url);'
- service: simulate_tft_message
variables:
cmd: string
then:
- lambda: 'id(nspanel).process_command(cmd);'
ota:
platform: esphome
# Uart for the Nextion display
uart:
id: uart_nextion
tx_pin: 16
rx_pin: 17
baud_rate: 115200
time:
- platform: homeassistant
id: homeassistant_time
timezone: Europe/London
on_time:
# At midnight
- seconds: 0
minutes: 0
hours: 0
then:
- lambda: 'id(nspanel).set_display_dim(1, 50);'
# At 8:00 PM
- seconds: 0
minutes: 0
hours: 20
then:
- lambda: 'id(nspanel).set_display_dim(20, 80);'
# At 7:00 AM
- seconds: 0
minutes: 0
hours: 7
then:
- lambda: 'id(nspanel).set_display_dim(50, 100);'
binary_sensor:
# Right button below the display
- platform: gpio
name: $node_name Right Button
pin:
number: GPIO27
inverted: true
id: right_button
internal: true
on_click:
# Simulate TFT reboot
- button.press: tft_reboot
button:
- platform: restart
id: restart_switch
name: $node_name Restart
- platform: template
name: $node_name TFT Reboot
id: tft_reboot
on_press:
# Simulate TFT reboot
- lambda: 'id(nspanel).process_command("event,startup,53,eu");'
- platform: template
name: $node_name PrintDebugInfo
on_press:
- logger.log:
format: "DebugInfo model:%s ver:%hu mem:{min_heap:%u,psram_used:%hu,int_min_free:%hu,int_free:%hu,int_max_free_blk:%hu}"
args: [
'Configuration::get_model_str().c_str()',
'Configuration::get_version()',
'esp_get_minimum_free_heap_size()',
'psram_used()',
'heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL)',
'heap_caps_get_free_size(MALLOC_CAP_INTERNAL)',
'heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL)'
]
text_sensor:
- platform: wifi_info
ip_address:
name: ${node_name} IP Address
bssid:
name: ${node_name} BSSID