teskanoo
(Teska Noo)
June 2, 2024, 6:19pm
207
Captain_Harlock:
but I receive the following error:
Invalid config for 'template' at packages/package_stampante.yaml, line 105: 'attributes' is an invalid
The error relates to this file being !included from configuration.yaml in a way that is the template key invalid.
template:
You may need to read Splitting up the configuration - Home Assistant to understand how to properly split up your configuration if you want to have this in a separate file.
To be able to help you directly I would need some context.
How are you including the file “packages/package_stampante.yaml”? (what is the line in configuration.yaml you use to do this?)
Mine looks like this
packages: !include_dir_named db1138/packages
my package files are in /config/db1138/packages/some_package_file.yaml
I just wonder if you could help me out, and make my life a bit better
I have like 60 nodes that sends Mqtt data to a home assistant “scada unit”.
The data is sent in three packages each depending on how quick they need to be I JSON format.
Then we make sensor out of all the data, like below.
And then to the flex table card and the questions.
I have no problem to list all BatSOC or BatTemp like in the picture imtogether with site name, but I really would like to have it ONE card. Do you have any ideas?
The cards that I have (one for each sensor) looks like below.
I hope you can help me, or at least point the direction for me to solve it.
Your reply is highly appreciated.
kenwiens
(Ken Wiens)
June 12, 2024, 1:45am
209
Can you make a mock up of what you would like the flex table to look like please? Just a few lines of data would be sufficient.
walaj
(Jon Waland)
June 12, 2024, 7:17am
210
I currently have an entities card with multiple custom: multiple-entity-rows to match humidity from one sensor to the temperature from another:
title: Current House Temp and Humidity
type: entities
entities:
- entity: sensor.lumi_lumi_weather_pantryxx_temperature
name: Pantry
show_state: false
type: custom:multiple-entity-row
secondary_info: last-changed
entities:
- entity: sensor.lumi_lumi_weather_pantryxx_temperature
name: false
- entity: sensor.pantry_temp_humidity
name: false
- entity: sensor.lumi_lumi_weather_6d712c02_temperature
name: Alfresco
show_state: false
type: custom:multiple-entity-row
secondary_info: last-changed
entities:
- entity: sensor.lumi_lumi_weather_6d712c02_temperature
name: false
- entity: sensor.lumi_lumi_weather_6d712c02_humidity
name: false
But of course I can only have a fixed sort rather than clickable, which I believe is possible with flex table. Is it possible to “migrate”?
(I can rename the entities to get them to match better)
I would like it to look like “sitename” “state of charge” “Battery temperature” .
Check this
You cannot use flex-table-card to place different entities in columns.
kenwiens
(Ken Wiens)
June 12, 2024, 8:17pm
213
Can you not create a new template that has those 3 fields in it?
1 Like
walaj
(Jon Waland)
June 13, 2024, 12:42am
214
thats what I thought - was just confirming.
EdLeckert
(Ed Leckert)
June 14, 2024, 7:47pm
216
You will have to create a sensor template entity for each room. From configuration.yaml:
template:
- sensor:
- name: Living Room
state: "Room Entity"
attributes:
temperature: '{{ states("sensor.living_room_temperature") }} °F'
humidity: '{{ states("sensor.living_room_humidity") }}%'
last_change_time: '{{ relative_time(states.sensor.living_room_temperature.last_changed) }} ago'
- name: Bedroom
state: "Room Entity"
attributes:
temperature: '{{ states("sensor.bedroom_temperature") }} °F'
humidity: '{{ states("sensor.bedroom_humidity") }}%'
last_change_time: '{{ relative_time(states.sensor.bedroom_temperature.last_changed) }} ago'
Then you can use a custom:auto-entities
card to select them. I used a fixed state as a selection filter, but you could use a naming convention, group, label, or other method of selection.
The card is then:
type: custom:auto-entities
filter:
include:
- state: Room Entity
card:
type: custom:flex-table-card
title: Current House Temp and Humidity
columns:
- name: ''
modify: '''<ha-icon icon="mdi:thermometer" style=color:green;></ha-icon>'' '
- name: Friendly Name
data: friendly_name
- name: Last Changed
data: last_change_time
- name: Temperature
data: temperature
- name: Humidity
data: humidity
The result:
You can then sort by clicking on a column header.
3 Likes
I’m having problems using this card to display a list of entities with a set of attributes which contain a list of strings . The rows do not display.
I’m having for example the entity binary_sensor.watchdog_ip_device
and with the attribute unmanaged_devices
:
The card:
- type: 'custom:flex-table-card'
entities:
include: binary_sensor.watchdog_ip_device
clickable: true
columns:
- data: icon
name: ''
- data: name
name: Name
- data: unmanaged_devices
name: Unmanaged Devices
Shows an empty result:
When I remove the attribute containing the list, the table gets populated:
- type: 'custom:flex-table-card'
entities:
include: binary_sensor.watchdog_ip_device
clickable: true
columns:
- data: icon
name: ''
- data: name
name: Name
How can I display the content of the attribute unmanaged_devices
in a separate column?
Figured it out: setting the auto_format
card parameter to true
did the trick.
kbrown01
(Kbrown01)
June 29, 2024, 3:01am
219
Could also be easily solved with this … but the code owner does not respond so not sure it is being kept up:
opened 07:03PM - 27 Dec 23 UTC
While the code for Cellformatters is great, there are many highly custom uses th… at are not really something that should mess with the core JS. One should be able to drop in some file where personal CellFormatters can be defined and used withn their installation without breaking the core installation.
Example, take this:
```
- name: Vault
data: '[[attribute]]'
modify: >
if (x.EventPlace1 == 1 || x.EventPlace1 == '1T') {
'<div style="font-weight:bold; color: black">' + x.EventScore1 + ' ' + '<span style="font-size:14px">' + x.EventPlace1 + '</span></div>'}
else if (x.EventPlace1 == 2 || x.EventPlace1 == 3 || x.EventPlace1
== '2T' || x.EventPlace1 == '3T') {
'<div style="font-weight:normal; color:black;">' + x.EventScore1 + ' ' + '<span style="font-size:14px;font-weight:bold;color:black">' + x.EventPlace1 + '</span></div>'}
else {
'<div style="font-weight:normal; color: #888;">' + x.EventScore1 + ' ' + '<span style="font-size:14px">' + x.EventPlace1 + '</span></div>'}
- name: Bars
```
No one want that code but me and possibly a few others that may display gymnastics statistics. The raw data is such that that `modify` is repeated for Event/Score 1 - 7 (think Floor, Bars, Vault, Beam, ...) and also All Around score.
It would be much more valuable to write that simply as:
`modify: "eventscore(x.EventPlace1, x.EventScore1)"`
or
`modify: "eventscore(x.AAPlace,x.AAScore)"`
I have yet to test but I assume I could jut hack my formatter into the base class and test it but it would not stand through updates.
foleys
July 1, 2024, 8:34pm
220
Is there a way to limit the shown entities to a single HA integration? I would like to show a table with only and all ZHA devices/entities, regardless of how the entities are named.
Read in docs about using with auto-entities. Then use an appropriate filter in auto-entities.
teskanoo
(Teska Noo)
July 9, 2024, 7:16am
222
You have a few options here
Jinja templating to create the data for the flex-table card:
All ZHA Entities
{{- integration_entities('zha')-}}
Just the lights
{{- integration_entities('zha')| select('search', '^light\.')| list -}}
And then there’s this little gem (derived from Flex-Table)