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
Beginner's Question
- matt (support)
- Site Admin
- Posts: 21453
- Joined: Mon Jan 27, 2003 1:17 pm
- Location: Texas
- Contact:
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.
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.
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
Kostas
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!
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!
Re: Beginner's Question
I have managed to get it done the initial version... still more features to be added.
Please see my other post: http://forums.indigodomo.com/viewtopic. ... 09&t=13543
Kostas
Please see my other post: http://forums.indigodomo.com/viewtopic. ... 09&t=13543
Kostas