Home Assistant API Tool

The ultimate development tool for the Home Assistant API. Connect to your hub, load in your entities and start exploring the capabilities of Home Assistant’s REST API. Edit entity states, trigger automations, send data and call services.

I wrote this dev tool to gain better visbility of the data exchanged between clients and the API endpoint.

Access Tool

Some Screenshots showing the 3 major screens of the tool.

Fuctionality

This tool provides a web interface allowing you view Home Assistant API data. The first release includes functionality to view:

  • Entities, domains and their states
  • Real time Events and event data
  • Services and their properties

The aim for the tool is to allow you to explore the JSON payloads returned by Home Assistant’s API such that you can build your own payloads to use in services such as IFTTT or Dialogflow.

In the future, you will be able to modify entity states, though there is an open issue blocking the implementation of this feature.

I wrote this tool to aid in the HA integration with third-party services via the REST API. Home Asssistants built-in developer tools do not provide the visibility I was looking for and felt clunky to use. For example, having to write JSON payloads from scratch and losing all progress when navigating to a different tab.

Getting started

To get started quickly, you can play with the hosted version here. Just enter your API endpoint and authentication token and you should be good to go.

HA API Tool

Note that this tool runs entirely in your browser. The web server is only required initially to serve the HTML/CSS/JS.

The hosted version runs on the latest production Docker image for Raspberry Pi danobot/ha-api-tool:rpi3 available on DockerHub. The latest image is automatically regenerated as part of the deployment pipeline.

Note that the tool is built in JavaScript and runs locally in your browser. Apart from the initial HTML/CSS/JS download, no data is transferred between my server and your machine. Your login credentials are persisted to your Browser’s local storage (they do not leave your machine except to connect to your Home Assistant server). Other than that, no data is persisted.

Once downloaded, the application communicates directly with your Home Assistant server. You are welcome to build and/or run the image yourself. The necessary instructions are below.

Build your own image

Clone the master branch and run:

docker build -t ha-api-tool .

Run a local Docker container

Clone the repository, or copy the docker-compose.yaml file to your local drive. Then run:

docker-compose up -d ha-api-tool

Backlog

See the Github repository for a list of open issues and backlog items. Feel free to submit pull requests.

Any help with this project is appreciated. Pull requests are welcome.

Major Backlog items

  • trigger services
  • update entity states
  • trigger automations with prefilled payloads