You were almost there
This:
if (states[group] && states[group].state === 'on') count += 1;
Needs to be modified into:
if (states[entity] && states[entity].state === 'on') count += 1;
Edit: typo
You were almost there
This:
if (states[group] && states[group].state === 'on') count += 1;
Needs to be modified into:
if (states[entity] && states[entity].state === 'on') count += 1;
Edit: typo
thanks!
what I feared using āentityā was whether that references the entity in the main config of the button? It shouldnāt.
This template should be an unrelated template completely (in this case the main entity is an automation ā¦)
Right, itās not the best variable name that I used, but that shouldnāt be a problem. The entity
in the forEach
relates to each element of the array, you can rename it to something else.
my_array.forEach(this_is_one_element => {
do_something_with(this_is_one_element);
})
Iāll use my brain more next time before typing
no worries
hoped this to be the case , but with these reserved terms, one never knows
what if the main button entity would have been the group, and I would have explicitly wanted to reference that here for its group members, how would that have changed the template? In that case we would have referenced āentityā , but how?
Same but itās
// this one is the one from the button
entity.attributes.entity_id.forEach(entity => {
// ^^ this is now an element of the array
thing_with_(entity);
});
thanks! noted in my cookbook.
nothing wrong with your brainā¦
ended up making my own variation with a separate template for fan
Nice. Is it just an indicator or does it increase the speed?
Itās 3 dashes for high, 2 for medium, and 1 for low.
Yeah I meant if you tap the speed Indicator does it increase?
no, everything is hold actions + a separate UI like @RomRider . I rarely change speed so itās buried in the hold action.
Having the same issue with a timer in a button card which is in a horizontal stack.
Thanks for adding a fix! Iāll be watching for the next release
Many thanks for this great and oh-so-useful card - your hard work is much appreciated!
Anyone know if it is possible to set the state-badge of an entity as the icon in a button-card?
The state-badge for a roku media player entity is a graphic of the active roku input. Looking to have the icon of a button card for a roku media player set as the state-badge.
thanks in advance
Awesome cards!
Can you share the template for the light wheel and slider popup?
With show_entity_picture: true
?
If you try the beta, it is already fixed
Yes please. Can it also be placed vertically?
Something with this GitHub - thomasloven/lovelace-more-info-card: š¹ Display the more-info dialog of any entity as a lovelace card ?
But how integrate this GitHub - DBuit/light-popup-card: Lovelace card to use as custom pop-up for light in homekit style ?
how can i ātemplateā a template? want to make a custom:button-card
that shows a label from an other entity. since i use a template iĀ“d like to add the label:
into the template.
iĀ“m talking about something like this:
template:
door:
label: >
[[[
return states['{{ ["battery"] }}'].state + "%";
]]]
custom:button-card
- type: custom:button-card
template: door
entity: binary_sensor.gang
name: TEST
battery: sensor.openclose_11_battery_level
so in battery:
in the custom:button-card
i just put the entity in to show the state of it on label of the button-card.
is this even possible?
door:
label: >
[[[
return states['sensor.openclose_11_battery_level'].state + "%";
]]]
- type: custom:button-card
template: door
entity: binary_sensor.gang
name: TEST
if you want to update it for different sensorsā¦ use the variables
door:
label: >
[[[
return states[variables.battery].state + "%";
]]]
- type: custom:button-card
template: door
entity: binary_sensor.gang
name: TEST
variables:
battery: sensor.openclose_11_battery_level
works, thanks!