-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Help to pass input_select helper to decluttering template #54
Comments
I had a similar issue and gave up. |
Templates may be passed as variables:
But templates cannot be used "inside templates"... |
you can do it, but it's javascript, not jinja. So: variables:
- roomname: >-
{{ states('input_select.test_area') }} becomes: variables:
- roomname: "[[[ return states['input_select.test_area'].state ]]]" ...I popped in onto a single line, but you can still do it on multiple lines: variables:
- roomname: >-
[[[ return states['input_select.test_area'].state ]]] |
The original question was "how to pass a template as a variable" - and a possible solution was provided here. BTW, I was not quite right when said
because it IS possible with using a custom
The original question was about using |
My attempts to pass templates as variables using jinja have failed in the past and someone on this forum showed me that javascript works. Edit: Ugh, it’s 10 mins, 1 cup-of-coffee and some checking of my yaml later. I now remember why I am using javascript and not jinja; all my decluttering templates use …sorry for the bum info. |
Hi, I have decluttering templates working quite well, including nested ones. However, I've run into a block.
I have several rooms, each with a
binary_sensor.[[roomname]]_window
entity. I pass the roomname as text when I call the template entity, and it all works great.However, I'd also like to have a separate page where the
[[roomname]]
is set byinput_select.room_selector
with the various room names listed.So I have this:
And the cards:
I've tried all sorts of variations, using
custom:template-entity-row
or directly using- entity: 'binary_sensor.[[roomname]]_window'
and so on. I've tried using the'{{states("input_select.room_selector")}}'
function instead ofstates.input_select.room_selector.state
and so on.Nothing is working for me. Some fail with "Unknown" in the UI, others don't render the card with various types of error. Happy to supply those errors if anyone thinks it might help.
Has anyone every seen this before and have an idea on how to fix please?
The text was updated successfully, but these errors were encountered: