IPhone SDK

Posted on
Tue Mar 25, 2008 9:56 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

(No subject)

Martijn Heeroma wrote:
I can make this easier in a future build...

would be nice, I think I'll wait for that ;)

In the next build (not yet posted), try using $dev.addressStr. It'll contain either the X10 or INSTEON address as a string.

Matt

Posted on
Wed Mar 26, 2008 12:36 am
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

In the next build (not yet posted), try using $dev.addressStr. It'll contain either the X10 or INSTEON address as a string.

Matt


thnx Matt, that makes the "device detail" screen shine some more.

Is it possible to add the dev.description string also ?

and the "last 50 log lines"

sorry I'm asking so much.

Posted on
Wed Mar 26, 2008 8:35 am
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

(No subject)

Martijn Heeroma wrote:
Is it possible to add the dev.description string also ?

Yes, I just added $dev.desc to the next build (still not yet posted).

Martijn Heeroma wrote:
and the "last 50 log lines"

This one will have to wait a bit since it isn't a 2 minute addition. :-)

Regards,
Matt

Posted on
Wed Mar 26, 2008 1:11 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

Yes, I just added $dev.desc to the next build (still not yet posted).

thnx Matt

for now I have the device_detail working,
it time to try to get some commands back to the server.

Xcode project 7.1 mb

Image

Posted on
Wed Mar 26, 2008 3:35 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

nightly build:

- the slider shows the correct device value
- device array moved away from the devicelist.m
- button controllers work now

Xcode project 5.77 mb

sometimes cocoa looks weird for me,
this is what I have to do when I convert a string to an int:

Code: Select all
  NSScanner *theScanner;
    NSInteger brightness;
    NSString *brightnessstring = [[Devicelist objectAtIndex: gCurrentDevice_Nr] objectForKey:@"DeviceBrightness"];
    theScanner = [NSScanner scannerWithString:brightnessstring];
    while ([theScanner isAtEnd] == NO)
    {
   [theScanner scanInteger:&brightness];   
   }
   slider.value =brightness;

Posted on
Wed Mar 26, 2008 4:46 pm
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

Admin:

So, I have this idea/solution.
Maybe its ridicoulus, maybe not.

If you can implement a sort of folder support in the device list in Indigo, then we can easily put devices inside these "invisible" folders. They would be visible ofcourse, but of no use in Indoge other that control. I know my rooms have several devices, and to organize these would be just great. It would stop me from having similar names divided in "Livingroom zone 1, Livingroom zone 2," and so on. Nice feature, with drag and drop, ofcourse :)

Now heres the plus side:

The native iPhone client would use this functionality to automatically put these folders in a list view together with a "System Folder" that would have the basic All Off, All lights off and all lights on. This would simplify the whole setup, give it a clean UI and create a easy to use native app. There wouldnt be much more use for other functionality in a native app.

Just my 1 cents...

Posted on
Fri Mar 28, 2008 9:03 am
DaveGee offline
Posts: 60
Joined: Nov 01, 2005

(No subject)

Just wanted to say again how cool this is...

I've been working with your source code and have it talking to my ISY-26 as well... Its working like a charm -- so far I've been doing all the 'information gathering' the ISY doesn't provide all the data Indigo does and some things are simply nonexistent from the ISY like variables for one... but today I'm moving onward and upward to telling the ISY to tun off my computer room light.. shock .. wonderment .. ooooos ... ahhhs... or as my wife you say why not just get up and turn off the damn switch already! :lol:

I'll let you know how it goes...

Dave

Posted on
Fri Mar 28, 2008 2:31 pm
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

I will want reply you know. Ok?

:-)

Posted on
Fri Mar 28, 2008 6:05 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

Set device on and off button work in the device detail window
jummy its getting usefull

Xcode project 5.8 mb

getting commands back to Indigo server I did by sending URL's like this:
http://192.168.1.100:8000/turnoff?device=Lamp%20tv

Code: Select all
- (void)sendCommandToIndigoURL:(NSString *)CommandURL
{
    // create the request
   NSString *string1 = @"http://";
   NSString* string2 = [string1 stringByAppendingString:gIndigoServer_IPAddress ];
   NSString* string3 = [string2 stringByAppendingString:@":"];
   NSString* string4 = [string3 stringByAppendingString:gIndigoServer_WebPortNr];
   NSString* string5 = [string4 stringByAppendingString:@"/"];
   NSString* string6 = [string5 stringByAppendingString:CommandURL];
   NSString* string7 = [string6 stringByAppendingString:@"?device="];
   NSString* IndigoCommandURL = [string7 stringByAppendingString:gCurrentDevice_Name];
   NSLog(@"IndigoCommandURL: %@", IndigoCommandURL);
    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:[IndigoCommandURL stringByAddingPercentEscapesUsingEncoding:kCFStringEncodingUTF8]]
                                              cachePolicy:NSURLRequestUseProtocolCachePolicy
                                          timeoutInterval:60.0];
    // create the connection with the request
    // and start loading the data
    NSURLDownload  *theDownload=[[NSURLDownload alloc] initWithRequest:theRequest
                                             delegate:self];
    if (theDownload) {
        // set the destination file now
        //[theDownload setDestination:CONFIG_SOURCE_PATH allowOverwrite:YES];
    } else {
        // inform the user that the download could not be made
    }
}

Posted on
Sun Mar 30, 2008 2:55 am
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

Major step forward:

What works:
- devicelist, send device on / off commands
- Actiongrouplist send execute action
- Controlpageslist go to that page
- Preferences (not working yet, just dummy data)
- Variableslist show value

next things I want to do:
- Make the prefs working and savable
- do the queries async (now they lock up the app)
- save all the lists locally for using as "startup-chache"
- make the UI more sexy, try to add icons and buttons to the list views
- try to get it working when a password is needed on the Indigo server
- play with the interface builder ;)

indigowebserver files included put them into the appropiate places,
restart the Indigo server and change the server ip in the source code
to get this working.

Xcode project 5.7 mb

Posted on
Sun Mar 30, 2008 7:56 am
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

added:

- preferences with save
- icons in front of the device list

Xcode project 5.8 mb

Posted on
Mon Mar 31, 2008 12:05 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

added:

- load local prefs, test connection, load lists.
- a preload page
- icons in front of all list

(no connection >> wait for 30 sec, go to the prefs panel,
enter server ip and port, klick save button and
restart the IPhone application should work)

Xcode project 5.9 mb

Image

Posted on
Thu Apr 03, 2008 3:54 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)


Posted on
Thu May 08, 2008 1:42 am
classicmac offline
Posts: 9
Joined: Jan 09, 2007

Sending Indigo commands by visiting a URL

Thanks for the info on turning off a device by visiting a URL.

http://192.168.1.100:8000/turnoff?device=Lamp%20tv

That worked for me when I replace my IP:Port and device name. Does anyone know of a way to turn all devices off, or to execute a trigger action? I'm hoping I can just save a bookmark on my iPhone that I can tap to do things.

Thanks

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

(No subject)

You can execute a group:

http://192.168.1.100:8000/executegroup? ... group+name

BTW, you can find all the actions in the file:

/Library/Application Support/Perceptive Automation/Indigo 2/IndigoWebServer/indigopy/indigoreqhandler.py

Look for "def turnon", the other commands will be defined right around there. On my todo list are to document the code a bit more and perhaps build a IWS guide web page.

jay

Who is online

Users browsing this forum: No registered users and 3 guests