Beginner's Question

Want to create a client for Indigo - perhaps on a platform which we don't currently support? Or do you have an existing product from which you'd like to control Indigo? This forum is the place to ask questions about the various options for integrating with Indigo.
KostasV
Posts: 39
Joined: Sun Nov 16, 2014 12:01 pm
Location: London, UK

Beginner's Question

Post by KostasV »

Hello everyone,

I have been playing with the REST API for some time now and as I'm learning to program in SWIFT I have been using this pet project as my learning canvas.

So far I have managed to connect and get all the information the current API provides which I find very useful, thumbs up for the Indigo team!

I have now created my own little custom iPhone app in place to turn devices on/off but I want to stretch a bit the goal and having the input from Matt I was wondering how "easily" can I create custom pages on the Indigo Web Server and run Indigo scripts to 'interrogate' Z-wave devices?

To be more precise, I want to begin by creating a script that takes as input the device ID and returns the energy consumption that would be awesome!

The commands in terminal are like this:

>>>>dev = indigo.devices[device_id]
>>>>dev.energyCurLevel
22.800000000000001

I can then hopefully use this script within my little iPhone app although ideally I'd like the response to be a simple XML...

Thank you very much in advance and if this has already been asked please point me to the relevant document/page and I will do the reading.

Kostas
User avatar
matt (support)
Site Admin
Posts: 21453
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Beginner's Question

Post by matt (support) »

Hi Kostas,

Sorry, I just now saw this post. I think my post on your other thread probably answers this question, but in summary there is not an easy way to extend the RESTful API to expose this information. We will be improving it in the future, however, so in the mean time I would suggest the Indigo Variable value workaround I mentioned on the other thread.
Image
KostasV
Posts: 39
Joined: Sun Nov 16, 2014 12:01 pm
Location: London, UK

Re: Beginner's Question

Post by KostasV »

Yes, totally covered, you can delete this thread if you like as we covered the topic in a separate discussion.

Kostas
spiv
Posts: 190
Joined: Tue Jul 15, 2014 2:25 pm

Re: Beginner's Question

Post by spiv »

Hi Kostas,

I'm starting to do the same thing - learning Swift and building a simple iPhone app to turn Indigo devices on or off.

Would you be willing to share your sample code/ iOS app? Obviously it would be "as is" without any support or guarantees, but I think it would be helpful for me to see how you have done it so far and to possibly use it as a starting point so I don't completely "re-invent the wheel".

Thanks!
KostasV
Posts: 39
Joined: Sun Nov 16, 2014 12:01 pm
Location: London, UK

Re: Beginner's Question

Post by KostasV »

I have managed to get it done the initial version... still more features to be added. :D

Please see my other post: http://forums.indigodomo.com/viewtopic. ... 09&t=13543

Kostas
Post Reply

Return to “Client APIs”