3

I have checked the home assistant documentation page for API's. I could not get and endpoint that would return a list of created areas(kitchen, living room etc) or a list of all my devices.

Is there a way to achieve this?

user7498826
  • 173
  • 3
  • 9
  • 1
    Theres these threads about adding support to expose available areas via rest api here: https://community.home-assistant.io/t/how-to-get-list-of-areas-through-websocket-api-or-hass-object/426485 https://community.home-assistant.io/t/get-api-areas-rest-endpoint/271440 – Marco Jun 23 '22 at 14:07

1 Answers1

0

You can do this via the REST /api/template endpoint:

curl -H 'Authorization: Bearer abc123' '<instance url>/api/template' -d '{"template": "{{ areas() }}"}'

Be sure to check out the REST API documentation, particularly on how to get the bearer token. You may find the templating documentation useful as well.

Scott G
  • 637
  • 6
  • 10