I am creating a dashboard that includes smart Meross power strips in my home. Although specific sockets currently are connected to specific electrical devices, these can often be changed around. Therefore I am trying not to put the name of the electrical item in the entity name for each socket.
Currently, I am using the label tag to hold the device name against the entity. This has led me to wonder whether I can access this label in a card that toggles these switches. As of yet, I simply have a text under the icon that is a Switch 1 to 6 text. It would be better if I could replace this with the label associated.
Currently:
In this image, Switch 4 on the first card relates to the “Living room left plugs 1 Outlet 4” entity. As can be seen below, this has the label Hildebrand Glo
So the basic jinja works. However, all my attempts to get this to even be accepted in Custom:button-card using card-mod, has failed to even be saved in the card ui.
This is my latest attempt that will not even be accepted as correctly formatted style:
There are a few things I think may be an issue but not really sure.
config.entity - is this just the entity id in text format or the whole entity including attributes? All I want is the text.
macros - I have seen suggestions that macros can be used in card-mod but no actual examples. Should it be the same format as my template testing above or does it need to change?
As “label” is in custom:button-card, I assumed this was an ha-card attribute that could be changed. Am I wrong? In which case, is there some other attribute I can use for the text under icon?