MarkJames Posted June 27, 2016 Posted June 27, 2016 I've got a custom page designed to display the status of all the El;k zones, keypads, and areas in my house. There's about 45 total items to display. I'm using the REST interface to call /rest/elk/get/status and then parsing the xml to update all my html elements. I haven't found a way to specifically query an individual zone/area/keypad - all I've found is all or nothing. The REST call returns the status of, from what I can tell, everything known to the Elk - including the default 208 outputs. Anyways - it happens right quick and to give the appearance of 'real time' monitoring I've been updating the status of my html every few seconds - basically changing the color/text of a series of buttons according to their corresponding zone state - Violated, Normal, Bypass My question is at what point will the ISY start seeing degraded performance because of the frequent REST calls? Is there a recommended minimum interval between calls? Will frequent REST calls slow program flow/trigger? Thanks, mark
Michel Kohanim Posted June 27, 2016 Posted June 27, 2016 Hi Mark, Since ISY is event driven, then as long as the rest commands do NOT require underlying queries (such as get topology, set zone, etc.) then you can do it as frequently as you wish (even 1 second) since the only thing being returned is the value at that moment. This said, a better approach would be to subscriptions. If you use JavaScript, you can use websockets to subscribe to ISY and thus you won't have to poll it at all. All changes are automatically published to you. With kind regards, Michel
MarkJames Posted June 27, 2016 Author Posted June 27, 2016 (edited) Thanks Michel, I've been learning javascript for the sole purpose of creating this page. I wasn't aware that subscribing/websockets was even an option. I'll see if I can find some more info about or some sample code in the wiki. mark Edited June 27, 2016 by MarkJames
MWareman Posted June 27, 2016 Posted June 27, 2016 (edited) Thanks Michel, I've been learning javascript for the sole purpose of creating this page. I wasn't aware that subscribing/websockets was even an option. I'll see if I can find some more info about or some sample code in the wiki. mark I provided an example that's certainly on here somewhere, and may even be on the Wiki already.... Edit: see here: http://forum.universal-devices.com/index.php?/topic/15248-Problems-Creating-a-WebSocket-connection Michael. Edited June 27, 2016 by MWareman
MarkJames Posted June 27, 2016 Author Posted June 27, 2016 (edited) Thanks Michael! I'd found the repository on github with a full implementation but it was for a test server and had little documentation with it - I think it was for more advanced programmers than myself. This is more my speed. Out of curiosity - before I rewrite chunks of code - is websockets compatible across most browsers? I've got a raspberry pi 3 hosting my site and it's not bothered by the constant polling. If the ISY isn't hurt by it either then I'm inclined to leave it the way it is if websockets might cause me some browser compatibility issues. mark Edited June 27, 2016 by MarkJames
MWareman Posted June 28, 2016 Posted June 28, 2016 (edited) We got it working across chrome, Firefox and IE, with Chrome on Android and Safari on IOS. I have not looked at others. It does require a recent build of ISY though - there were fixes made to make it work (detailed in the thread I referenced). A Websocket connection is far more network and battery efficient that polling... Michael. Edited June 28, 2016 by MWareman
Michel Kohanim Posted June 28, 2016 Posted June 28, 2016 Hi Michael, Thanks so very much! Hi Mark, you need 4.4.6 or higher. With kind regards, Michel
danbutter Posted July 4, 2016 Posted July 4, 2016 Would this method work to get the status of a nodelink node? I have several doors on my dsc alarm that only the admin console can tell me the status of.
MarkJames Posted July 4, 2016 Author Posted July 4, 2016 (edited) Does ISY show a message in the admin console event viewer when your dsc alarm changes? Those messages all seem to go via the infostring element to the websocket interface. So far as I can tell all node changes go to the websocket interface. There's documentation for it in the UDI developer area here https://www.universal-devices.com/isy-developers/ mark Edited July 4, 2016 by MarkJames
danbutter Posted July 4, 2016 Posted July 4, 2016 Yes it does in the admin console. That is the only place though. So I'm looking into something like this perhaps in conjuction with HAD to be able to have a webpage to see the status of things around the house. Only downside is that I'm not a programmer so it will take a lot of learning. I'll start looking into it. Thanks for the reply.
paulbates Posted July 4, 2016 Posted July 4, 2016 (edited) Would this method work to get the status of a nodelink node? I have several doors on my dsc alarm that only the admin console can tell me the status of. Dan Node device status can be copied to variables, and variables can displayed in had. That's how I kept my HAD status pages working when transitioning from venlink to Nodelink. Paul Edited July 4, 2016 by paulbates
MarkJames Posted July 4, 2016 Author Posted July 4, 2016 Yes it does in the admin console. That is the only place though. So I'm looking into something like this perhaps in conjuction with HAD to be able to have a webpage to see the status of things around the house. Only downside is that I'm not a programmer so it will take a lot of learning. I'll start looking into it. Thanks for the reply. That's exactly what I'm doing at the moment. I think that in the next week or so it should be where I'm content with it. If you're still looking for a solution I can link you to what I've done and if you want to use it you're welcome to the source. I'm not a programmer either but used to be - it's not too hard. The code I've written is simple enough to change - just change the addresses of the nodes, the names of the devices, and the id's of the web elements and it takes care of itself. mark
danbutter Posted July 4, 2016 Posted July 4, 2016 Dan Node device status can be copied to variables, and variables can displayed in had. That's how I kept my HAD status pages working when transitioning from venlink to Nodelink. Paul I'll take a look at this. Thanks for posting.
danbutter Posted July 4, 2016 Posted July 4, 2016 That's exactly what I'm doing at the moment. I think that in the next week or so it should be where I'm content with it. If you're still looking for a solution I can link you to what I've done and if you want to use it you're welcome to the source. I'm not a programmer either but used to be - it's not too hard. The code I've written is simple enough to change - just change the addresses of the nodes, the names of the devices, and the id's of the web elements and it takes care of itself. mark Good deal. I would love to see what you're doing when you get time. Thanks for offering.
Recommended Posts