Hi, I’m trying to get my temperature values individually colored, based on a value held in the sensor attributes (so each value cell is the color represented in the color attribute). Here are the entities and attributes:
I have a card which looks like this, displays the sensor and the temp OK, but without any color…
type: custom:flex-table-card
title: Hot Water Levels
entities:
include: sensor.hw_levels*
columns:
- name: Sensor
data: sensor
align: center
- name: Temp
data: state
align: center
suffix: ' °C'
If I then try and add a <div> using x.color which I hoped would pick up the color attribute
type: custom:flex-table-card
title: Hot Water Levels
entities:
include: sensor.hw_levels*
columns:
- name: Sensor
data: sensor
align: center
- name: Temp
data: state
align: center
modify: |
'<div style="color: ' + x.color + '">;' + x + ' °C ;</div>'
it doesn’t work, it just displays the value (x °C) in black - I’ve tried all combinations I can find in this thread but nothing seems to work, as x.color doesn’t seem to exist and I don’t understand why
Why would you want to, does your card data contain multiple currencies ? Or do you want it to change when you change your lovelace settings to another currency? Would showing € not be enough?
EDIT… I clearly donot have an immediate answer else I would have given that…just checking
I love this card. Is there a way to make a particular column clickable and have a defined action for that click? My use case is that I’ve got a list of device names in column 1, I want column 2 to show the on/off status of the devices, and I want column 3 to contain buttons that let me switch those devices on or off. Thanks for any tips!
The last 3 rows (summation) are always at the bottom because I use a hidden column (attribute) I call “master_sort_value” where I can specify that the 3 rows will always come after my data rows. within the data rows I sort by kWh today.
When I sort using the new feature - it sorts all data in a row - so my summation rows are no longer at the bottom. Is there some way to limit which rows the column header sort affects?
Are there other ways to achieve what I am doing here? What I have works perfectly - it’s just that I can’t use the column header sort feature.
Does it mean that your sensors have an attribute called “master_sort_value”? And only for these 3 entities this attribute has some value?
As for your case: consider creating ANOTHER table w/o a header for these 3 entities; place both tables one after one. Probably you will have to define column widths to “sync” these tables…
I was thinking about the 2 table solution - I wasn’t sure if I could do this without a space in between the tables or not. I didn’t even think about column widths - and I suppose when looking at this on my phone where I expand and contract the size (with my fingers) to zoom in and out - that it might go weird as the main table would zoom and the summation row table would stay at its original width?
Vertical space may be fixed by card-mod.
“Syncing” widths here seems to be only done by fixing them - for both tables ((((. Yes, it would not be as convenient as adaptive widths.
The recent update of flex-table broke any use of the “title” attribute within custom HTML for headings. See Sports Standings and Scores - #292 by cyberphox and the two following posts. If confirmed I can post a GITHUB issue.
Many of my headings have either shortened names (like “GP” or “C”).
These stand for “Games Played” or “Clinch Indicatior”.
And the Clinch indicator is even deeper as it could be “e” for eliminated, “x” for in playoffs, etc.
I use the title attribute so a mouseover the heading pops the browser built in display of an alternate description. It can be something like this:
- name: >-
<div title="Clinch Indicator: * : Clinched Presidents' Trophy
(Best Regular-Season Record) x : Clinched Playoff Berth -
: In The Hunt e : Eliminated from Playoff Contention">C</div>
So the header of the table displays “C” and on mouse over it displays what “C” means as well as all the values in the column.
It saves real estate, I could of course put in just a markdown block with the “key” but I do not prefer that for many reasons (scrolling up/down). See W3Schools Tryit Editor
These headings then on mouseover popup their real meaning in longer words and not abbreviations.
So, a “title” attribute stands for a displayed tooltip for a header.
This is a rather useful feature.
Since I am very far my HA and cannot reproduce & confirm this feature stopped working - I suggest you to create an issue on GitHub. Add a SHORT code to describe the tooltip feature - and describe what was broken after the latest update. Maybe this issue will be converted to FR “add a tooltip” then.
Hi,
I’d need advice on how to deal with a space in an element’s name in an attributed list?
For example, I have a sensor with an attribute called ROUTES containing a list of dicts as follows: