indigo utilities discussion

Posted on
Thu Feb 08, 2018 9:32 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

I would like to point out that the 2 systems indigo internal db and what ever you do externally can become quickly out of sync.
If a device gets deleted added renamed would require a trigger to update that dB.
I am speaking from experience. This is a lot of work to make this kind of thing work.


Why don’t you do directly to the source ie indigo ?


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 08, 2018 10:18 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: indigo utilities discussion

Yes, agree would need some updating and refreshing but manageable on adhoc basis if I saw issues on the results.

I am trying to setup a dashboard for my house in Qlikview which has free personal license for single use, and is a data visualisation tool I have used for many years, and can read data from postgresql.
With a table of all device ids I can create a loop to load in each table, and with the names against them, create a more useful name for that device. I have done this manually copying out from the log the list of all devices, but a pain to update this way.

Taking it to the next step, I can then create a different sql statement per device type, ie per PIR, thermostat, light switch etc, where each type has the same columns. As I loop through the device ids, if the name ends "PIR", or "Stat" etc (I am consistent with my naming of devices) then it will load that device into the right table.

I can then create interactive charts there .

Posted on
Thu Feb 08, 2018 11:11 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

again the question why don't you go directly against indigo? the db is just an intermediate storage. can quick .. only read sql databases? or can you feed things directly?

Posted on
Thu Feb 08, 2018 11:27 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: indigo utilities discussion

It does have a REST connector as well so guess it could query indigo directly for that information.?

Posted on
Thu Feb 08, 2018 11:40 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

U can get states etc thru rest but don’t know if you can get a device list.


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 08, 2018 12:02 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: indigo utilities discussion

You can get a device list via REST (assuming you are referring to Indigo's RESTful API):

Code: Select all
http://127.0.0.1:8176/devices/
http://127.0.0.1:8176/devices.json/
http://127.0.0.1:8176/devices.xml/
http://127.0.0.1:8176/devices.txt/

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Thu Feb 08, 2018 12:27 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: indigo utilities discussion

Colorado4Wheeler wrote:
You can get a device list via REST (assuming you are referring to Indigo's RESTful API):

Code: Select all
http://127.0.0.1:8176/devices/
http://127.0.0.1:8176/devices.json/
http://127.0.0.1:8176/devices.xml/
http://127.0.0.1:8176/devices.txt/



Note that those lists don't include the ID, so you'll need to iterate through the lists, get the restURL element and use that to get the device details that includes the ID.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Feb 08, 2018 6:00 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: indigo utilities discussion

Thanks all. Yes realised that the device list from REST wouldn't do it without some hugely painful looping.
Think the easiest is to try and loop through the device list and get the id to name that way into a table.

Sorry Karl, seem to have hijacked your thread, this would have been better in my earlier script question thread.


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 08, 2018 10:28 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: indigo utilities discussion

to read the device states you don't need the devId, the devName is ok ..
just pay attention if the name changes .. I know thats not perfect, but it saves - in your case - a lot of programming I believe.


Code: Select all
curl -u uid:pwd --digest http://192.168.1.xx:8176/devices/UniFi_sw_2_1_study.json

will give you all the states.. Actually I don't know how to use the devId to get the states through REST !? .. may be somewhere in the docu..


Karl
http://wiki.indigodomo.com/doku.php?id=indigo_s_restful_urls for the rest api

Posted on
Fri Feb 09, 2018 10:02 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: indigo utilities discussion

kw123 wrote:
to read the device states you don't need the devId, the devName is ok ..
just pay attention if the name changes .. I know thats not perfect, but it saves - in your case - a lot of programming I believe.


Code: Select all
curl -u uid:pwd --digest http://192.168.1.xx:8176/devices/UniFi_sw_2_1_study.json

will give you all the states.. Actually I don't know how to use the devId to get the states through REST !? .. may be somewhere in the docu..


Karl
http://wiki.indigodomo.com/doku.php?id=indigo_s_restful_urls for the rest api


I think he's using the Postgres DB directly and only needs the name to make his visualizations more readable.

The ID was added after the fact to the existing REST API - it's not used in any place other than returned with the device details so you can't get a device based in the ID. We're currently planning a pretty big revamp of the REST API as we reimplement the Indigo Web Server using the IOM (the current IWS implementation predates plugins, object IDs, and the IOM which is why it lacks features).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Feb 09, 2018 10:06 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: indigo utilities discussion

jay (support) wrote:
We're currently planning a pretty big revamp of the REST API as we reimplement the Indigo Web Server using the IOM


There's a new plugin I can scrap then :). I was rewriting the API via a plugin.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Fri Feb 09, 2018 10:34 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: indigo utilities discussion

Colorado4Wheeler wrote:
jay (support) wrote:
We're currently planning a pretty big revamp of the REST API as we reimplement the Indigo Web Server using the IOM


There's a new plugin I can scrap then :). I was rewriting the API via a plugin.


Yeah, that would probably not be the best use of your time...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Feb 09, 2018 10:37 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: indigo utilities discussion

jay (support) wrote:
Yeah, that would probably not be the best use of your time...


Lol, if I had a penny for each plugin that wasn't a good use of my time.... :shock: . That project only got a little bit of love when I utilized it in the HKB plugin (sort of), but it was slated for a month or two down the road before I lit it up anyway so I've only spent maybe 1-3 hours working on what's there now. Glad to not have to write it honestly.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Fri Feb 09, 2018 11:30 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: indigo utilities discussion

I think he's using the Postgres DB directly and only needs the name to make his visualizations more readable.

The ID was added after the fact to the existing REST API - it's not used in any place other than returned with the device details so you can't get a device based in the ID. We're currently planning a pretty big revamp of the REST API as we reimplement the Indigo Web Server using the IOM (the current IWS implementation predates plugins, object IDs, and the IOM which is why it lacks features).


Exactly. Any idea on a timeline for the new REST API? Think I might stick with the manual table for now and wait for the API but will investigate automating it if I run out of other indigo tasks to do.


Sent from my iPhone using Tapatalk

Posted on
Fri Feb 09, 2018 12:00 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: indigo utilities discussion

siclark wrote:
Exactly. Any idea on a timeline for the new REST API? Think I might stick with the manual table for now and wait for the API but will investigate automating it if I run out of other indigo tasks to do.

We don't like to give time estimates / ETAs, but it is a high priority item.

Image

Page 8 of 11 1 ... 5, 6, 7, 8, 9, 10, 11

Who is online

Users browsing this forum: No registered users and 6 guests