Flex-table-card

I think I’ve got it. It took me only two days…

So, I display the brand attribute in a (hidden) colum, modify it to show undefined if it’s not one of the brands I want and use strict: true to hide the rows that contain an undefined cell.

type: custom:flex-table-card
clickable: true
sort_by: state+
strict: true
max_rows: 5
entities:
  include:
    - sensor.station_*sp98
columns:
  - data: brand
    name: Brand
    hidden: true
    modify: "x ==='BP' || x === 'Agip' || x === 'Gulf' || x === 'Shell' || x.includes('Total') || x.includes('Esso') ? x : null"

The only thing is that I couldn’t make it case-insensitive.
x.toLowerCase() === 'agip' doesn’t work

I was looking for any native HA solution, really. It also felt more efficient to ask HA to build the list once instead of having the card to it every time it’s displayed.

I made the template sensor that builds the list, I just couldn’t parse it to the card.

OK, I just learned something too, I did not know that by limiting one column, it would also apply/reduce all rows, previously thinking that if you filter, it would need to be in each column… nice :slight_smile:

I’m open to suggestions to make it case-insensitive. I’m sure I’ve used .toLowerCase() in the modify parameter in the past, I don’t know why it’s not working here.

strict: true hides the whole row if a single cell is undefined