Skip to content

Commit cf7f48d

Browse files
committed
Jinja test
1 parent 3ad5fda commit cf7f48d

37 files changed

Lines changed: 1953 additions & 1005 deletions

docs/smart-home/dashboards/dashboard-persons/car.md

Lines changed: 302 additions & 118 deletions
Large diffs are not rendered by default.

docs/smart-home/dashboards/dashboard-persons/daughter.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ tags:
1010
**Dashboard:** Persons
1111
**Path:** `Daughter`
1212

13-
<!-- START_DESCRIPTION -->
14-
No description provided.
15-
<!-- END_DESCRIPTION -->
16-
17-
![View Screenshot](../../../assets/images/dashboards/dashboard_daughter.png)
18-
19-
## Summary
2013
<!-- START_SUMMARY -->
2114
*No summary generated yet.*
2215
<!-- END_SUMMARY -->
2316

17+
![View Screenshot](../../../assets/images/dashboards/dashboard_daughter.png)
18+
2419

2520

2621
## Dependencies (Custom Cards)
@@ -30,7 +25,7 @@ Required HACS frontend resources:
3025

3126

3227
## Configuration
33-
```yaml
28+
```yaml+jinja
3429
theme: Backend-selected
3530
title: Daughter
3631
path: Daughter
@@ -48,6 +43,6 @@ cards:
4843
- type: custom:decluttering-card
4944
template: family_member_notifications
5045
variables:
51-
- person: Guest-2
46+
- person: Guest 2
5247
5348
```

docs/smart-home/dashboards/dashboard-persons/evis.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ tags:
1010
**Dashboard:** Persons
1111
**Path:** `evis`
1212

13-
<!-- START_DESCRIPTION -->
14-
Personal dashboard for Evis displaying status, device tracking, and notification preferences.
15-
<!-- END_DESCRIPTION -->
16-
17-
![View Screenshot](../../../assets/images/dashboards/dashboard_evis.png)
18-
19-
## Summary
2013
<!-- START_SUMMARY -->
2114
This dashboard serves as a personal hub for Evis. It features a profile card using the `family_member_card` template to display status and tracked device (`sm_f966b`) information. Additionally, it includes a dynamic "My Notification Settings" list automatically generated by `custom:auto-entities`. This section captures all notification switches associated with Evis (filtered by `_notification_Evis`), allowing for granular control over various notification categories.
2215
<!-- END_SUMMARY -->
2316

17+
![View Screenshot](../../../assets/images/dashboards/dashboard_evis.png)
18+
2419

2520

2621
## Dependencies (Custom Cards)
@@ -31,7 +26,7 @@ Required HACS frontend resources:
3126

3227

3328
## Configuration
34-
```yaml
29+
```yaml+jinja
3530
theme: Backend-selected
3631
title: Evis
3732
badges: []
@@ -54,16 +49,25 @@ sections:
5449
show_header_toggle: false
5550
icon: mdi:bell-cog
5651
filter:
57-
template: "{% set user_slug = 'Evis' %} {# <--- CHANGE THIS to the person's\
58-
\ slug #}\n{% set ns = namespace(switches=[]) %}\n\n{% for state in states.switch\
59-
\ %}\n {# Find switches ending with _notification_[user_slug] #}\n {% if\
60-
\ state.entity_id.endswith('_notification_' ~ user_slug) %}\n {# Extract\
61-
\ category (e.g. switch.info_notification_Evis -> info) #}\n {% set category\
62-
\ = state.object_id.split('_notification_')[0] | capitalize %}\n \n \
63-
\ {% set ns.switches = ns.switches + [{\n 'entity': state.entity_id,\n\
64-
\ 'name': category ~ \" Notification\", \n 'secondary_info':\
65-
\ 'last-updated'\n }] %}\n {% endif %}\n{% endfor %}\n\n{{ ns.switches\
66-
\ | to_json }}\n"
52+
template: |-
53+
{% set user_slug = 'Evis' %} {# <--- CHANGE THIS to the person's slug #}
54+
{% set ns = namespace(switches=[]) %}
55+
56+
{% for state in states.switch %}
57+
{# Find switches ending with _notification_[user_slug] #}
58+
{% if state.entity_id.endswith('_notification_' ~ user_slug) %}
59+
{# Extract category (e.g. switch.info_notification_Evis -> info) #}
60+
{% set category = state.object_id.split('_notification_')[0] | capitalize %}
61+
62+
{% set ns.switches = ns.switches + [{
63+
'entity': state.entity_id,
64+
'name': category ~ " Notification",
65+
'secondary_info': 'last-updated'
66+
}] %}
67+
{% endif %}
68+
{% endfor %}
69+
70+
{{ ns.switches | to_json }}
6771
sort:
6872
method: name
6973
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
tags:
3+
- dashboard
4+
- view
5+
- automated
6+
---
7+
8+
# Guest 1
9+
10+
**Dashboard:** Persons
11+
**Path:** `Guest 1`
12+
13+
<!-- START_SUMMARY -->
14+
*No summary generated yet.*
15+
<!-- END_SUMMARY -->
16+
17+
![View Screenshot](../../../assets/images/dashboards/dashboard_guest1.png)
18+
19+
20+
21+
## Dependencies (Custom Cards)
22+
Required HACS frontend resources:
23+
24+
* `custom:auto-entities`
25+
* `custom:decluttering-card`
26+
27+
28+
## Configuration
29+
```yaml+jinja
30+
theme: Backend-selected
31+
title: Guest 1
32+
path: Guest 1
33+
badges: []
34+
cards: []
35+
type: sections
36+
sections:
37+
- type: grid
38+
cards:
39+
- type: heading
40+
heading: New section
41+
- type: custom:decluttering-card
42+
template: family_member_card
43+
variables:
44+
- person: Guest 1
45+
- device: SM_S721B_Guest 1
46+
- background: background_3
47+
- color: '#ddd'
48+
- type: custom:auto-entities
49+
card:
50+
type: entities
51+
title: My Notification Settings
52+
show_header_toggle: false
53+
icon: mdi:bell-cog
54+
filter:
55+
template: |-
56+
{% set user_slug = 'Guest 1' %} {# <--- CHANGE THIS to the person's slug #}
57+
{% set ns = namespace(switches=[]) %}
58+
59+
{% for state in states.switch %}
60+
{# Find switches ending with _notification_[user_slug] #}
61+
{% if state.entity_id.endswith('_notification_' ~ user_slug) %}
62+
{# Extract category (e.g. switch.info_notification_Evis -> info) #}
63+
{% set category = state.object_id.split('_notification_')[0] | capitalize %}
64+
65+
{% set ns.switches = ns.switches + [{
66+
'entity': state.entity_id,
67+
'name': category ~ " Notification",
68+
'secondary_info': 'last-updated'
69+
}] %}
70+
{% endif %}
71+
{% endfor %}
72+
73+
{{ ns.switches | to_json }}
74+
sort:
75+
method: name
76+
max_columns: 4
77+
78+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
tags:
3+
- dashboard
4+
- view
5+
- automated
6+
---
7+
8+
# Guest 2
9+
10+
**Dashboard:** Persons
11+
**Path:** `Guest 2`
12+
13+
<!-- START_SUMMARY -->
14+
*No summary generated yet.*
15+
<!-- END_SUMMARY -->
16+
17+
![View Screenshot](../../../assets/images/dashboards/dashboard_guest2.png)
18+
19+
20+
21+
## Dependencies (Custom Cards)
22+
Required HACS frontend resources:
23+
24+
* `custom:decluttering-card`
25+
26+
27+
## Configuration
28+
```yaml+jinja
29+
theme: Backend-selected
30+
title: Guest 2
31+
path: Guest 2
32+
badges: []
33+
cards:
34+
- type: vertical-stack
35+
cards:
36+
- type: custom:decluttering-card
37+
template: family_member_card
38+
variables:
39+
- person: Guest 2
40+
- device: mobile_Guest 2
41+
- background: background_3
42+
- color: '#dddddd'
43+
- type: custom:decluttering-card
44+
template: family_member_notifications
45+
variables:
46+
- person: Guest 2
47+
48+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
tags:
3+
- dashboard
4+
- view
5+
- automated
6+
---
7+
8+
# Guest 3
9+
10+
**Dashboard:** Persons
11+
**Path:** `Guest 3`
12+
13+
<!-- START_SUMMARY -->
14+
*No summary generated yet.*
15+
<!-- END_SUMMARY -->
16+
17+
![View Screenshot](../../../assets/images/dashboards/dashboard_guest3.png)
18+
19+
20+
21+
## Dependencies (Custom Cards)
22+
Required HACS frontend resources:
23+
24+
* `custom:decluttering-card`
25+
26+
27+
## Configuration
28+
```yaml+jinja
29+
theme: Backend-selected
30+
title: Guest 3
31+
path: Guest 3
32+
badges: []
33+
cards:
34+
- type: vertical-stack
35+
cards:
36+
- type: custom:decluttering-card
37+
template: family_member_card
38+
variables:
39+
- person: Guest 3
40+
- device: sm_a426b_Guest 3
41+
- background: background_3
42+
- color: '#dddddd'
43+
- type: custom:decluttering-card
44+
template: family_member_notifications
45+
variables:
46+
- person: Guest 3
47+
48+
```

docs/smart-home/dashboards/dashboard-persons/map-all.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@ tags:
1010
**Dashboard:** Persons
1111
**Path:** `map-all`
1212

13-
<!-- START_DESCRIPTION -->
14-
No description provided.
15-
<!-- END_DESCRIPTION -->
16-
17-
![View Screenshot](../../../assets/images/dashboards/dashboard_map-all.png)
18-
19-
## Summary
2013
<!-- START_SUMMARY -->
2114
*No summary generated yet.*
2215
<!-- END_SUMMARY -->
2316

17+
![View Screenshot](../../../assets/images/dashboards/dashboard_map-all.png)
18+
2419

2520

2621

2722

2823
## Configuration
29-
```yaml
24+
```yaml+jinja
3025
theme: Backend-selected
3126
title: Map All
3227
path: map-all
@@ -35,10 +30,10 @@ badges: []
3530
cards:
3631
- type: map
3732
entities:
38-
- entity: person.Guest-3
39-
- entity: person.Guest-2
33+
- entity: person.Guest 3
34+
- entity: person.Guest 2
4035
- entity: person.Evis
41-
- entity: person.Guest-1
36+
- entity: person.Guest 1
4237
- entity: person.Daughter
4338
- entity: person.car
4439
hours_to_show: 2

docs/smart-home/dashboards/dashboard-persons/map-daughter.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@ tags:
1010
**Dashboard:** Persons
1111
**Path:** `map-Daughter`
1212

13-
<!-- START_DESCRIPTION -->
14-
No description provided.
15-
<!-- END_DESCRIPTION -->
16-
17-
![View Screenshot](../../../assets/images/dashboards/dashboard_map-daughter.png)
18-
19-
## Summary
2013
<!-- START_SUMMARY -->
2114
*No summary generated yet.*
2215
<!-- END_SUMMARY -->
2316

17+
![View Screenshot](../../../assets/images/dashboards/dashboard_map-daughter.png)
18+
2419

2520

2621

2722

2823
## Configuration
29-
```yaml
24+
```yaml+jinja
3025
theme: Backend-selected
3126
title: Map Daughter
3227
path: map-Daughter

docs/smart-home/dashboards/dashboard-persons/map-evis.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@ tags:
1010
**Dashboard:** Persons
1111
**Path:** `map-Evis`
1212

13-
<!-- START_DESCRIPTION -->
14-
No description provided.
15-
<!-- END_DESCRIPTION -->
16-
17-
![View Screenshot](../../../assets/images/dashboards/dashboard_map-evis.png)
18-
19-
## Summary
2013
<!-- START_SUMMARY -->
2114
*No summary generated yet.*
2215
<!-- END_SUMMARY -->
2316

17+
![View Screenshot](../../../assets/images/dashboards/dashboard_map-evis.png)
18+
2419

2520

2621

2722

2823
## Configuration
29-
```yaml
24+
```yaml+jinja
3025
theme: Backend-selected
3126
subview: true
3227
title: Map Evis

0 commit comments

Comments
 (0)