-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera.yaml
More file actions
603 lines (561 loc) · 23.8 KB
/
camera.yaml
File metadata and controls
603 lines (561 loc) · 23.8 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
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
blueprint:
name: QuickBars - Display Camera PiP
description: |
## QuickBars - Display Camera PiP v1.1
Toggle a live picture-in-picture camera view on your Android/Google TV with customizable size, position, and appearance.
### New in v1.1 (QuickBars v1.3.2+ required)
#### Advanced RTSP Settings
* **Transport Control:** Force TCP / UDP or use Auto to determine automatically.
* **Latency Tuning:** Choose between Low, Balanced, or High latency.
* **Software Decoder:** Fixes issues on some streams, requires higher processing power.
### Features
* Display camera feeds as PiP overlays on your TV
* Three source types: Home Assistant camera entity, QuickBars camera alias, or direct RTSP URL
* Flexible sizing: auto-detect, preset sizes (small/medium/large), or custom dimensions
* Customize position, title, toast, auto-hide behavior
* Advanced configuration for RTSP streams
* Target specific devices by App ID or broadcast to all devices on your network
### Requirements
* QuickBars for Home Assistant v1.3+ installed on your Android/Google TV
* Accessibility service enabled for QuickBars
* Display over other apps permission enabled for QuickBars
* Persistent background connection enabled (Settings → Connection in the app)
* For camera entities: camera must be imported in QuickBars app
* For camera aliases: alias must be configured in QuickBars app
domain: script
author: Trooped / Omri
source_url: https://github.com/Trooped/quickbars-blueprints/blob/main/camera.yaml
homeassistant:
min_version: "2024.6.0"
input:
# ===== CAMERA SOURCE =====
source:
name: Camera Source
icon: mdi:cctv
collapsed: false
input:
source_type:
name: Source Type
description: Select the camera source you'd like to display.
default: entity
selector:
select:
options:
- label: Camera Entity
value: entity
- label: QuickBars Camera Alias
value: alias
- label: RTSP URL
value: rtsp
camera_entity:
name: Camera Entity
description: Used only when Source type = entity. This camera entity must be imported to the QuickBars app.
default: ""
selector:
entity:
filter:
- domain: camera
camera_alias:
name: Camera Alias (QuickBars)
description: Used only when Source type = camera alias. Use the camera alias defined in the QuickBars app.
default: ""
selector:
text: {}
rtsp_url:
name: RTSP URL
description: "Used only when Source type = rtsp. Example: rtsp://user:pass@host:554/path"
default: ""
selector:
text: {}
# ===== ADVANCED RTSP SETTINGS =====
rtsp_advanced:
name: Advanced RTSP Settings
icon: mdi:wrench
collapsed: true
input:
mute_audio:
name: Mute Camera Audio
description: Mutes audio from the camera feed.
default: false
selector:
boolean: {}
rtsp_transport:
name: Transport Protocol
description: "TCP is recommended for Home Assistant to prevent artifacts/smearing. UDP is faster but requires a stable WiFi."
default: tcp
selector:
select:
options:
- label: TCP (Recommended)
value: tcp
- label: UDP (Faster, Low Latency)
value: udp
- label: Auto
value: auto
rtsp_latency:
name: Stream Latency / Buffer
description: "Low = 500ms buffer (fast). Balanced = 1s buffer. High = 2.5s buffer (fixes stuttering)."
default: balanced
selector:
select:
options:
- label: Low Latency
value: low
- label: Balanced (Standard)
value: balanced
- label: High Stability
value: high
software_decoder:
name: Force Software Decoder
description: "Try enabling this if you don't see any stream. Forces the CPU to decode video (requires higher processing power and may cause stuttering)."
default: false
selector:
boolean: {}
# ===== SIZE & POSITION =====
layout:
name: Size & Position
icon: mdi:resize
collapsed: true
input:
position:
name: Position
description: Screen corner for the PiP window.
default: top_right
selector:
select:
options:
- top_left
- top_right
- bottom_left
- bottom_right
size_mode:
name: Size Mode
description: |-
Choose how to size the camera PiP window:
- Auto: Existing camera size setting in QuickBars app (if imported camera) or default size.
- Preset: Choose from predefined sizes (small, medium, large).
- Custom: Specify exact width and height in pixels (can be used to support non-standard aspect ratios).
default: auto
selector:
select:
options:
- label: Auto
value: auto
- label: Preset
value: preset
- label: Custom
value: custom
size:
name: Size Preset
description: Used only when Size mode = preset. Choose from predefined sizes.
default: medium
selector:
select:
options:
- small
- medium
- large
custom_width:
name: Custom Width (pixels)
description: Used only when Size mode = custom. Width in pixels (48–3840).
default: 640
selector:
number:
min: 48
max: 3840
step: 1
unit_of_measurement: px
custom_height:
name: Custom Height (pixels)
description: Used only when Size mode = custom. Height in pixels (48–2160).
default: 360
selector:
number:
min: 48
max: 2160
step: 1
unit_of_measurement: px
# ===== BEHAVIOR =====
behavior:
name: Behavior
icon: mdi:cog
collapsed: true
input:
auto_hide:
name: Auto-hide (seconds)
description: Seconds before the camera automatically hides. Set to 0 to never auto-hide, requiring manual dismissal.
default: 30
selector:
number:
min: 0
max: 300
step: 1
unit_of_measurement: seconds
show_title:
name: Show Camera Title
description: Whether to show the camera's title in the PiP window.
default: true
selector:
boolean: {}
camera_title:
name: Custom Camera Title
description: Optional custom title to display in the camera title bar (used when "Show camera title" is enabled). Leave blank to use the default camera name.
default: ""
selector:
text: {}
show_toast:
name: Show Camera Toggle Toast
description: Whether to show a brief toast (pop-up message) when the camera PiP is toggled.
default: true
selector:
boolean: {}
# ===== TARGETING =====
targeting:
name: QuickBars Device Targeting
icon: mdi:bullseye
collapsed: true
input:
app_id:
name: QuickBars App ID (optional)
description: 8-character ID from the TV app (Settings → "QuickBars App ID"). Leave blank to broadcast to all QuickBars devices on the local network.
default: ""
selector:
text: {}
# Expose inputs to templates as variables
variables:
app_id: !input app_id
source_type: !input source_type
camera_entity: !input camera_entity
camera_alias: !input camera_alias
rtsp_url: !input rtsp_url
mute_audio: !input mute_audio
rtsp_transport: !input rtsp_transport
rtsp_latency: !input rtsp_latency
software_decoder: !input software_decoder
position: !input position
size_mode: !input size_mode
size: !input size
custom_width: !input custom_width
custom_height: !input custom_height
auto_hide: !input auto_hide
show_title: !input show_title
camera_title: !input camera_title
show_toast: !input show_toast
sequence:
# Validation: Check that appropriate source is provided
- choose:
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and not (camera_entity | string | trim) }}"
sequence:
- stop: Pick a Camera entity or change Source type.
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and not (camera_alias | string | trim) }}"
sequence:
- stop: Enter a Camera alias or change Source type.
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and not (rtsp_url | string | trim) }}"
sequence:
- stop: Enter an RTSP URL or change Source type.
# Fire event with or without app_id
- choose:
- conditions:
- condition: template
value_template: "{{ (app_id | string | trim) | length > 0 }}"
sequence:
- choose:
# Entity + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Entity + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Entity + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# RTSP + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"
# RTSP + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"
# RTSP + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
id: "{{ app_id }}"
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"
default:
- choose:
# Entity + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Entity + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Entity + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'entity' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
camera_entity: "{{ camera_entity }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# Alias + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'alias' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
camera_alias: "{{ camera_alias }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
# RTSP + Custom
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'custom' }}"
sequence:
- event: quickbars.open
event_data:
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
size_px:
w: "{{ (custom_width | int) }}"
h: "{{ (custom_height | int) }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"
# RTSP + Preset
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'preset' }}"
sequence:
- event: quickbars.open
event_data:
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
size: "{{ size }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"
# RTSP + Auto
- conditions:
- condition: template
value_template: "{{ source_type == 'rtsp' and size_mode == 'auto' }}"
sequence:
- event: quickbars.open
event_data:
rtsp_url: "{{ rtsp_url }}"
position: "{{ position }}"
auto_hide: "{{ (auto_hide | int) }}"
show_title: "{{ show_title }}"
camera_title: "{{ camera_title if (camera_title | string | trim) else none }}"
show_toast: "{{ show_toast }}"
mute_audio: "{{ mute_audio }}"
rtsp_transport: "{{ rtsp_transport }}"
rtsp_latency: "{{ rtsp_latency }}"
software_decoder: "{{ software_decoder }}"