Can't find the REST API

Sorry, I’m probably asking a really dumb question, but I can’t seem to access the REST API.

  • I’ve downloaded OpenRemote-Controller-2.1.0, and installed on a Raspberry PI.
  • I’ve designed my GUI.
  • I connect to http://xxx.xxx.xxx.xx:8080/controller/ - this works,
  • I use the GUI on my iPhone - all is well.

I now want to use the REST API, so I can integrate with Homekit,

However, when I try

  http://xxx.xxx.xxx.xx:8080/controller/rest/panels

or

 http://xxx.xxx.xxx.xx:8080/controller//rest/capabilities

I get a “connection refused” error.

Is there something I need to configure / install to turn the REST API on?

Cheers,

Here’s two “paragraphs” of my HomeBridge json file:

    "accessories": [{
            "accessory": "openremote",
            "name": "Office Light",
            "switchHandling": "realtime",
            "http_method": "POST",
            "on_url": "http://localhost:8688/controller/rest/control/771/ON",
            "off_url": "http://localhost:8688/controller/rest/control/771/OFF",
            "status_url": "http://localhost:8688/controller/rest/status/286041"
    }, {
            "accessory": "openremote",
            "name": "Office Socket",
            "switchHandling": "realtime",
            "http_method": "POST",
            "on_url": "http://localhost:8688/controller/rest/control/775/ON",
            "off_url": "http://localhost:8688/controller/rest/control/775/OFF",
            "status_url": "http://localhost:8688/controller/rest/status/286081"
    }, {

I seem to be using a different port than you, but other than that, REST works without any special setup, for me.

curl http://localhost:8688/controller/rest/panels
curl http://localhost:8688/controller/rest/capabilities

Both commands work for me as well.

curl http://localhost:8688/controller/

does nothing, returns nothing.

Thank you for the reply.

However, I’ve been down that road.

The challenge I face is the OpenRemote rest API URLs do not work - the server returns a 404 error.

I’m pretty close to giving up. Been playing with HAP.nodeJS - seems to offer an easier way to get Homekit integration.

Cheers,

I think you’re reading my reply wrong… It does work. Something is incorrect on your system that is preventing the URL from functioning. My first guess is that you have another product consuming port 8080 and that you are trying to send rest commands to it and its got no idea what you’re saying. You say that :8080/controller “works” but it’s not supposed to work! OpenRemote doesn’t run on port 8080 out-of-the-box, you had to move it there. I suggest you try using the default OpenRemote port and see if the responses there are more to your liking.

Browse to your Controller running on Raspberry - it’ll show the URL in your browser and the port will be there… tack on /rest/panels

That’s my only guess with what you’re supplied.

Thank you for your continued support.

Let’s take a step back, here’s what I did…

  1. Downloaded https://sourceforge.net/projects/openremote/files/OpenRemote-Controller-2.1.0.zip/download

  2. Run ./openremote.sh run

  3. Connected to http://localhost:8080/Controller

Here I am shown the “Welcome to OpenRemote” screen where I can load the config etc.

I didn’t configure port 8080. it was out of the box that way.

So I now try http://localhost:8080/rest/capabilities and I get a 404 error.

However, if I try as you suggest, http://localhost:8080/controller/rest/status/286041, I start getting XML errors back - which is good, as it means its talking to me,

So the issue seems to be it’s not supporting “capabilities”. Now I know what’s going on, I can live with that, and start configuring the accessories

Cheers,

Colin

Controller 2.1 uses 8080 as port, that’s correct. Controller Pro and now 2.5+ are using 8688.

/rest/capabilities never made it to any stable branches and I wonder why you would need it.

Try something simple like /rest/panels first.