Entity Button Card - Show state

In the documentation, it looks like the state is displayed for the entity on the button (colored icon):

I am using the button card on an input_boolean sensor. And when using the button card, the card does not show the state (on or off). I can’t find a parameter for this functionality in the documentation, but the picture used in the documentation displays the status of the light (on/off).

What am I missing?

Take a look at this custom card: https://github.com/kuuji/button-card, this works great with input booleans and provides even further customization options.

I am holding back on the custom cards for now. I believe HA will be updated with a "Card Store", so waiting for that, so updates/fixes will be automatic.

In the meantime, the standard cards should have some basic functionality as the documentation shows. Hopefully this will be fixed.

Are you using a theme that has icon state colours?

Did not think about that. But do I have to use Custom UI for that?

No it is part of the frontend configuration.

The default theme (i.e. you haven’t changed the theme) has state based icon colours. I have seen some themes that don’t have this though. Which is why I asked.

Yeah… You need the custom-button card. They decided to only support the colour change for states for things like lights and switches (because they consider yellow to mean power)

It’s a PITA. You don’t need custom config - use the custom-button card.https://github.com/kuuji/button-card

Here is my config (Lovelace Card) I am using 2 of the regular cards but the input_boolean is a custom button.

          - type: horizontal-stack
            cards:
              - type: entity-button
                entity: switch.sonoff51083
                tap_action:
                  action: call-service
                  service: switch.turn_on
                  service_data: 
                    entity_id: switch.sonoff51083
              - type: entity-button
                entity: switch.sonoff63719
                tap_action:
                  action: call-service
                  service: switch.turn_on
                  service_data:
                    entity_id: switch.sonoff63719
              - type: custom:button-card
                entity: input_boolean.alarmgaragedoor
                icon: mdi:security
                color_type: icon
                color: rgb(251, 210, 41)
                color_off: rgb(54, 95, 140)
                name: Exit-Enter
                show_state: false
                action: service
                service: 
                  domain: input_boolean
                  action: toggle
                  data:
                    entity_id: input_boolean.alarmgaragedoor

image

2 Likes