Hi @thomasloven my setup is getting a lot better because of lovelace_gen. However I once again have to ask you a question as not many people document it and I canât seem to find a solution with the examples given in the docs.
I use your browser-mod to show popups and this works absolutely fine if I template it. In my current configuration I use the âsecondâ !include like in your documentation. However thanks to your latest answer (in the auto-entities thread) I found a way to create those auto generated cards. I have one problem which I face and I though that lovelace_gen could be able to handle this problem.
So here is the auto entities config and the button template created with your cards
- type: custom:auto-entities
filter:
include:
- domain: light
group: group.alle_lights
options:
!include
- templates/button.yaml
- entity: this.entity_id
exclude:
- state: unavailable
sort:
method: name
ignore_case: true
card:
type: custom:layout-card
min_columns: 3
max_columns: 3
# lovelace_gen
# card
type: custom:button-card
name: {{ name }}
deep_press: {{ deep_press|default('true') }}
icon: {{ icon }}
color: {{ color|default('auto') }}
size: {{ size|default('25%') }}
lock:
enabled: {{ lock|default('false') }}
unlock: {{ lock_unlock|default('tap') }}
duration: {{ lock_duration|default('5') }}
aspect_ratio: {{ aspect_ratio|default('1/1') }}
entity: {{ entity }}
label: {{ label|default('" "') }}
show_name: {{ show_name|default('true') }}
show_icon: {{ show_icon|default('true') }}
show_state: {{ show_state|default('true') }}
show_label: {{ show_label|default('true') }}
tap_action:
action: toggle
haptic: light
hold_action:
action: call-service
service: browser_mod.popup
service_data:
title: ' '
style:
background: rgba(0, 0, 0, 0.4)
"--iron-icon-fill-color": "#FFF"
card:
type: horizontal-stack
cards:
- !include
- {{ template|default('rgb_popup.yaml') }}
- entity: {{ entity }}
haptic: heavy
What Iâd like to achieve is the following at the bottom of the button template (where {{ template|default('rgb_popup.yaml') }}
is)
{% if is_state('input_boolean.dummy1', 'on') %}
rbg_popup.yaml
{% else %}
switch_popup.yaml
{% endif %}
But whenever I do something like this it will say âis_stateâ is undefined or None is undefined. I am a real noob concerning this but I am trying. What I actually want to achieve is the following: if entity has rgb attributes then rgb_popup.yaml. If it has min_mireds attributes then color_temp_popup.yaml else switch_popup.yaml. (these are three popups I created to be used with switches and lights). They work fine when a default template is set, but only that specific popup will work then.
- !include
- templates/button.yaml
- entity: !secret light_1
label: '!include ../../includes/brightness-label.yaml'
grid:
'!include ../../includes/light-devices-grid.yaml'
template: color_temp_popup.yaml
name: Plafond
The above code works fine on all pages. However I want to be able to use the auto entities with layout card like you suggested. (which works absolutely amazing btw) But I only miss this single feature where the popup card will also be changed depending on the attributes (true/false) of the specific entity.
It might be exotic what I am asking for, sorry for the noob questions.