Lovelace: Entity-Button card questions

Hi everyone, I have started to use Home Assistant a few months ago and I love it. Still pretty noob at some things (as I had no knowledge of YAML before). However after some months I got myself a nice setup (at least I think so for a noob :stuck_out_tongue:). I have started to work on lovelace a few weeks ago and it is great. However I stumbled upon a problem with the entity-button card.

Question 1
I have rows of four (see screens below) and the buttons look nice but I need to have four buttons each row or else the buttons become massive as they stretch to fit the card. Is it possible to have an empty button? Or is this only possible with the custom card which is available as well? At the moment I use a very small icon with invisible text to make the button appear like in the screenshot. I configured the button to take no action when pressed and when held.

Question 2
I have some media players in an entity-button card, just because this will turn the devices on or off. However if I use a media-player as entity-button then there is no state change on the cards (see screens below). In the screenshot my xbox and my samsung TV are both turned off, however in reality they are turned on (and the state is turned to ‘on’ in home assistant as well. This only applies to media-players as an entity-button. Is there any way to manually add a state color to an entity-button regardless of what the actual state is? For example: I used OpenHAB in the past, where it was possible to assign a state from a different device to a button (e.g. I could use any pingable IP to set the state of an empty button). Would this be possible here as well? Or is is possible to just have the color change?

I too want to know how (if its even possible) to have the colour of an entity-button change based on the state of the entity. ie: I have created an entity-button for an input_boolean and the state changes when clicked but the button colour remains the same. Pretty poor if that’s the default functionality. We shouldn’t have to muck around with custom settings etc for something so simple. Hoping it’s just something I’ve missed


you can have an empty button by using a non-existant entity icon such as icon: mdi:blank

My switches do that and I presume lights would as well but input_booleans don’t. I might have a play at forcing that


It’s the same on Glance cards, switches and lights will change icon colour but not input_booleans. It’s frustrating because it restricts being able to use them in a nice clean manner. I am currently forced to enable show_state: true for these so that I get state text, but I really don’t want text in my Glance cards

1 Like

I wonder if it’s just an oversight?

I might log an issue

https://github.com/home-assistant/home-assistant-polymer/issues/2461

1 Like

I have already tried that, but using that would make the button half sized. This doesn’t look nice and I still need to assign an entity to the button. Otherwise it won’t even work at all.

I have found my solution in using a custom card known as: “button-card”. This card allows me to do all that I want like setting it to color the entire button instead of just the icon and put in custom state colors. For example you could give a color to your buttons depending on the state the entity is in. E.g. you could make your media player button change color depending on whether it was playing, paused or turned off.

It looks quite nice and the empty button cards are really empty (no entity or icon required). Only thing is, you can’t set up a hold action which is too bad. Also to that I have made my solution with a mix of entity buttons (so I can still use the hold button function) and entity buttons for my mediaplayers and blank spaces. Obviously this mix won’t work well if you color the buttons as you can’t color entity-button. See screenshots below.

As you can see my devices are colored now. My xbox for example has the state “unknown” whenever it is just idle, so home assistant won’t see this as turned on. With this custom card I have set up a green color for my xbox whenever it is in an “unknown” or “on” state.

I hope they will do something like this custom button with the official entity-button one so I could use the “color button” and “hold button” at the same time, which unfortunately isn’t present at the moment.

For the ones interested, here’s the link to the custom card.

Watch out. Button card has been acting up since 0.85 for me. It works great for a long time, then for no reason it will disappear and error out. Nothing I change will make it work right. I hadn’t touched Lovelace and it stopped working for me yesterday. It isn’t my browser, not only did I clear my cache for my domain multiple times, but I also tried the HA iOS app, and Chrome in addition to Safari. It also did this the first time I tried updating to 0.85.1, and somehow going back to 0.85.0 magically fixed it. Well, yesterday, I hadn’t updated HA or anything. Just restarted many times while testing code like usual.

Did you try the fix that I have posted above?