Table based on pyscript response

Hi,

Looking for a way to show a table on a dashboard, based on data available from a pyscript call.

I’ve written a pyscript that periodically checks if there’s interesting sports tournaments available for me on a public API. It sends me a mobile notification if there’s one matching my criteria, with a button that lets me add that tournament to the ignore list. The table I’m trying to build would show me tournament name and date, and ideally (nice to have :)) a button to remove it from the ignore list (another pyscript call).

With pyscript I have a lot of freedom in what’s in the reponse JSON object, but I can’t find a way to show this data in a nice table.

All suggestions are welcome!

Two table solutions that I use:

  • markdown card, which can do ‘anything’ and I use it mainly when I do not control the format of the data in the sensor
  • flex table card, also powerful but expects the proper structure

The latter looks imo better and with less layout effort but has limitations.
Since you control the incoming data and format, you can choose

1 Like

Thanks! I was trying to do the service call directly from a widget, but that doesn’t seem possible. Now using the flex-table-card with a template sensor as an intermediate step for storing the data, this seems to work!