I have a follow up question. I now want to have navigation overlays on my floorplan.
So I know how to create a light entity with toggle and position it.
I also saw in the documentation the navigation which is what I am trying to do.
The idea is you tap on a room and it navigates to a specific panel. I am thinking can it be done with transparent images of the specific rooms and how would it code?
But to try and use the floorplan and not buttons as they are at very different positions between devices.
This happens when you have images which cover each other.
Then only the topmost image may intercept mouse events.
Assume you have 3 images of same size overflowing each other.
Only the 3rd (topmost) will process mouse events.
Assume you defined âpointer-events: noneâ for the 3rd image - then the next image in z-order will be able to process events; but the 1st image will still be not.
Read these:
In a similar case (floorplan + many overlapping images of SAME size) - I had to add elements (icons) above all these images; and these elements process mouse events.
My question is i would like to do the real animation of the cover but i donât really know how to do it.
I did this try but it doesnât do an animation. I hope it is clear ^^
Anyone know how i get a black transparant horizontal box at the bottom of my card (containing elements) ?
Like wit hthe picture glance card (at the bottom) ?
Ildar_Gabdullin,
Is there a way to get the icon color of an entity which changes colors in function of its state? I need to get its current color value. I tried the variables you suggested without success. Iâm using custom-button-card. Many thanks
This thread is about using Picture elements card.
Are you using the button-card as a custom element?
Anyway, the button-card has its own effective mechanism for styling colors.
Post a SHORT example of what you wish to achieve.
Ildar,
Iâm using a template and for some entities I want to control the icon color in function of the entity and/or state, but for some others I want to display their original color, which happens to change in function of the state. The problem is that if the icon color style is set for some entities, by filtering them using the entity_id, then for those entities that I want to display their original color, the color turns white. Thus, the only way to show the original color is not to change the color style at all? Sounds strange. So I need a workaround and this is why I was thinking to catch the original colorâŠ
The following is the code Iâm using to set the color style:
styles:
icon:
- color: |
[[[
var type = entity.entity_id.split(".")[0];
if (type == "switch") {
return states[entity.entity_id].state == 'on' ? 'rgb(0,100,255)' : 'Silver';
} else if (variables.var_select_option_value) {
if (states[entity.entity_id].state == variables.var_select_option_value) {
return "rgb(0,100,255)";
} else {
return "Silver";
}
}
//if the entity is not a switch or a select entity the original color should be used, but it's not !
]]]
I would be happy to help. But this is not related to Picture elements card. So it is not supposed to be discussed here.
Please ask this question in a proper thread:
Now I am rather far from any PC and cannot test your code. In a week - if your question still is not answered in that button-card thread - I will be able to test it.
Hi,
I would like to change the icon and the color of some icons on my picture-elements card depending on the state of the entry.
I understand that I have to use card-mod for that , which I did, similar to the examples. Iâm also using the ââpaper-item-icon-colorâ style element as I see from the examples.
However this does not work. The icon color does not change. The icon itself even is not shown anymore if I set that with a variable that was set via the card-mod template.
If I set the icon color or name manually instead of using the variable it works fine, so it seems as if the conditional part in the {% if xxx %| section is not evaluated.
So now the icons change the color properly, great!
Now we are at it, I also would like to change the icon itself based on the state.
But if I change the code for the sensor.tesla_state entry to the below, the icon is no longer visible.
(if I donât use the variable but set the icon to a fixed value it works fine).