Beginner's Question

Posted on
Fri Nov 21, 2014 2:05 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

Beginner's Question

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

Posted on
Sat Nov 22, 2014 2:30 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Beginner's Question

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

Posted on
Sat Nov 22, 2014 2:35 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

Re: Beginner's Question

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

Kostas

Posted on
Wed Dec 24, 2014 8:20 pm
spiv offline
Posts: 190
Joined: Jul 15, 2014

Re: Beginner's Question

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!

Posted on
Sun Mar 01, 2015 2:43 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

Re: Beginner's Question

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.php?f=109&t=13543

Kostas

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron