[ANSWERED]Apple Watch Extension

Posted on
Sat Sep 05, 2015 4:03 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

DVDDave wrote:
I just tried an app called Home Remote from Bouncing Ball Games ...

Note that this could be a very convenient app on the iPhone ,even if you don't have an Apple Watch, since the buttons appear right on the Today screen with a simple swipe down on the phone.

Some other details: I needed to use spaces instead of %20 in my Action names, etc that are embedded in the URL. Also, I put the full URL in the URL text box since I could not get the put/push screen to work yet with a name and password which probably uses digest authentication. However, I think this may work eventually.

Dave

Can you give an example of what you put in the URL - I'm struggling with various formats.

(I know the general Restful structure, but it's how you put the auth and spaces/%20's into the URL)

Peter

Posted on
Sat Sep 05, 2015 4:36 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

Ah, sorted it.

I've got it working both ways, with the auth in the URL and with it separately.

I'm going to use it in the URL, because you can set the default URL for new actions in Settings > Home Control, so if you set that to
Code: Select all
http://user:pass@192.168.x.y/devices/NAME?toggle=1&_method=put
(or the same with Action groups) you only have to edit the name. The name should have spaces in it, unlike normal URLs - it must URLEncode the value itself.

If you want it separate, put the URL as above, but without the user:pass@ bit. Then click Post/Put, select Put, select the User:Pass button and put the relevant user:pass data in the text box, eg Indigo:MyPassw0rd.

If you monitor the Indigo log and see 'access denied' messages, it EITHER means the username/password are wrong, OR the URL is invalid. As Dave says, you need to include spaces in the URL if they exist in Indigo; the app encodes them into %20 itself, so you mustn't do it for it.

I'm loving this app for quick calls like my bedroom TV on and off! Even the voice control works!

Peter

Posted on
Sat Sep 05, 2015 7:46 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: [ANSWERED]Apple Watch Extension

howartp wrote:
Ah, sorted it.

I've got it working both ways, with the auth in the URL and with it separately.

I'm going to use it in the URL, because you can set the default URL for new actions in Settings > Home Control, so if you set that to
Code: Select all
http://user:pass@192.168.x.y/devices/NAME?toggle=1&_method=put
(or the same with Action groups) you only have to edit the name. The name should have spaces in it, unlike normal URLs - it must URLEncode the value itself.

If you want it separate, put the URL as above, but without the user:pass@ bit. Then click Post/Put, select Put, select the User:Pass button and put the relevant user:pass data in the text box, eg Indigo:MyPassw0rd.

If you monitor the Indigo log and see 'access denied' messages, it EITHER means the username/password are wrong, OR the URL is invalid. As Dave says, you need to include spaces in the URL if they exist in Indigo; the app encodes them into %20 itself, so you mustn't do it for it.

I'm loving this app for quick calls like my bedroom TV on and off! Even the voice control works!

Peter


Hi Peter,

Great to hear that someone else is trying this app! Glad you worked out how to use it.

There are a few other things you should know. For some reason, Action requests need to be made with the execute method. (I have no idea why and I'm not even sure it is a standard method). Are you able to send Action requests with the put method?

However, this triggers a nasty problem in Home Remote. After the command is processed, Action requests start going to the server many times per second. The URL that is sent is the same as the one returned to the browser by Indigo if it were sent manually, as if it was being reflected back to the server over and over. The requests continue until the iPhone notification screen, Apple Watch screen, or Pebble Watch screen is dismissed. They come back if the respective screen is redisplayed, even if no button is pushed.

Please let me know if you see this behavior as well; you may need to look at your web server log since the Indigo log may give no indication of this. Come to think of it, I'm using a reverse proxy to enable SSL digest authentication and I wonder if this could be part of the issue. However, I know it works OK directly from a browser. I'll try it direct to the Indigo server to check this out.

I've been in touch with the developer (in your part of the world, I think) and he has been very responsive in trying to figure this out.

--Dave

Posted on
Sun Sep 06, 2015 1:02 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

DVDDave wrote:
For some reason, Action requests need to be made with the execute method. (I have no idea why and I'm not even sure it is a standard method). Are you able to send Action requests with the put method?

However, this triggers a nasty problem in Home Remote. After the command is processed, Action requests start going to the server many times per second.

Actions work fine using the execute method.

URL:
Code: Select all
http://user:pass@192.168.x.y/actions/Action Group Name?_method=execute


I saw the issue with tonnes of attempts going to the server last night when I was testing; once I got the right syntax, it start behaving itself correctly.

I'm using standard Indigo solutions, ie not using reverse proxy. (I really need to read up on them, purely for knowledge - I'm an IT manager but I don't actually know what a reverse proxy is/does!)

Peter

Posted on
Sun Sep 06, 2015 1:19 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: [ANSWERED]Apple Watch Extension

howartp wrote:
Actions work fine using the execute method.

URL:
Code: Select all
http://user:pass@192.168.x.y/actions/Action Group Name?_method=execute


I saw the issue with tonnes of attempts going to the server last night when I was testing; once I got the right syntax, it start behaving itself correctly.

I'm using standard Indigo solutions, ie not using reverse proxy. (I really need to read up on them, purely for knowledge - I'm an IT manager but I don't actually know what a reverse proxy is/does!)

Peter

Interesting. Can you remember what the syntax error was that was causing the multiple requests? My action requests are executed fine and I don't see any syntax error but maybe there is something subtilely wrong that I'm not seeing. I take it from your comment about Actions working fine with the execute method that they don't work for you with the put method either.

The reverse proxy allows me to use https (SSL) requests for a little extra security, especially since I'm embedding my password in the request. There have been other discussion on the forum about it. Not hard to set up with Apache but my son (also an IT manager) helped me so much that I could not recreate the instructions for you here.

Unfortunately, the reverse proxy seems to prevent me from using the Indigo server directly so I can't test whether it might be part of the problem without disabling it and I don't remember how to do that off the top of my head. Hopefully the Home Remote developer will find the problem elsewhere.

--Dave

Posted on
Sun Sep 06, 2015 2:05 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: [ANSWERED]Apple Watch Extension

DVDDave wrote:
Unfortunately, the reverse proxy seems to prevent me from using the Indigo server directly so I can't test whether it might be part of the problem without disabling it and I don't remember how to do that off the top of my head.

Whoops. I take that back. I was able to contact Indigo on its default port. I don't see any evidence of the problem but it still may be happening. Unlike Apache, the Indigo log does not show when a client has requested the status of a action; i.e. when the url is sent without a method as in http://user:pass@192.168.x.y/actions/Action Group Name.

This is the URL returned by Indigo (redirect?) that I think is causing the problem. So if the problem is occurring, there is no obvious way to see it without putting a sniffer of some sort on the connection. While that is beyond my capability, I'll keep looking to see if there is some way to tell if the problem is actually happening. For now, I guess we have a case of Schrödinger's cat. :)

--Dave

Posted on
Sun Sep 06, 2015 4:52 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

I've not tried to 'put' an action group, because the restful API shows it as 'execute' whether you are executing it or just requesting it?

I'm not sure if I'm missing why you're trying to 'put' anything for actions? That could explain your invalid syntax.


Sent from my iPhone using Tapatalk

Posted on
Sun Sep 06, 2015 5:59 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: [ANSWERED]Apple Watch Extension

howartp wrote:
I've not tried to 'put' an action group, because the restful API shows it as 'execute' whether you are executing it or just requesting it?

I'm not sure if I'm missing why you're trying to 'put' anything for actions? That could explain your invalid syntax.

Sorry, Peter; I'm talking about 2 separate issues.

The first issue is that the put method is fully supported by Home Remote but not the execute method. This is a minor issue since I can just form the URL with the embedded name, pw, and method but digest authentication would be more secure. (assuming that is what Home Remote is doing with put (and post). I'm not trying to "put" any actions but it would be nice if the put method was allowed without any parameters other than username and password.

The second issue (much more serious) has to do with the flood of status requests after I execute an action. You mentioned that you got these "tonnes of attempts" before you corrected a syntax problem and I was wondering what the syntax problem was in case I have it.

Finally, I don't think the flood of requests are generated when talking directly to Indigo since I don't see the corresponding increase in network bandwidth when doing this. I have no idea why the reverse proxy would contribute to the problem but I'm letting the developer know all this information.

Thanks.

--Dave

Posted on
Thu Sep 10, 2015 9:47 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: [ANSWERED]Apple Watch Extension

It occurs to me we also need CarPlay and tvOS support for indigo touch. I assume we can expect all of these in indigo 7? ;)


Sent from my iPhone using Tapatalk

Computer says no.

Posted on
Thu Sep 10, 2015 10:44 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED]Apple Watch Extension

Of course (well, actually, Indigo 8 - see below).

BTW, Indigo 7 will cost $600 to cover the cost of hiring a team of engineers so we can implement all this stuff in a reasonable time for Indigo 8.

(just kidding, nobody freak out)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Sep 10, 2015 10:55 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: [ANSWERED]Apple Watch Extension

durosity wrote:
It occurs to me we also need CarPlay and tvOS support for indigo touch. I assume we can expect all of these in indigo 7? ;)


Sent from my iPhone using Tapatalk

Won't I wind up with a bunch of fingerprints on my TV?

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Sep 10, 2015 11:03 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: [ANSWERED]Apple Watch Extension

Yes, yes you will. :p


Sent from my iPad using Tapatalk

Computer says no.

Posted on
Thu Sep 10, 2015 11:56 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

I was looking last night (ie after the Keynote finished, UK time) to see who'd mention tvOS - was surprised nobody had!


Sent from my iPhone using Tapatalk

Posted on
Thu Sep 10, 2015 12:26 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: [ANSWERED]Apple Watch Extension

Also surprisingly no one has ever mentioned CarPlay support either afaik (and I truly wish my car supported it.. Renaults idea of an infotainment system is on the same level as Windows 8.)


Sent from my iPad using Tapatalk

Computer says no.

Posted on
Thu Sep 10, 2015 12:31 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED]Apple Watch Extension

I'm liking the idea of Siri Remote, though at present I don't even use BBC iPlayer, never mind Netflix or Roku.

An indigo tvOS app with notifications and PIP overlaying <current full-screen app> would be cool.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 20 guests