Hi, i’m trying to make my code as simple as posible and want to create a template for a custom button card… Is there a way to refer to an entity other than by name? is the entity name available to use as a variable or something generic like “entity_name” or something like that.
I suppose you are being ironic and you notice that the message you repost is mine…that code do not work in my new dashboard that’s the reason I’m asking. I already search before asking. Sorry for asking and bother you….
No im not being ironic, i sincerely think people should use the search function, After they read the documentation, so the Forum dont get drowned for every little thoughts people have on their mind, and find it “easier” to just open a topic
And I Assume you are aware that you are dividing the brightness level output-number with 255 !
Not with your specific code or your entities obviously , But as Pieter clearly showed , i gave you a working example, However i removed the / 255 ( Shouldn’t make a difference) but i found the “result” awful meaningless
Please mark Pieter’s answer as solution, as you(and others) there will find another example of showing brightness , and its a good start to get familiar with the documentation, as it can help to understand the examples your can find afterwords in this forum.
There is a huge Topic(several) specific for this Card, where you can find lots of tips N solutions
Do not work with the opacity style, at least in my code. Your exemple on the label works but not in the opacity style, my full working code is the following. if i replace the opacity part with:
Your question is basically answered, and “as simple as possible” is how your working solution already is.
There are examples in the code, where a reference to “main entity” don’t work, i think it’s mentioned somewhere, in either the Docs, or in 1 of the major topics for Custom:Button-card