Flex-table-card

Does anybody know if area_name can be used in data?

I tried with

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.eq3_batt*
card:
  type: custom:flex-table-card
  title: Climate
  clickable: true
  columns:
    - data: area_name
      name: Room
    - data: state
      name: State

but just get “undefinedundefined”.

So far area info is not a part of a state object.
You only may get an area as a part of a “conventional” HA templates:

{{area_name("device_tracker.ac66u")}}
{{area_id("device_tracker.ac66u")}}

but these templates are not supported by flex-table-card.
Also, I do not know any similar methods in Java.

I have been able (with support from thomas and marius) to get it working with the entities card.
So the question would be if it might be possible to somehow combine the flex-table-card with config-template or something similar?

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.eq3_batt*
      options:
        type: custom:template-entity-row
        name: '{{ area_name(''this.entity_id'') }}'
card:
  type: entities

that was the answer

Ideally, the area info must be a part of a “state object”. It is not now - and we have to use these template extensions like “area_id(…)”. Otherwise - this attribute would be available for JS code…

Hi, noob here.

I’m trying to create a table with temperature readings at specific times throughout the day.
So for example:
---------------------------------- 7am----10am----1pm
----------------------Sensor 1----20------21-------18
----------------------Sensor 2----25------30-------27

I use multiple command line sensors to retrieve a value from the default SQLite database(utilizing SQL queries in python and transforming that data to floats).

Now every sensor gives me one reading for a specific time, so the first sensor gives the value at 7 am, the second gives the value at 10 am, etc…

How can I display different entities’ values in each column of the flex table card?

1 row = 1 entity.
Each column may contain:

  • a state (sensor.my_sensor.state);
  • an attribute’s value (sensor.my_sensor.my_attribute);
  • a processed state’s value (Foo(sensor.my_sensor.state));
  • a processed attribute’s value (Foo(sensor.my_sensor.my_attribute)),

but not these:

  • a combination of a state & attributes (sensor.my_sensor.state + sensor.my_sensor.my_attribute + sensor.my_sensor.my_attribute_2);
  • data from another sensors.

Means - you need to PREPARE data before displaying them in flex-table-card - probably define a template sensor with attributes storing all your data.

Update: check this also.

@Ildar_Gabdullin thanks for answering so quickly.
OK, the one-row=one-entity policy is what I feared.

So how do I define a template sensor with all the necessary attributes?
If I understood you correctly, I need a new entity in my database with one collum for each value at a specific time.
So how can I do that and how will I feed it values?
Will the same entity be usable with other dashboard cards?
Any links to guides I can follow?

You need to create a template sensor which is not to be discussed in this thread.
Info related to creating a template sensor may be found here:

1 Like

I am using the flex-card to show some stock data (yahoo finance integration).

Is there a way to make a column data (lets say the stock price) having the url, embedded (https://finance.yahoo.com/quote/AAPL), so when clicking on the cell value, you go to the web site?
If yes, how to I code this, https://finance.yahoo.com/quote/ and then adding the value to the url?

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.some_sensor
card:
  type: custom:flex-table-card
  columns:
    - name: object
      data: state
    - name: object
      data: some_attribute
      modify: '''<a href="'' + x + ''">Link</a>'''

изображение

2 Likes

Thanks. The link works when

  - name: Link
    data: symbol
    modify: '''<a href=https://finance.yahoo.com/quote/'' + x + ''>Y</a>'''

image

Is it possible to use the url for the icon column, so the icon (arrows) becomes the url-link?
Somthing like, witch do not work:

type: custom:flex-table-card
entities:
  include: sensor.yahoofinance*
columns:
  - name: Trend
    data: icon
    modify: '''href=https://finance.yahoo.com/quote/'' + x.symbol + ' ' + ' target="_blank"''
  - name: Råvarer
    data: friendly_name
  - name: Pris $US
    data: state
  - name: ∆%
    data: regularMarketChangePercent
  - name: Link
    data: symbol
    modify: '''<a href=https://finance.yahoo.com/quote/'' + x + ''>Y</a>'''

May be, try to create it by using html, have not tried yet.

My skills are limited, so trying with cut and paste… The code over does not work and cant find other examples.

So are my skills)) never wrote HTML stuff before.
Will try to do it in a week when will be free a bit.

hey, can you share more details how you did the table? I mean the Yahoo Finance infos in a table.
Thanks.

try this btw.

How to use an image as a link in HTML?.

The icon is one of the sensor attributes. Want this to be clickable to a chart.

type: custom:flex-table-card
entities:
  include: sensor.yahoofinance*
columns:
  - name: Trend
    data: icon
  - name: Stock
    data: friendly_name
  - name: Pris $US
    data: state
  - name: ∆%
    data: regularMarketChangePercent
  - name: Link
    data: symbol
    modify: '''<a href=https://finance.yahoo.com/quote/'' + x + '' target="_blank">Link</a>'''

Hi All,

I have a sensor with JSON attributes:

and want to export part into a table just showing the “valid_from” time and “value_inc_vat”. I have tried the following with no entries in the table:

type: custom:flex-table-card
title: Outgoing Rates
entities:
  include: sensor.octopus_outgoing.results
columns:
  - name: Start
    data: valid_from
  - name: Rate
    data: value_inc_vat

and then this:

type: custom:flex-table-card
title: Outgoing Rates
entities:
  include: sensor.octopus_outgoing
columns:
  - name: Start
    data: results.valid_from
  - name: Rate
    data: results.value_inc_vat

I get this:
image
When I do this:

type: custom:flex-table-card
title: Outgoing Rates
entities:
  include: sensor.octopus_outgoing.results
columns:
  - name: Start
    data: results

I get:
image

Any pointers gratefully received!

Cannot reproduce your case, try this:

  - name: xxx
    data: results
    modify: x[0].value_exc_vat

Thanks for the pointer, although that still doesn’t seem to work:
image

Well, cannot help then, have no similar sensors.