garybixler Posted December 13, 2013 Posted December 13, 2013 Hi Just received my first Ubi and would really like to be able to voice commands to the ISY and receive responses. I would think that their API's are now available so I was wondering if there is still interest in interfacing with this product to give the ISY a voice. UBI (http://theubi.com/) Thanks Gary
ISYhbsh01 Posted December 13, 2013 Posted December 13, 2013 This is from their website: "Integrate with outside apps using command-based HTTP requests (post / get based on a specified command)" This means that you should be able to use UBI to control your ISY by issuing REST commands to the ISY. Sent from my SPH-D710 using Tapatalk
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Thanks hbsh01 I did see where an HTTP post can be entered into the Ubi. As I know little about REST I was wondering if you could supply a simple example of what the command would look like and what I would need to do at the ISY to turn on an Insteon device. I tried searching but didn't find any clear examples. I do have the network module. Thanks very much. Gary
Xathros Posted December 13, 2013 Posted December 13, 2013 Hi Gary- Download the WSDK documentation from: http://www.universal-devices.com/developers/wsdk/4.0.5/ISY-WSDK-4.0.5.zip Read the /REST section. Rest is pretty simple and once you have set up a couple of calls, you will get it. Lets say you have a Switchlinc dimmer at address 11.22.33 and you want to control that with /REST: To turn On: http:///rest/nodes/11%2022%2033/cmd/DON or turn off: http:///rest/nodes/11%2022%2033/cmd/DOF or 50% dim http:///rest/nodes/11%2022%2033/cmd/DON/128 The first time in a session that you isse a rest command, the ISY will prompt for user/pass authentication. Since you want the Ubi to send these commands and it won't be able to answer that login prompt, you will have to pass that info with every command. Your urls will look like: http://isyusername:isypassword@/rest/nodes/11%2022%2033/cmd/DON I am still waiting for my Ubi. I expect it will be a few more weeks before I see it as my order # is 1100-ish after the backers get theirs. I am looking to do exactly what you are trying to do. Can't wait to play with it. Hope this helps. -Xathros
apostolakisl Posted December 13, 2013 Posted December 13, 2013 Xathros is correct except you have to put the last digit of the node in. The node as listed on the device usually has a "1" after it. For example, this turns a light fast on in my house where the isy is at 192.168.1.9. http://192.168.1.9/rest/nodes/12 24 95 1/cmd/DFON This is the device whose address is 12.24.95 But it has a "1" after it. don't know why? You can query the ISY using rest http://192.168.1.9/rest/nodes/ And it will list everything and the node. Your web browser will replace the space in the address with %20, so no need to do that. Now, the tough part will be figuring out how to get Ubi to put you user/password in. I can't help you on that.
Xathros Posted December 13, 2013 Posted December 13, 2013 Thanks apostolakisl. I missed that when it typed out the first one then copy/pasted the error to the rest :\ I included the %20's not knowing what the Ubi command entry field would do with a space and figured this would be safer. But yes, in a browser, - not needed. Also should mention that any Insteon address that have a leading zero in an address segment, you would leave out the zero: 11.0F.33 1 = 11%20F%2033%20%201 = 11 F 33 1 -Xathros
apostolakisl Posted December 13, 2013 Posted December 13, 2013 Thanks apostolakisl. I missed that when it typed out the first one then copy/pasted the error to the rest :\ I included the %20's not knowing what the Ubi command entry field would do with a space and figured this would be safer. But yes, in a browser, - not needed. Also should mention that any Insteon address that have a leading zero in an address segment, you would leave out the zero: 11.0F.33 1 = 11%20F%2033%20%201 = 11 F 33 1 -Xathros Yeah, I would first type it into a browser using spaces and test it. Then you can cut and paste into UBI with the %20 instead of a space letting the browser do the swap out for you. It gives me a headache looking at it with all those %20's.
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Thanks all for your help. I am able to send the REST commands via a browser but haven't had any luck so far using the Ubi. I assume the login is the problem. I did try (http://isyusername:isypassword@/rest/nodes/11%2022%2033/cmd/DON) but on the browser I just get cannot find the URL. I assume the Ubi would have the same problem. If there is a way to logon using REST then a voice command could be set up to do that assuming it would stay logged on and not time out. Any help with the logon would be greatly appreciated. Xathros, I believe they are hoping to ship all the Ubis before the holidays. Thanks again for all the help. Gary
LeeG Posted December 13, 2013 Posted December 13, 2013 The Insteon address in REST must also carry the node number 12 34 56 1
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Thanks Lee I do have that included. It works fine on the browser but not in the Ubi . Nothing appears on the log if I try using the Ubi.
Xathros Posted December 13, 2013 Posted December 13, 2013 Thanks all for your help.I am able to send the REST commands via a browser but haven't had any luck so far using the Ubi. I assume the login is the problem. I did try (http://isyusername:isypassword@/rest/nodes/11%2022%2033/cmd/DON) but on the browser I just get cannot find the URL. I assume the Ubi would have the same problem. If there is a way to logon using REST then a voice command could be set up to do that assuming it would stay logged on and not time out. Any help with the logon would be greatly appreciated. Xathros, I believe they are hoping to ship all the Ubis before the holidays. Thanks again for all the help. Gary Are you able to send the command with the user and pass included from the browser or is that what failed for you? If that is what failed, post the URL you used - replace the user, pass and ip with bogus info but keep the formatting so we can see what might be wrong. If it is the Ubi portal that complained, it may be that it needs to access from outside your network in which case, you will need port forwarding and will want to use https:// instead of http. Even with SSL, I don't like using my user/pass combo embedded in the URL as I think that is sent in the clear before the SSL handshake. My impression and hope has been that the portal would program these commands into the Ubi and they would work on my local network without the portal being involved beyond the initial configuration of the command. Do keep us posted. -Xathros
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Yes the command failed when using the user and password in the browser. This is the command. (http://myusername:mypassword@192.168.20 ... t/nodes/17 F7 F0 1/cmd/DON) I get the message "windows cannot find" What ever I change in the portal is down loaded to the Ubi. So all would be local.
Xathros Posted December 13, 2013 Posted December 13, 2013 Have you changed the default http port 80 to 5010 in the ISY? If so, set that back to 80 and test again without the port specified in the URL. The error "Windows can find..." makes me think it's not interpreting the URL correctly as is. -Xathros
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Ok, set it back to 80 at the browser and I still get the windows message.
KMan Posted December 13, 2013 Posted December 13, 2013 What browser are you using? I get an error when using IE 11, but Chrome works fine.
Xathros Posted December 13, 2013 Posted December 13, 2013 OK So the port 5010 is likely not the problem. You can set that back to the way it was. Lets try a simpler command: http://user:pass@ip:5010/rest/nodes -Xathros
garybixler Posted December 13, 2013 Author Posted December 13, 2013 Good news. I was using the latest IE browser (11) where it didn't work. Tried it on Firefox and it worked fine.
Xathros Posted December 13, 2013 Posted December 13, 2013 What browser are you using? I get an error when using IE 11, but Chrome works fine. Chrome and Firefox work for me but I'm also on a MAC so ... -Xathros
Xathros Posted December 13, 2013 Posted December 13, 2013 Good news.I was using the latest IE browser (11) where it didn't work. Tried it on Firefox and it worked fine. Awesome! Now see if you can get Ubi to use the same command. -Xath
garybixler Posted December 13, 2013 Author Posted December 13, 2013 No luck with Ubi. After giving the command I don't get any response. Maybe it encounters an error.
Xathros Posted December 13, 2013 Posted December 13, 2013 No luck with Ubi. After giving the command I don't get any response. Maybe it encounters an error. Is your ISY set up for remote access? If so, try it with https:// and your external IP:port and see if it works. -Xathros
apostolakisl Posted December 13, 2013 Posted December 13, 2013 IE exploring stopped supporting the username pasword in the url several versions ago. If you can post your rest commands from a browser on the same network as the UBI, I doubt it has anything to do with your ISY or your network. I would put my money on the username password issue. The UBI would have to support that function in the URL and I bet it does not. No doubt there has got to be a way to authenticate your UBI to the ISY, but I don't know what it would be. You would really need to get on a UBI forum to work that out. I don't believe there is a way to turn off ISY's authentication, but if someone knows of a way, it would be worth turning it off temporarily for testing purposes.
garybixler Posted December 13, 2013 Author Posted December 13, 2013 I think the problem my be with the Ubi's Custom Behaviors as none of the other functions work either. My have to wait for an update before trying further. I do hope the user password will work with the Ubi. Thanks for all the effort Gary
Xathros Posted December 13, 2013 Posted December 13, 2013 Happy to help. I recall them saying that the ability to add custom commands was one of the shipping features on the first round. What have you been able to do with it so far? -Xathros
Recommended Posts