#I have made But unfortunately it doesn t
1 messages · Page 1 of 1 (latest)
It looks like the template requires an entity. Looking at the template, the first thing it tries to set it the label, based on the entity.
So, what I would suggest, is take the entire template code, copy and paste it into the card that you're working on (removing the templates: section). Then start ripping out anything that deals with entities.
So, change yaml - background-color: >- [[[ if (variables.ulm_custom_card_esh_room_light_entity) { var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color; if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") { if (color && variables.ulm_card_dynamic_color) { return 'rgba(' + color + ', 0.2)'; } return 'rgba(var(--color-background-yellow), 0.2)'; } } return 'var(--ha-card-background, var(--card-background-color, white))'; ]]]to ```yaml
- background-color: white```
I have now deleted the custom_fields area. Now the card looks like this. But the icon is moved.
I'm confused. That code doesn't match what you posted originally.
This is the template code that I edited. The original code can be found here: https://github.com/UI-Lovelace-Minimalist/UI/tree/main/custom_cards/custom_card_esh_room
But, if you mess with the template, you mess with everything that is using that template and is showing correctly.
Also, the screenshot of code does not match the card's code. There is no toggle custom field in the custom_card_esh_room's code; there's light and climate. I was already looking at the template's code at https://ui-lovelace-minimalist.github.io/UI/usage/custom_cards/custom_card_esh_room/#template-code
I created a new template called custom_card_esh_room_blank. I then copied the code from the original (custom_card_esh_room) and deleted everything from custom_fields: because I don't want a button, i.e. cutom_field.
I then used the new template in my dashboard as follows.
That should make some progress but there's a bunch of stuff in the styles: section that needs to be modified. That all looks like it has some default settings that should be okay. (In fact, if the entities are null, it is set to not display the custom field(s).) The next thing I would take a look at is the label.