I created a dev tool to help interact with the HA REST API

Hi everyone,
I created a little tool to view entity states, events and services exposed through the HA API.
HA API Tool

It connects to your instance and shows the JSON payloads returned by the API in an easy to navigate way. I needed a tool like this for integration iwth services like IFTTT (to understand the structure of payloads.

Check out the blog post for some more information.

5 Likes

Any screenshots? Hassio addon? :beers:

I can’t connect.

my ha is at: https://ajurures.duckdns.org:8123
So I filled the URL as ajurures.duckdns.org:8123/api

also tried removing SSL on my ha, didn’t work either.

The connection is established over wss (secured web socket)

'wss://' + CredentialService.getApiUrl() + '/websocket'

I think it’s due to the port number… my instance runs on a subdomain that automatically routes to the correct port. Does your domain forward websocket requests?
I can only test it with my instance, didn’t think it would cause issues with other logins. :confused:
What is the error you are getting in the console?

Added a screenshot.

1 Like

Il be honest, I don’t really understand Docker properly. Can you advise why the following fails?
Cheers

robmarkcole@Synology:~$ sudo docker pull danobot/ha-api-tool
Password:
Using default tag: latest
latest: Pulling from danobot/ha-api-tool
59e81a3fde58: Pull complete
4f28826ae5f2: Pull complete
ed277c927857: Pull complete
0ae1101455d1: Pull complete
Digest: sha256:3f61d083ba8b9ae9a1911083c40e321942c917d70ad49b35a3c3219732808476
Status: Downloaded newer image for danobot/ha-api-tool:latest
robmarkcole@Synology:~$ docker-compose up -d ha-api-tool
ERROR:
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml

You need a docker-compose file to use docker-compose. The one you’ll need is https://github.com/danobot/ha-api-tool/blob/master/docker-compose.yaml. Save it anywhere you like on your Synology (home folder is fine), and then run docker-compose up -d ha-api-tool. That should start up the container with the official configuration.

Thanks, added the config file but now getting the following:

robmarkcole@Synology:~$ docker-compose up -d ha-api-tool
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Your user account probably isn’t in the docker group. Try using sudo (sudo docker-compose up -d ha-api-tool).

Thanks I tried that, the container starts then stops a second later with no error message that I can see

That’s strange. I’m going to do some research and try to find out what’s happening.

1 Like

clone the repo and start a simple Nginx container that serves the /app directory. thats all the image does. It’s just a small web server to serve the files.