Closed sresam89 closed 2 years ago
if I Change my config as below
You're putting the full state and attributes of the sensor into the entity
field. So unless you are planning on using the state object later on, I would change it to:
variables:
- sensor.user_10
If you are planning on using the state object later, you want to use the entity_id
i.e.
'${vars[0].entity_id}'
That still did not help Could you help with the full config?
This is not an issue for Github. This question is supposed to be asked in the Community forum first since there are errors in the code.
Whenever you post a code, use special tags - then people can copy-paste your example for testing, and in the 1st post you pasted the code without these tags, it is formatted in a wrong way. Also, do not post a code as a picture. Next time people will simply ignore these issues.
There are examples below with working code:
type: vertical-stack
cards:
- type: custom:config-template-card
variables:
- states['sun.sun']
entities:
- ${vars[0].entity_id}
card:
type: entity
entity: ${vars[0].entity_id}
- type: custom:config-template-card
variables:
- '''sun.sun'''
entities:
- ${vars[0]}
card:
type: entity
entity: ${vars[0]}
- type: custom:config-template-card
variables:
- '"sun.sun"'
entities:
- ${vars[0]}
card:
type: entity
entity: ${vars[0]}
Checklist:
[ ] I updated to the latest version available
[ ] I cleared the cache of my browser
Release with the issue:
Last working release (if known):
Browser and Operating System: Lastest Chrome
Attempting to use https://github.com/iantrich/config-template-card#templated-entities-example with slightest mods as below `type: custom:config-template-card variables:
**
Javascript errors shown in the web inspector (if applicable):![image](https://user-images.githubusercontent.com/21145490/129618950-e4d41ca4-f540-4fcf-ae77-b92d1b87fe25.png)
Additional information: developers state![image](https://user-images.githubusercontent.com/21145490/129619308-3a4037c9-17b7-44c4-b520-40f9ccc6041d.png)