I have combined a button with a sensor to mute my AVR (Denon) and I will make the button smart.
Why doesn’t this work with the icon and the perform_action? If this works I’ll do the same for the AVR power button.
(I think only the action can be done with a script, and call a service. But does not seem like the shortest way.)
You cannot use jinja templates for a stock Button card.
Try using a custom:button-card (there is a dedicated main thread for this card where all discussions should take place), it accepts templates on JS.
How do I configure a button where the color is green if the devices is off and the action is to turn it on. And the color is red when the devices is on and the action is turn off.
If you choose a custom button-card - suggest to check corr. Docs & ask in the main button-card thread (link was provided above).
If you choose a stock button card - to change an icon’s color you can use card-mod (suggest to ask in the main card-mod thread).
I have tried to understand that (a lot off pages). I can coded in bash, ptyhon, php, html, javascript, C++, but this is not clear to me
It’s not towards you, I’m glad you put time into it…
I don’t have ui-lovelace-card.yaml, ui-lovelace.yaml, or a www folder, and HACS is not installed.
I recommend installing HACS.
Then you will not need to register resources manually.
HACS does at least 2 things:
downloads a custom plugin & then stores it in “www/community/PLUGIN_NAME” folder;
adds a corresponding line to “resources”.
The “www” folder may be created manually inside the main “/config” directory (same directory where a “configuration.yaml” file is stored).
The folder is usually used to keep custom plugins (like custom cards), images etc.
The “ui-lovelace.yaml” is only needed if you use a yaml-mode dashboard.
Since you are a beginner - suggest you to start using a default “storage-mode” dashboard (where you can use UI to edit cards).
This thread goes beyond the initial question. Suggest to search in HACS-related threads. (people may not even react since the thread’s title is not related to HACS)
Just a guess:
HACS needs info from github like “when a plugin XYZ was updated” to inform a user (btw, this is one of reasons why users use HACS).
To get this info from guthub, an application (here - HACS) needs some kind of “authorization”. And you authorize your particular application to get this info. For this you need your own github account.
(still) next error: Custom element not found: button-card
I have add button-card.js also in Resources, but I don’t know the exact path.
button-card.js is stored in the same folder where configuration.yaml is stored and in the subfolder www (a copy)