#@AleXSR700 Even though you have the
1 messages · Page 1 of 1 (latest)
@fervent ruin yaml type: custom:auto-entities card: type: custom:layout-card layout_type: custom:grid-layout layout_options: width: 100 layout: grid-template-columns: auto auto grid-template-rows: auto filter: include: - entity_id: light.*_lights options: type: custom:button-card entity_id: this.entity_id layout: vertical show_last_changed: true aspect_ratio: 1/1
[ ... style section removed to save space ... ]yaml exclude: - state: 'off' - entity_id: '*screen*' - entity_id: light.all_lights - state: '0' - state: unavailable sort: method: name reverse: false numeric: false show_empty: true
Hmmm, yes,I had the same approach working before switching to templating.
But I am trying to pass the area as the respective name and for that I think I have to use filter: template:
Might be making some progress. I couldn't get your namespace to return anything.
So. new, simplified approach:
card:
type: thermostat
card_param: cards
filter:
template: |-
{% set ns = namespace(list=[]) %}
{% for item in states.climate | selectattr('entity_id', 'search', 'eq3', ignorecase=True) %}
{% set ns.list = ns.list + [ item ] %}
{% endfor %}
{% for item in ns.list -%}
{{ "entity": item.entity_id }}
{%- endfor %}
sort:
method: friendly_name
Gives error
Specify an entity from within the climate domain
cards: []
type: thermostat
And I am guessing the namespace list is not a list because it returns in Template Editor:
Result type: string
climate.eq3_living_room_climateclimate.eq3_dining_room_climateclimate.eq3_master_bedroom_climateclimate.eq3_guest_toilet_climateclimate.eq3_office_climateclimate.eq3_kitchen_climateclimate.eq3_master_bathroom_climateclimate.eq3_walk_in_climate
This template listens for the following state changed events:
Domain: climate```
Yeah. Thats the problem I'm running into and my template is way more simple. Works with an entity card. It is weird that the error is telling me the entities to use...yaml type: custom:auto-entities card: type: thermostat filter: template: | {{ states.climate | map ( attribute = 'entity_id' ) | list }}
I'm getting my climate entities but it just isn't going into the card. I can't figure out how to have a grid there and then the cards like used in the include: section.
['climate.heatpump', 'climate.hvac', 'climate.ecobee']
i think your error is related to the thermostat card only being able to display one entity. So "entities" is not supported?
This outputs multiple thermostats:
type: custom:auto-entities
card:
type: grid
columns: 2
card_param: cards
filter:
include:
- entity_id: climate.eq3*
options:
type: thermostat
sort:
method: friendly_name
Yeah. But that doesn't incorporate your template.
So that needs adjusting to use templates
Yes, but it seems that the grid is required to create multiple thermostat cards. The thermostat card itself cannot do it
Agreed. But I couldn't figure out how to have a filter > include and template at the same time.
First step working
type: custom:auto-entities
card:
type: grid
columns: 2
card_param: cards
sort:
method: friendly_name
filter:
template: |-
{% set ns = namespace(list=[]) %}
{% for item in states.climate | selectattr('entity_id', 'search', 'eq3', ignorecase=True) %}
{% set ns.list = ns.list + [ item ] %}
{% endfor %}
{% for item in ns.list -%}
{{
{
"type": "thermostat",
"entity": item.entity_id
}
}},
{%- endfor %}
Now I need to create a second namespace for the names and pass along "name": names.entity_id or something like that. Not really good with namespaces etc 😦
Is this correct? I got rid of it because my entities don't start with eq3.
| selectattr('entity_id', 'search', 'eq3', ignorecase=True)
It works. Changed to ec and it found the Ecobee entitiy.
Got it!!!
type: custom:auto-entities
card:
type: grid
columns: 2
card_param: cards
sort:
method: friendly_name
filter:
template: |-
{% set ns = namespace(list=[]) %}
{% for item in states.climate | selectattr('entity_id', 'search', 'eq3', ignorecase=True) %}
{% set ns.list = ns.list + [ item ] %}
{% endfor %}
{% for item in ns.list -%}
{{
{
"type": "thermostat",
"entity": item.entity_id,
"name": area_name(item.entity_id)
}
}},
{%- endfor %}
And yes, you need to change the "eq3" because my TRVs are climate.eq3*
One thing that is cool about your last code, if the entity does not have an area, it shows the friendly_name.