From 9a4c87e398625d6bcc88254bf0b42fdd8269e838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 21 Aug 2019 23:42:11 +0200 Subject: [PATCH] Documentation for home-assistant/home-assistant-polymer#3505 (#10200) * Documentation for home-assistant/home-assistant-polymer#3505 * Add raw tags --- source/_lovelace/markdown.markdown | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/_lovelace/markdown.markdown b/source/_lovelace/markdown.markdown index e9ef40c5b76..f8aafc15067 100644 --- a/source/_lovelace/markdown.markdown +++ b/source/_lovelace/markdown.markdown @@ -46,3 +46,27 @@ content: > Starting with Home Assistant 0.72, we're experimenting with a new way of defining your interface. We're calling it the **Lovelace UI**. ``` + +## Template variables + +A special template variable - `config` is set up for the `content` of the card. It contains the configuration of the card. + +E.g. +{% raw %} +```yaml +type: entity-filter +entities: + - light.bed_light + - light.ceiling_lights + - light.kitchen_lights +card: + type: markdown + content: | + The lights that are on are: + {% for l in config.entities %} + - {{ l.entity }} + {%- endfor %} + + And the door is {% if is_state('binary_sensor.door', 'on' %} open {% else %} closed {% endif %}. +``` +{% endraw %}