Hi all
Is it possible to evaluate an attribute of an entity instead of the state, like this
state:
- position: 40
color: rgb(255, 0, 0)
Thanks
Hi all
Is it possible to evaluate an attribute of an entity instead of the state, like this
state:
- position: 40
color: rgb(255, 0, 0)
Thanks
I wish this button had a hold action still kinda surprised almost no one asks for this feature
The core button works fine though, though I canât color the buttons.
cards:
- color: â#f8f8f8â
color_type: labelcard
name: Office Lamp
style:
- border: â1px solid #cccâ
- box-shadow: 0px
type: âcustom:button-cardâ
cards:
- color: ârgb(66, 134, 244)â
color_type: icon
entity: light.office_lamp
icon: âmdi:lampâ
show_state: true
state:
- color: â#fdbc22â
value: âonâ
type: âcustom:button-cardâ
- color: â#fffâ
color_type: card
entity: script.dimoffice10
icon: âmdi:signal-cellular-1â
name: dim 10%
state:
- color: â#f5f5f5â
value: âoffâ
type: âcustom:button-cardâ
- color: ârgb(213, 0, 96)â
color_type: card
entity: script.dimoffice50
icon: âmdi:signal-cellular-2â
name: dim 50%
state:
- color: â#f5f5f5â
value: âoffâ
type: âcustom:button-cardâ
- color: ârgb(66, 134, 244)â
color_type: card
entity: script.dimoffice100
icon: âmdi:signal-cellular-3â
name: dim 100%
state:
- color: â#f5f5f5â
value: âoffâ
type: âcustom:button-cardâ
action: more_info
color: â#fdbc22â
color_type: icon
entity: light.office_lamp
icon: âmdi:selection-ellipseâ
name: Custom %
type: âcustom:button-cardâ
type: horizontal-stack
type: vertical-stack
can you share the config for the link button, that would be awesomeâŚ
Can I have a custom background colour for the card dependent on state and a custom icon at the same time?
So white background and icon A for off, then blue background and icon B for on. From my experimentation it seems you can only do one or the other, is this correct?
Iâve been wanting this for a while as well. I have looked through the code to try and add on hold, but since itâs not using HTML elements I canât figure out how to add it to the current set up. Iâll mess around with it a bit more this weekend.
I think our time is better spent trying to improve entity-button. Feel free to contribute to core. Should get show/hide icon/name soon
Indeed I think this is better as well, for that reason I have reverted back to the core button as I need the hold action. It would be better if some of this cards features come to core like button color for example.
Pretty happy with the core button now, as the hold action finally works as it should on my iphone whereas it wouldnât before (and thus the reason why I started using this custom card). Still some features would be nice like the empty button for example.
Sounds like a better idea indeed. For some reason the show/hide options are on the docs, but donât seem to be working yet
Also I managed to get pretty similar results using entity-button, the one thing Iâm mainly missing is the card background coloring instead of just the icon coloring.
Those shouldnât have been merged, I put them against next with a linked PR, but the frontend PR has not been merged
Will be in 0.91
Is that going to include changing the icon colour according to the state (like currently for switches & lights)?
My PR? No. Itâs for show/hide of name/icon
Are you still planning on moving those other features over to core entity-button?
My point was that people not be trying to hack this card to work for them, they are better off contributing to core. I do have any concrete plans on what features will be brought over.
Docâs got updated a little too soon. Was wondering why that didnât work when I tried it Wednesday. EDIT: Referring to show/hide icon/text.
I would also look forward to having some of the options with this card be brought to the Lovelace default one. Unfortunately, the default one lacks any real uses for me if it doesnât include features such as icon/background changing on state, sizing etc. It would be also nice to have more advance features such as an entity to toggle and another to display the text. I get the feeling that for simplicity this will never make it into the core so I think there will always be a need for custom Lovelace components as Iâm sure quite a few on this thread agree.
The only reason I ever used this custom card was so I could change the icon colour when the state changes. The core card does this for lights and switches but nothing else⌠if the core card had that then Iâd use it.
I never said custom cards as a whole. I make custom cards all the time. But splitting the effort on a button doesnât make sense anymore.
I was also just referring to button-card. I think there is a place for having both. There are lots of uses for advanced features of a button card that doesnât seem to jive with the direction of the default cards in Lovelace. But if somehow these features could make it into the default card that would be ideal.