I use auto-entities and flex-table card to dynamically list attributes of sensors that meet the ‘include’ statements. I am looking for ways to pass an attribute to “input_text” when I click on a cell on the same row. For example, let’s say I have a table consisting of 3 columns: Heading1, Heading2, Heading3. I have clickable cells under Heading3. When I click on row1-column3 cell, I want to read the value of row1, column 2 and pass it to input_text (already defined in yaml). Or, any way to pass the value at all, so that external script can act on the value. Is this something supported by flex-table-card?. Any help would be greatly appreciated. Thank you.
Show your code please.
Format it properly following this post.
Thanks for viewing my post.
My base auto-entities and flex-table-card yaml test code is below. I need to write something like modify for the third column to read SiteID:
type: panel
path: test
title: Test
cards:
- type: custom:auto-entities
filter:
include:
- entity_id: /^binary_sensor\.site\d{8}_alarm_status$/
state: "on"
card:
type: custom:flex-table-card
columns:
- name: Status
data: Status
- name: Site ID
data: SiteID
- name: Get Value
data: SiteID
clickable: false
show_header: true
Below is the input_text in configuration.yaml
input_text:
selected_site_id:
name: Selected Site ID
initial: "None"
I tried the modify below but the table has only headings, but empty (it should have 5 rows - when modify is not used) so I cannot really test the clicking function:
- name: Get Value
data: SiteID
modify: >-
"<a href='#' onclick=\"window.dispatchEvent(new CustomEvent('call-service', {
detail: {
domain: 'input_text',
service: 'set_value',
service_data: {
entity_id: 'input_text.selected_site_id',
value: '\" + x + \"'
}
}
}))\">Get Value</a>"