ldrinc Posted December 13, 2013 Posted December 13, 2013 I am trying to use a program to watch for events in order to trigger a program. Is there a way to have this program subscribe to my ISY for events?
Michel Kohanim Posted December 13, 2013 Posted December 13, 2013 Hi ldrinc, What kind of program are you specifically referring to? You can always use our Web Services APIs to subscribe to ISY: http://www.universal-devices.com/isy-developers . With kind regards, Michel
ldrinc Posted December 13, 2013 Author Posted December 13, 2013 Michel, I am using a voice control software by the name of VoxCommando. Currently, I have it executing programs and commands in my ISY nicely. I'd like to have the VoxCommando software monitor events that take place in the isy such as when a motion detector is triggered so that it will speak to me when it does.
Michel Kohanim Posted December 14, 2013 Posted December 14, 2013 Hi ldrinc, Then you should be able to subscribe to ISY as long as you keep either a socket open or a URL to which ISY can publish its events. With kind regards, Michel
ImranChaudhry Posted September 29, 2014 Posted September 29, 2014 Michael Can you please elaborate upon. "or a URL to which ISY can publish its events." I am a C# web developer and I think that is the route that will work the best for me. But I cant seem to figure out how to go about it. Your help is greatly appreciated. Thanks Imran
Michel Kohanim Posted September 29, 2014 Posted September 29, 2014 Hi Imran, All you need to do is to create an http listening socket(or configure a web server) and then put the URL to the web server/socket in element. From thereon, ISY will publish events to your server/socket. With kind regards, Michel
LuisM Posted March 4, 2016 Posted March 4, 2016 Sorry to bring up an old conversation, but I'm trying to do what is described in this post. Unfortunately, I'm new to configuring something like this (I primarily deal with large scale computing systems; nothing quite this small). I've configured a Raspberry Pi as a LAMP web server and will use Python and MySQL to watch for conditions and trigger REST entries. I've figured out how to poll the ISY for data using http, but would like to subscribe to it with an open web socket (on the RPi) to avoid abusing the connection and protocol. I've read through various sections of the WS-SDK (including 9.0 Web Sockets and Subscriptions), pieces and parts of RFC 6455 and still don't have a clear picture on how to proceed in making the subscription. Do you have more explicit instructions available (for a newbie), and/or recommended reading where I can learn more detail on what I'm trying to do? I recognize there's quite a learning curve; even after I figure out how to subscribe the RPi to the ISY - I still need to figure out where the acquired data goes and how to get it into MySQL (let alone use Python to query and organize then PHP to present the data...). Thanks. Luis
MWareman Posted March 4, 2016 Posted March 4, 2016 (edited) Have you seen my Javascript Websocket example at http://forum.universal-devices.com/topic/15248-problems-creating-a-websocket-connection/page-2?do=findComment&comment=150499 ? Granted - it runs in a browser - but I suspect you could modify it to subscribe to events for other use cases. (This is an example page designed to be served directly from ISY.... and the JS executed from the connected browser. This is because of the authorization header and security requirements of WebSockets. In a non-browser implementation - the var ws_host = "wss://" + isy_host would likely have to be changed to var ws_host = "wss://username:password@" + isy_host Michael. Edited March 4, 2016 by MWareman
Jimbo.Automates Posted March 4, 2016 Posted March 4, 2016 Sorry to bring up an old conversation, but I'm trying to do what is described in this post. Unfortunately, I'm new to configuring something like this (I primarily deal with large scale computing systems; nothing quite this small). I've configured a Raspberry Pi as a LAMP web server and will use Python and MySQL to watch for conditions and trigger REST entries. I've figured out how to poll the ISY for data using http, but would like to subscribe to it with an open web socket (on the RPi) to avoid abusing the connection and protocol. I've read through various sections of the WS-SDK (including 9.0 Web Sockets and Subscriptions), pieces and parts of RFC 6455 and still don't have a clear picture on how to proceed in making the subscription. Do you have more explicit instructions available (for a newbie), and/or recommended reading where I can learn more detail on what I'm trying to do? I recognize there's quite a learning curve; even after I figure out how to subscribe the RPi to the ISY - I still need to figure out where the acquired data goes and how to get it into MySQL (let alone use Python to query and organize then PHP to present the data...). Thanks. Luis There are already 2 python libraries available that handle this.https://github.com/evilpete/ISYlib-python https://github.com/automicus/PyISY Sent from my Pixel C using Tapatalk
LuisM Posted March 4, 2016 Posted March 4, 2016 Michael, No, I hadn't. I searched for "subscribe" and trolled various pages and hadn't come across that. Thanks. I'll take a closer look and consider how that fits in to my set up over the next few days. Jimbo, sounds great. I found those libraries before, but couldn't tell (or know) where to look for the websocket and/or subscription file(s). I presume I'm looking in the ISY folder at /ISYlib-python. To subscribe, am I looking for IsyEvent.py, IsyEventData.py, the Bin folder has isy_showevents.py, other? I saw IsyDiscover.py which is part of the equation. Wow. Thank you both. Luis
Jimbo.Automates Posted March 4, 2016 Posted March 4, 2016 Sorry I have n used ISYlib-python, I have only used PyISY in my ISYHelper program. But I have to say I am not completely happy with the way PyISY organizes the data structures, but it works great for me, after I pushed a few bug fixes and enhancements. It's document is pretty good to get you started, and I think I still have a couple small scripts I wrote as examples when I was learning it that I can dig up for you. Sent from my Nexus 6P using Tapatalk
Recommended Posts