Map Card
The Map card that allows you to display entities on a map
Screenshot of the map card.
To add the Map card to your user interface, click the menu (three dots at the top right of the screen) and then Edit Dashboard. Click the Add Card button in the bottom right corner and select from the card picker.
All options for this card can be configured via the user interface.
YAML Configuration
The following YAML options are available when you use YAML mode or just prefer to use YAML in the Code Editor in the UI.
Configuration Variables
List of entity IDs or entity
objects (see below). Either this or the geo_location_sources
configuration option is required.
List of geolocation sources. All current entities with that source will be displayed on the map. See Geolocation platform for valid sources. Set to all
to use all available sources. Either this or the entities
configuration option is required.
The map will follow moving entities
by adjusting the viewport of the map each time an entity is updated.
Forces the height of the image to be a ratio of the width. Valid formats: Height percentage value (23%
) or ratio expressed with colon or “x” separator (16:9
or 16x9
). For a ratio, the second element can be omitted and will default to “1” (1.78
equals 1.78:1
).
The default zoom level of the map.
14 (or whatever zoom level is required to fit all visible markers)
The default_zoom
value will be ignored if it is set higher than the current zoom level
after fitting all visible entity markers in the map window. In other words, this can only
be used to zoom the map out by default.
Options For Entities
If you define entities as objects instead of strings (by adding entity:
before entity ID), you can add more customization and configuration.
Configuration Variables
When set to state
, renders the entity’s state as the label for the map marker instead of the entity’s name. This option doesn’t apply to zone entities because they don’t use a label but an icon.
Examples
type: map
aspect_ratio: 16:9
default_zoom: 8
auto_fit: true
entities:
- device_tracker.demo_paulus
- zone.home
type: map
geo_location_sources:
- nsw_rural_fire_service_feed
entities:
- zone.home
type: map
entities:
- device_tracker.demo_paulus
- entity: sensor.gas_station_gas_price
label_mode: state
focus: false
hours_to_show: 48