I have a problem formatting my mushroom-template-card…
I asked DeepSeek the following:
In home assistant create a mushroom-template-card with a button with a solid yellow icon border color, 5px wide, that toggles between script1 and script2, sets the icon color to yellow when script1 is active and red when script2 is active. Script1 turns lamp1 and lamp2 on att 100% with a warm white color, and lamp3 and4 at 50% also with a warm white color. Script2 turns all 4 lamps off.
Yeah, I know that AI isn’t very reliable when producing working code, but i wanted to get an “embryo” so I can get some help producing a working example…
I have read the documentation several times and tried a lot of different examples that i could not get to work, that is why i gave up and tried getting something that works by using AI, but as this did not work either, i was hoping to get some guidelines from the community. I am very sorry if i have upset you by being a novice and posting something that is not at a professional level…
I’m not pissed off because you are a novice I’m pissed off because everyone expects us to correct the garbage spewed out by LLMs without putting in any actual work themselves.
If you tried first, that’s great. Even if it did not work. Show us what you tried.
Yes I tried using this guide, and my initial problem was getting a colored card border and a colored icon border depending on the returned state of a temperature/humidity sensor. This resulted in a colured card border OR a colored Icon, depending on how i wrote the code, but not both borders at the same time. Then my plan was to turn on/off lights and get a change of icon color depending of the returned lamp state, and set lamp brightness/color temp by using scripts, and the scripts work, but as i could not get the color problem ok, i got to the point where i gave up, and tried to use the community by posting the code i got from AI, (which was a huge mistake, I agree…)…
This is the basic version of my problem where I tested border colors, icon colors and icon border colors, in the mushroom template card, where everything except the icon background color and the icon border color seems to work, (see enclosed picture)
I read the important note section in the above mentioned card mod section and i guess this has to do with the order the elements are drawn, (so maybe the card color overwrites the icon background and border color ??), but how can i modify the code so all elements are visible ??
Perfect… Thank you !!!
I have spent MANY hours testing this, and thanks to you (and the community), the problem was solved in minutes…
Now i can continue and do some more experiments with my “script-code” that started this thread and get my colored icons depending on returned state/value of my lights and
temperature sensors. (without posting any more AI code )
Post your Mushroom card questions here going forward
We are here to help and to be clear AI is a point of contention. It continues to leading folks down the wrong path with incorrect code. As an example, I was easily able to discern that your code was AI produced.
HA is very unique and is in a constant state of improvement. I guaranteed if you ask in this forum you will get the right answer faster than hours with AI.