Removed the top card just for testing and now had the remote @ the top. And problem is still there.
So seems to be something in the remote that causes it.
From all my testing all i can say it must be something that has not been toutch inside of it yett. Or its a bugg when you use - CUSTOM BUTTON - In vertical / horizontal stack - ENTETIES - with a Inputselect - Custome buttons again. - In vertical / horizontal stack
Thanks, changed it but no change. However i noticed if i put spin: true in the template hk_switch under the on state it works however that now animates my other switches.
If i only want this one switch to animate how would i do that? I read the merge by ID but i dont fully understand it.
if your other switches use the same template then why are you surprised?
try to compare what makes your non-working switch different from others.
I can confirm that I was able to configure my switch individually using config I posted earlier.
@RomRider I seem to have maybe found another issue. Iāve done away with the concept of a button-card as my parent card, with a vertical-stack in a custom_field. I now just use a mod-card as the parent (to style the vertical-stack) and now all the button-cards are at the same level within horizontal-stacks. I have a label button that doesnāt really do anything as a button, but is just a label. It works great if I define the whole button in the card config. But as soon as I copy the config over as a config template for a starting point, the card does not display anything except the outline of the button much shorter then it should be (due to no text or icon). Thereās no error output to the console, but it just doesnāt display anything. Doesnāt seem to respond to the styles defined either.
Thereās no javascripting going on for the label_button2 template. Just a complete copy and paste from the card config to the config template. One works (card config), the other doesnāt.
Iāll try moving it to the config template piece by piece and see if I can identify a particular section thatās tripping it up.
@RomRider
Some more info on my post above. I started moving a few lines at a time from the card config to the config template.
As soon as I moved the icon and name fields to the config template, they disappeared from the button, but the button was still the proper color and height.
When I moved the styles over, then the button goes back to the default colors and what looks like min-height. So for some reason itās not picking up the values in the template. My other 3 config templates are working fine and as expected. The example I put above has the power button next to the label card and the power button works as expected. A real head scratcher.
You have a - at the beginning of your template label_button2 it is supposed to be an object, not an array. Probably a copy paste error while moving your config over to the template
Create a template that hasnāt any state, call it master for eg with all your styles etcā¦ then create another template based on the master template for your switches and another for the fan with the state object you want. You can make templates out of other templates.
I knew it was going to be something stupid like that. I didnāt see it in my current code, but I had moved the config back to the card config. I moved it back to the config template again and itās working.
One other question. If Iām going to have a config template use another config template and they both declare variables, do the variables get merged? Better with an example:
button_card_templates:
template1:
variables:
var_foo: foo
var_bar: bar
styles:
icon:
- color: red
template2:
template: template1
variables:
var_foobar: foobar
styles:
card:
- background-color: black
In this case would variables end up with 3 entries if you are using template2?
Yes, and if you redefine one that already exists, itās going to override its parent, like it does for all the fields in the whole config (objects are merged, arrays are concatenated appart from state if you use the id field, in this case itās merged also)
Speaking about templates - thanks for the new beta, Iāve just tested it and it works fine in simple cases.
However, I just want to clarify that this case should work the way it works:
It seems like you evaluate templates when they are used to create another template/card and that means in button template inclusion of variable_new_colors template wonāt have any effect as button_base is already evaluated using color_state_icon from variable_colors and therefore icons will always be black, is that correct?
No, in this case, the icon color should be green. javascript templates are only evaluated when they are used not when the config is merged together at the beginning.
The resulting config would be (no evaluation while setting the config):
Setting the config means assigning the config to the button, this happens when you update the button config. Then what I do is I merge all the templates together and āreplaceā your config with the resulting merged config.
This is not related directly to button-card, but maybe someone here has run into this and knows how to get around it. If I have a javascript template like this:
Sorry, thatās just in my post. I didnāt have the key in there originally and I misplaced it when I added it here. Hereās the whole thing pasted in as-is: