Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you provide a simplest possible example? #6

Closed
MarkoPaasila opened this issue Dec 5, 2022 · 5 comments
Closed

Could you provide a simplest possible example? #6

MarkoPaasila opened this issue Dec 5, 2022 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MarkoPaasila
Copy link

The example leaves me confused. Could you please provide an example for creating a template of the entity_card card and deploying it with one single entity? No mushroom card, stack_card, or other custom cards. Thank you!

@ahbrims
Copy link

ahbrims commented Dec 5, 2022

The example leaves me confused. Could you please provide an example for creating a template of the entity_card card and deploying it with one single entity? No mushroom card, stack_card, or other custom cards. Thank you!

I have the same issue. I don't know what code to write to get the templated card to display in other dashboards. In my case I have the template /lovelace-templates/example with the the card:
type: entity
entity: sensor.time
what is the simplest code to get this to be displayed on an empty view?

@stefanschaedeli
Copy link

stefanschaedeli commented Dec 5, 2022

just add a manual card with
template: example

This card will now create an error, which you can ignore for now.

Create anoter card (same view or somewhere else) with following card:
- type: custom:linked-lovelace-ui

next click the update all button on this card.

It should have now updated the first card we created

@daredoes
Copy link
Owner

daredoes commented Dec 6, 2022

Hey! I'll do this soon!

I added a new card that helps you identify existing templates you can use, as well as what template data you can pass into it.

Although it's not documented anywhere... yet, you can pass data to a template card by surrounding anything with $ so
a template card of

type: markdown-card
name: '$name$'

would create a parameter of

template: demo
template_data:
    name: 'whatever you want'

@daredoes daredoes self-assigned this Dec 6, 2022
@daredoes daredoes added the documentation Improvements or additions to documentation label Dec 6, 2022
@daredoes
Copy link
Owner

daredoes commented Dec 6, 2022

@MarkoPaasila @ahbrims @stefanschaedeli

To make sure you aren't blocked on implementing your templates, here is a Starter Template Dashboard that can be dropped into your own HA instance.

https://github.com/daredoes/linked-lovelace-ui/wiki/Starter-View

@daredoes
Copy link
Owner

daredoes commented Dec 6, 2022

I should also note, the reason for the vertical stacks is because a template is limited to a View that has exactly one card. If there is more than one card on the view, I can't keep track of which one should be the template

@daredoes daredoes closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants