Reflectors RESTful API

Posted on
Sat Jan 18, 2020 2:25 am
davinci offline

Reflectors RESTful API

I want to get values from Indigo and set devices without using DDNS.

Is this possible with the subscription? Are there any docs?

Thanks

Posted on
Sat Jan 18, 2020 4:03 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Reflectors RESTful API

I’m not sure I understand the question?


Sent from my iPhone using Tapatalk Pro

Posted on
Sat Jan 18, 2020 4:21 am
davinci offline

Re: Reflectors RESTful API

https://wiki.indigodomo.com/doku.php?id ... stful_urls


Basically, I want to execute this command:
Code: Select all
http://127.0.0.1:8176/actions/party%20scene?_method=execute

but with the reflector:
Code: Select all
http://reflector_url/actions/party%20scene?_method=execute

since I can't use this:
Code: Select all
http://DYNDNS/actions/party%20scene?_method=execute

Posted on
Sun Jan 19, 2020 12:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Reflectors RESTful API

Yes - the REST API is available through the reflector (as are all web functions).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jan 19, 2020 3:47 pm
davinci offline

Re: Reflectors RESTful API

Perfect, thanks for the clarification.

I will try that.

Posted on
Sun May 31, 2020 11:25 am
davinci offline

Re: Reflectors RESTful API

I use the connection and albeit it is somewhat slow, it works.

However, I would like to get the update as quick as possible. So I call the API every 500 ms. But sometimes it stops working and resumes after some time. Is there a limit? What is best practice to get real time data?

Posted on
Sun May 31, 2020 12:15 pm
Dual offline
Posts: 257
Joined: Feb 05, 2019

Re: Reflectors RESTful API

I’m curious why you aren’t using Indigo Touch?


Sent from my iPhone using Tapatalk

Posted on
Sun May 31, 2020 1:06 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Reflectors RESTful API

davinci wrote:
I use the connection and albeit it is somewhat slow, it works.

However, I would like to get the update as quick as possible. So I call the API every 500 ms. But sometimes it stops working and resumes after some time. Is there a limit? What is best practice to get real time data?


Where are you trying to get the data to? What application is doing the polling? Also, where are you located? Where's the Indigo server and the polling client?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 31, 2020 2:15 pm
davinci offline

Re: Reflectors RESTful API

I am from Switzerland.

The data is used in an iOS App that I developed for my personal use. It meets my needs better than IndigoTouch in terms of functionality/looks.

Posted on
Sun May 31, 2020 2:37 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Reflectors RESTful API

The round trip from the Indigo server to the reflector in the US and back to your app is what's killing you. And polling is really inefficient.

You need to implement a push method of getting your updates directly from Indigo, rather then trying to poll for updates. This is a perfect situation for setting up a local MQTT server and using MQTT to push updates from Indigo to your app.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jun 01, 2020 12:25 am
davinci offline

Re: Reflectors RESTful API

I can‘t use dyndns nor port forwarding. Is there a way around this?

I basically have to emulate what Indigo is doing, but with Swiss servers.

Posted on
Mon Jun 01, 2020 8:19 am
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Reflectors RESTful API

How much data are you polling for? How many REST API calls are you trying to make every 500ms? It's possible that if you reduce the frequency of the updates, and minimize the amount of REST calls you're making, then you MIGHT be able to get this to work acceptably.

But, the reality of the situation is that (1) polling is bad, (2) polling at sub-second intervals is worse, (3) REST API calls are fairly high overhead for a single data item, and (4) network delays from Switzerland to the US are just going to make things worse.

Since you can't do anything about (4), it's probably best to avoid using the Indigo reflector at all for this kind of high traffic volume process.

Going to some sort of Push solution solves (1) and (2). And if you're going to use a Push solution, (3) is moot.

Is there some technical reason you can't use DDNS and port forwarding? Is your application only used on the local LAN with the Indigo server, or does it need to be usable from outside your LAN? Using a VPN to access the LAN remotely would eliminate the need for port forwarding, but has it's own issues.

Do you have a cloud server available to substitute for the Indigo Reflector? Or are you willing to pay for one? The company I use for my cloud-based MQTT server (and a few other things) costs US$5/month. Mine is in a US data center, but European data centers are available.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests