only been playing with this card today but and its great but is there a way to fix the column sizes for example.
Im trying to get all the info in for the teams I follow and Ive tried various ways but it all does NOT fit.
If it fits on my laptop, it doesnt fit on the android app.
I would like the fixture, date and if possible how many days but I know the space is limited
I have a value 5900 that I want to show as 5.900. I can use the format: kilo, which gives me 5.9, or format: precision3, which gives me 5,900.000. But I can’t seem to combine kilo with precision.
How to solve this?
I would like to use that code to make the low battery icon appear only when the battery is low. In the image below you can see how it looks now but it is static… I am trying to figure out how to hide it when the battery level is > 35%.
custom:multiple-entity-row has a hide_if function that works as desired if I just have the battery percentage show, but doesn’t work if I try to hide the icon.
I’am not sure, but it seems multiple entity row can’t read attributes if sensor is in unknown state.
For example I have sensor.mysensor with state = none( in HA it will be as unknown).
But mysensor have attributes and they are alive (in developer tools or in entiti card).
Is it bug or that’s how it should work?
I’ve spent hours on this and can’t figure it out… Hopefully I am closer (thanks to your input).
The if statement correctly resolves to none; in the template tester but it doesn’t work when I try to use it in this context. If I add card_mod: before styles, it still doesn’t work, and the icon turns blue rather than red as it is now so it makes things seemingly worse.
I have, but can’t find anything that applies. Also, I am trying to hide the icon that doesn’t have an entity associated to it, not the main entity icon so I wonder whether card-mod can handle that. Either way, I am about to give up
@Ildar_Gabdullin Thank you for your patience. I had seen that code but did not recognize it as what I needed. While I don’t know why, I found that I have to split the color and icon hiding code in two sections div.entity:nth-child(1) state-badge and div.entity:nth-child(2) state-badge otherwise the icon changes color but remains visible. I believe that started happening when I opted to make the battery xx% show when low as added info. Anyhow, the code below works as desired. Thank you again for all your help even though I found it cryptic due to my limited knowledge on this topic.
Probably we may have a bug non-optimal code here.
The battery state is “column #1”, the icon is “column #2”.
When the state > 35 → then the column#1 is hidden (hide_if) and the “column #2” becomes a “column #1”.
Then this code:
will work ONLY for the icon (state-badge) in the “column #1” - which ONLY happens when “>35”.
Then that “color: red” line is useless - the icon is not displayed.
And I guess that this code may be rewritten as:
@Ildar_Gabdullin Wow! I learned more from this latest post than hours searching for answers! Thank you so much, both examples you provided work perfectly!
I have yet to try the YAML anchors but I am excited to learn they exist as it simplifies updating and reusing this code! I appreciate all the time you took to help me out!
Edit: I implemented the anchors and it now I have one less edit to make when I reuse this code for all my battery sensors. I’ll read up on them to see if there are other uses!
Anchors should be used in yaml mode (not storage mode) mainly - the HA editor may replace anchors with the code.
Consider using a decluttering card if many similar rows for different batteries are required.
P.S. In your example “35” is a fixed hardcoded value.
If you need to use some input_number for it (which is supposed to be displayed on some “Settings” page) - then card-mod or config-template-card are your choices.
As you point out in #1 I noticed that once I save, the anchors are indeed replaced. I will save the code in a text file for easy reference.
I’ve seen the decluttering card, but have not attempted using it yet. I was afraid I might end up complicating the code (yes by simplifying it…) so much I break it and don’t know how to go back.
The idea of decluttering card is the same as for a “procedure” in a high-level programming language - “one code is used in many places”.
You may create a nice multiple-entity-row with many icons & complex code - then put it inside a decluttering template, then use this template for all your batteries.
As I said before, the code may become cumbersome if you decide to use input_number instead of hard-coded “35” (just an example).
I have tested for several hours but unfortunately no code so far worked. Perhaps someone can help me.
This is my starting point:
- entity: binary_sensor.fenster_og_kind_nord
type: custom:multiple-entity-row
name: OG Kind
state_header: Nord
state_color: true
entities:
- entity: binary_sensor.fenster_og_kind_west_links
name: West links
state_color: true
- entity: binary_sensor.fenster_og_kind_west_rechts
name: West rechts
state_color: true
This shows the window state of a room with three windows. Once one window is open I want the icon display in a different color. This only works for the main entity but not for the two sub entities.
Because sub-entities are presented as “states” instead of “icons”.
Use “icon: true” for these sub-entities - icons will be displayed instead of states (if you really need this).
Ok I see. Is there a possibility to display an icon which is not linked to an entity and which can be colored according to the state of all three windows?