Thatâs a bug, please open a github issue. Thanks
I canât change that, thatâs how it works in HA core, you have to put an equal number of blank cards or use lovelace-layout-card, or maybe use a vertical-stack-in-card with 4 buttons inside
Can you force the icon using icon: mdi:your_icon please? If it displays by forcing the icon, it means your entity doesnât have an icon (or the button canât find it)
I have a group of buttons, that I like to behave like a radio-button-list. If I press one button, the others go âoffâ. When I press another button âonâ in the group, the other goes âoffâ. I have the above functionality working with an automation.
But if I press the button that is âonâ to âoffâ my radio-button-functionality breaks, - the pressed button goes âoffâ. And all other buttons are âoffâ.
I have a second automation setting the Home-button to âonâ in this case, but its not perfect. The best would be that the buttons only could be set to âonâ (other functionality/automation could then set the buttons to âoffâ).
Is it possible to configure a button to only be set to âonâ in the GUI?
UPDATE:
#######################################################################
# HA MODE SET
#######################################################################
- alias: HA Mode set
initial_state: true
trigger:
platform: state
entity_id: input_boolean.ha_mode_home,
input_boolean.ha_mode_away,
input_boolean.ha_mode_holiday,
input_boolean.ha_mode_night
to: 'on'
action:
- service: input_boolean.turn_off
data_template:
entity_id: >
{% set booleans = [ 'input_boolean.ha_mode_home', 'input_boolean.ha_mode_away', 'input_boolean.ha_mode_holiday', 'input_boolean.ha_mode_night' ] | reject('equalto', trigger.entity_id) %}
{{ booleans | list | join(', ') }}
- alias: HA Mode default
initial_state: true
trigger:
platform: template
value_template: "{% if is_state('input_boolean.ha_mode_home', 'off') and is_state('input_boolean.ha_mode_away', 'off') and is_state('input_boolean.ha_mode_holiday', 'off') and is_state('input_boolean.ha_mode_night', 'off')%}true{% endif %}"
action:
- service: input_boolean.turn_on
data_template:
entity_id: input_boolean.ha_mode_home
Use a script on top of your automation and call that script from the button.
The script would test if the button is on, and do nothing if on, else if would turn it off and your automation would kick in.
wonât that disrupt the aspect_ratio of the other cards then? I can of course set a fixed size for all the buttons, but recently rebuilt all to use aspect_ratio, without which this button setup is less than optimal across different platforms.
Please consider the âgridâ request as a future update? marking a button to take spot 2to5 from the row (in this case) would be way preferable to using yet more custom cards.
Also, the text should be displayed in the middle of the buttonâŠ
Like the test button above it now does.
it does have an icon for sure:
and again, see my other (Tiles) setup to be proof of that:
or the unformatted button:
thatâs what I am looking for: icon_name_state or icon_name (and use the template for name)
I think it has to do with the size. I had left that out in the card, seems to have minimized to less than a pixel⊠though of course plenty of space.
Ive added size: 70% and this shows:
that is using aspect_ratio of 4/1 for the button. Which is still 3 times to high (need 12/1), so lowering that to 8/1 and increasing the icon size to 90%:
and there it goes!
12/1 and it is invisible (no matter why size is set, even tried 120% )
UPDATE:
This works, but its maybe better to stop the button process at all (instead of running the button âonâ logic once more). But I have no clue how to do the button script logic to stop the button. Help please.
- alias: HA Mode default
initial_state: true
trigger:
platform: template
value_template: "{% if is_state('input_boolean.ha_mode_home', 'off') and is_state('input_boolean.ha_mode_away', 'off') and is_state('input_boolean.ha_mode_holiday', 'off') and is_state('input_boolean.ha_mode_night', 'off')%}true{% endif %}"
action:
- service: input_boolean.turn_on
data_template:
entity_id: "{{ trigger.entity_id }}"
As I said, I canât thatâs how HA core works with cards and button-card is a card (tiles, is 1 card whatever the number of button inside is). I would have to build another card to achieve that purpose.
In the meantime, you can use label_template instead of name_template.
Iâll have a look, but I donât have time until next week
No it souldnât, because the icon âcolumnâ occupies 40% of the width of the button.
I know people have asked for this so I finally got my configuration up on github. I donât remember who was asking exactly aside from a few users. @apop@myle. Itâs a work in progress, still managing many changes that I want to add. Also having issues displaying the images on the in the README.md
thanks, seems rather more complex than you describe it will test soon.
in the meantime please help me getting the icon and label to concatenate more. I am a bit lost what grid to set for thatâŠmanaged to get it all on 1 line using a label_template, (which of course is a bit of a hack, but no other way because in the button card settings label and state or name and label wonât ever be concatenated:
its not really that complex. Itâs like 8 shadows on top of eachother. Thatâs what you can do with the color & shadow css attributes. You can add as many as you want and in the order that you want.
Sorry. Trying to get the icon to show just left outside the middle and the label start just right outside the middle of the button, so they appear to be next to each otherâŠ
which isnât right yet, but close to what you suggest;-)
Note that I:
had to change from name_template to label_template to get the template to work, something is not right in the name_template
got the icon to show up, by changing the order, and probably most importantly, the font-size⊠Donât know how yet, changed so many options, but this is how it finally showed.
as you can see the top button needs some finetuning to get it centered nicely. Will use your suggestion for that first!
Is it possible to pipe the Home Assistant Area value of an entity into the label field? I havenât actually configured areas but realized this would be a great way to add context to our custom Homekit-Like buttons.
This data is not available in the hass object exposed passed to the cards as far as I know, so for now itâs not possible and it doesnât seem obvious to retrieve that info (From what Iâve checked it would involve retrieving stuff from the websocket directly). If you open a feature request, I might look into it.
No worries. Itâs such a minor feature that itâs probably not worth investing the time if HA core doesnât make the data easily available. Thanks for looking into it.