How to render the results of a REST request

Hi all.

So, I thought I was at least a competent HA user and that HA could do ANYTHING. But now I’m stumped.

I would like to have HA send a REST request to to an https endpoint, apply the resulting json object to a template, and display that document in a card on a dashboard.

For example, I have a list of chores stored in a NoCoDb database that I would like HA to display on my kid’s dashboard. I know I could use a to-do list, but I have other purposes as well.

Any thoughts on how I could do this… in general?

TIA,
Mike.

You should show what you have tried, the output of the call to the endpoint, and any other useful information.

There are some exceptions, but usually any information you want to show on a dashboard has to come from one or more entities. You can use various cards to change how the information is displayed but the source is going to be an entity.

So, a RESTful sensor would be the starting point to get data from a REST endpoint into an entity.

1 Like

Take a look at this project. Sports Standings and Scores - #893 by kbrown01

It uses (many) Rest sensors to gather sports scoring and standings and mostly flex-table to display this info.

Here is an example of a template sensor that reads its data from a rest command every 10 minutes:

- triggers:
    - trigger: time_pattern
      minutes: /10
  actions:
    - action: rest_command.get_filaments
      response_variable: get_filaments_response
  sensor:
    - name: Filaments list
      unique_id: filaments_list
      state: >
        {% if get_filaments_response["status"] != 200 %}
          unavailable
        {% else %}
          {{ now() }}
        {% endif %}
      attributes:
        payload: '{{ get_filaments_response["content"] }}'