I was just coming back here to say that I think it is because I am using a template for the entity. Frankly, I guess it does not make sense to use a variable for entity or name.
Seems that using a templates causes some problems with state colors overall. When I navigate away from the tab the come back, the card color is gone until I click on the button again. Going to keep playing around with it
Iāve stood up a brand new Docker container running āhomeassistant/home-assistant:0.115.6ā on a different computer (Docker Desktop for Mac). I installed HACS and added the button-card (3.3.6). Enabled YAML mode and created a new ui-lovelace.yaml file. Set up two dummy input_booleans and copied over the same button card code.
But, the OR method still doesnāt workā¦
I donāt think Iām doing anything wrong with my config because itās a fresh Home Assistant with only two dummy entities?
Iāve tried different browsers on MacOS and Windows.
also did you add the variables dashboard and view in the button-card itself, as in my example? (btw, if you donāt use dashboards, you can leave out that bit, makes it just a bit simpler.)
and, of course, if you use that code, you need the color variables too in your current theme.
yep, heavy user here, slightly responsible for the options available by keeping bugging Romrider about adding templatesā¦
couldnāt live without them
It exactly does what it says: if any of your dummy input boolean are off, it will be green, so for it to become red, both of them should be on. Iām not sure I understand what you are trying to achieve
Am I correct that this only works when Lovelace has been switched to YAML mode?
I am using the Lovelace UI editor. To access the full config I open raw config editor from the UI. But all my trials to !include in this editor throw a parser error at me when I try to save:
YAML kann nicht geparsed werden: YAMLException: unknown tag !<!include> at line 1, column 42: ... rd_templates: !include file.yaml ^
You cannot use !include in UI editor mode, but you might be able to put the template in the top of your raw config. I am doing that now with mixed success and am hoping that someone can comment on if this is fully supported.
My template at the top of my config as shown here makes a card appear and makes the popup appear, but the title is showing as '[[[ return entity.attributes.friendly_name ]]]' instead of the friendly name, and not quite working right. Itās like the template itself works, but templates within it do not.
It is supported in the RAW config editor exactly like you do it.
Your configuration looks okay so it should work like this. Are you using the latest version of button-card? Please check the javascript console to verify your version.
Edit: Iām seeing the same behavior on the android app. I also tried hard coding the entity in the popup template, and that worked, just to make sure that my card template could properly launch a popup with a slider.
Iāve tried multi-line to no avail
(Also, my > turn into | for some reason, but RobC on the discord kindly verified for me that they are treated the same in his button card template.)
I figure it would be possible to optimize this in JS? this is some sort of nested ternary operator, developed from an earlier one, hence the somewhat forced construction