Retrieving Isy Variables Into A Tasker Variable - Universal Devices ISY-994i User Manual

Home automation
Hide thumbs Also See for ISY-994i:
Table of Contents

Advertisement

19.1.7

Retrieving ISY Variables into a Tasker variable

This is how to get the content of an ISY variable with Tasker - and store the results in
Tasker Global Variables.
First, setup the 19.1.2
on the same LAN as your ISY - but secure remote access (either directly, or via the ISY
Portal) while away from home.
19.1.8
Master Variable Retrieval Task
First - a master task that will be called by others... I called mine 'ISY-GetStatus-Var'.
• 'Anchor' - 'start_request'
• 'HTTP Get' - Server:Port='%IsyUrl' -
Path='%URLPrefix/rest/vars/get/%par1/%par2' - Continue Task After
Error='Checked' (If direct and self signed cert, check 'Trust Any Certificate')
• 'Wait' - 'Seconds'=2 - If %HTTPR eq -1
• 'Goto' - Type='Action Label' - Label='start_request' - If %HTTPR eq -1
• 'JavaScriptlet' - Paste the 'Code' from the next box...
• 'Return' - Value='%varLastVal' - Stop=Checked
The content of the JavaScriptlet is:
• var parser = new DOMParser();
• var xmlDoc = parser.parseFromString(global('HTTPD'),"text/xml");
• var varHeader = xmlDoc.getElementsByTagName("var")[0];
• setGlobal("varLastType",varHeader.getAttribute("type"));
• setGlobal("varLastID",varHeader.getAttribute("id"));
• setGlobal("varLastSet",xmlDoc.getElementsByTagName("ts")[0].childNodes[0].node
Value);
• setGlobal("varLastVal",xmlDoc.getElementsByTagName("val")[0].childNodes[0].nod
eValue);
• setGlobal("varLastInit",xmlDoc.getElementsByTagName("init")[0].childNodes[0].no
deValue);
19.1.9
Retrieve value using master variable retrieval task
I have a variable I wish to retrieve... 'FR-Temp'. It is a 'State' variable with ID 124.
This is the task you create to get this variable:
• 'Perform Task' Name='ISY-GetStatus-Var' - Parameter 1='2' - Parameter 2='124' -
Return Value Variable='%var_val'
Network Awareness
section. This is so you get nice, fast API access
Page | 521

Advertisement

Table of Contents
loading

Table of Contents