Dear All,
I am wondering how to display the data from a sensor that returns a variable number of data (as a list).
As an example, take the emscrss integration. It returns a number of earthquakes as a list:
earthquakes:
- title: 'ML 2.6 DODECANESE ISLANDS, GREECE'
magnitude: 2.6
time: '2021-02-10T08:37:59+02:00'
distance: 290
link: 'https://www.emsc-csem.org/Earthquake/earthquake.php?id=947538'
- title: 'ML 2.9 CRETE, GREECE'
magnitude: 2.9
time: '2021-02-10T08:35:26+02:00'
distance: 313
link: 'https://www.emsc-csem.org/Earthquake/earthquake.php?id=947537'
- title: ML 2.6 NEAR THE COAST OF WESTERN TURKEY
magnitude: 2.6
time: '2021-02-10T07:45:57+02:00'
distance: 235
link: 'https://www.emsc-csem.org/Earthquake/earthquake.php?id=947526'
- title: ML 3.3 IONIAN SEA
magnitude: 3.3
time: '2021-02-10T06:25:51+02:00'
distance: 265
link: 'https://www.emsc-csem.org/Earthquake/earthquake.php?id=947508'
- title: ML 2.0 WESTERN TURKEY
magnitude: 2
time: '2021-02-10T05:27:50+02:00'
distance: 301
link: 'https://www.emsc-csem.org/Earthquake/earthquake.php?id=947525'
friendly_name: Earthquakes
icon: 'mdi:alert'
I can extract the contents of it using this template:
Earthquakes:
{% for quake in state_attr('sensor.earthquakes','earthquakes') %}
{{ quake.time }} - {{ quake.title }} - {{ quake.magnitude }} - {{ quake.distance }} - {{ quake.link }}
{% endfor %}
However, I would like to create a separate UI element for each item in the list.
Which Lovelace element would you use to display the contents? Should I simply use an HTML page to do this? I’m sure a more civilized way exists!
Thanks for any pointers!