I don’t have my config online but here’s some key bits -
configuration.yaml - enables storage mode as default with two specific yaml dashboards
frontend:
themes: !include_dir_merge_named ../themes/
lovelace_gen:
lovelace:
mode: storage
dashboards:
db-mobile:
mode: yaml
title: Mobile
icon: mdi:cellphone-android
show_in_sidebar: true
filename: db_mobile.yaml
db-pc:
mode: yaml
title: PC
icon: mdi:laptop-chromebook
show_in_sidebar: true
filename: db_pc.yaml
db_pc.yaml - I keep this small and put each view in a separate include file
preload_cards:
- markdown
views: # split these out to make the files more manageable
- !include viewfiles/view_pc_media.yaml
- !include viewfiles/view_pc_broadcast.yaml
- !include viewfiles/view_pc_whereabouts.yaml
- !include viewfiles/view_pc_controls.yaml
view_pc_whereabouts.yaml - uses layout-card, so I can put things wherever I like, I also use lovelace_gen so I can reuse card configurations with different parameters.
# lovelace_gen
title: Whereabouts
path: presence
icon: mdi:map-search-outline
panel: true
cards:
- type: custom:layout-card
layout: grid
gridrows: 45% 45% auto
gridcols: 25% 25% 25% 25%
cards:
- !include
- card_person.yaml
- person: person.daniel
tracker: device_tracker.google_maps_100052762951237766231
pronoun: his
row: 1 / 2
col: 1 / 2
- !include
- card_person.yaml
- person: person.claire
tracker: device_tracker.google_maps_105978805128046889243
pronoun: her
row: 2 / 3
col: 1 / 2
- !include
- card_person.yaml
- person: person.april
tracker: device_tracker.google_maps_102322051749378610106
pronoun: her
row: 1 / 2
col: 4 / 5
- !include
- card_person.yaml
- person: person.ryan
tracker: device_tracker.google_maps_107837278918296041603
pronoun: his
row: 2 / 3
col: 4 / 5
- !include
- card_map.yaml
- row: 1 / 3
col: 2 / 4
- !include
- card_homer_map.yaml
- row: 2 / 3
col: 3 / 4
card_person.yaml - an actual card - most cards are a lot simpler than this
# lovelace_gen
type: custom:stack-in-card
title: Where's {{ person.split('.')[1]|capitalize }}?
gridrow: {{ row }}
gridcol: {{ col }}
style: 'ha-card { height: 100%; }'
cards:
- type: picture-elements
image: /local/images/medium-empty.png
elements:
- type: image
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.map_shows
option: {{ person }}
entity: {{ person }}
image: /local/images/{{ person.split('.')[1] }}.png
style:
top: 50%
left: 10%
width: 20%
- type: custom:hui-markdown-card
content: >
{% raw %}
Last seen {{ relative_time(state_attr('{% endraw %}{{ tracker }}{% raw%}', 'last_seen')) }} ago,
{% if states( '{% endraw %}{{ person }}{% raw%}' ) == 'not_home' %}
{{ distance( '{% endraw %}{{ person }}{% raw%}' ) | round(2) }} miles away at {{ state_attr('{% endraw %}{{ tracker }}{% raw%}', 'address') }}.
{% else %}
at {{ states( '{% endraw %}{{ person }}{% raw%}' ) }}.
{% endif %}
{% endraw %}{{ pronoun|capitalize }}{% raw%} phone was {{ state_attr('{% endraw %}{{ tracker }}{% raw%}', 'battery_level') }}% charged.
{% if distance( '{% endraw %}{{ person }}{% raw%}' ) > 1 %}
{% if states('sensor.{% endraw %}{{ person.split('.')[1] }}{% raw%}_to_home') != 'unknown' %}
In current traffic, it would take about {{ states('sensor.{% endraw %}{{ person.split('.')[1] }}{% raw%}_to_home') }} {{ state_attr('sensor.{% endraw %}{{ person.split('.')[1] }}{% raw%}_to_home', 'unit_of_measurement') }} to drive home.
{% endif %}
{% endif %}
{% endraw %}
theme: no-shadow
style:
transform: none
top: 10%
left: 20%
width: 75%
- type: history-graph
entities:
- {{ person }}
card_map.yaml - this is simpler
# lovelace_gen
type: custom:config-template-card
entities:
- input_select.map_shows
card:
type: map
entities:
- ${ states['input_select.map_shows'].state }
default_zoom: 18
style: 'ha-card { height: 100%; }'
gridrow: {{ row }}
gridcol: {{ col }}
That gives me this on a PC, when I click one of the side cards the map updates to show the person I clicked on. At the moment everyone’s home - if people were out I’d get different info showing, hence some of the complexity in the 1st card.
And on mobile I get something like this, by using a different view file, I have to scroll down to see the detail cards but can use the glance card to change who’s shown in the map: