custom-cards / flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
GNU General Public License v3.0
208 stars 26 forks source link

Problem with multiple sensor in 1 row #9

Closed edoardop13 closed 4 years ago

edoardop13 commented 5 years ago

I would like to see more sensors in each row, in this I would have the name of the sonoff, the sensor of the wifi, the ip sensor, and that of the version of tasmota. How can I do?

schermata 2019-02-25 alle 13 08 53
daringer commented 5 years ago

mmmh, that's really a tricky request. the problem is that flex-table is more or less by design: one entity per row. But in general it should not be too hard to configure around this.

could you maybe show me a more detailed example including how the cells relate to each other, so how do you select a certain cell based on the information within one row.

also there might be a partly hacky easy solution for this, I could simply add a transpose: true config param, which would just transpose the table, thus cols will end up as rows and rows as cols.... let's me check, this might be anyways useful.

edoardop13 commented 5 years ago

This is a table with various sensors

Name Ip wifi tasmota
sonoff bathroom sensor.ip_bathroom_sonoff sensor.wifi_bathroom_sonoff sensor.bathroom_version
sonoff .... sensor.ip_.... sensor.wifi... sensor....version
sonoff... sensor.ip_.... sensor.wifi... sensor...version

And this is how it should come. The date is not real

Name Ip Wifi Tasmota
sonoff bathroom 192.168.1.2 60% 6.04.01
sonoff .... 192.168.1.4 70% 6.04.01
sonoff... 192.168.1.5 50% 6.04.01
daringer commented 5 years ago

ah ok, still tricky, because I get the impression there is no "computational" relation between the cells in the row. the only think what would come in my mind to iteratively create each row, would be a template-like column description and on top of that each row would the receive a string to be used by the respective column-templates ... do I get this correctly? Feel free to also try to think of a configuration you would think of for this table, this might also help.

But by lookin' on it from another perspective, if the size of the table (data) is limited the easier option might be to just provide a "static" parameter possibility for the columns to simply put arbitrary to-be-evaluated items in by hand and during content creation those will get evaluated.

Think I start getting a better view on what you would like to have, still how is not trivial: option 1 would break various design ideas, mainly: the one-on-one mapping of the entities vs. rows. option 2 looks easier, but it somehow introduces data storage into a custom-card configuration, which is (I guess) by definition nothing bad, but sure not intended.

will overthink this....

edoardop13 commented 5 years ago

Thanks for your reply. What do you think to do the option 1 and 2?

daringer commented 5 years ago

honestly, I am not a fan of any of both options. Nevertheless, I am currently looking into how this and similar every-row-does-not-represent-an-entity-cases might be handled, because I see need, too. Will keep you updated...

daringer commented 4 years ago

I see no clever solution for this at this moment, feel free to re-open for more discussions, ideas or even solutions...