Jump to content

help with CAO tags


ralbright

Recommended Posts

Posted

I just received my CAO tags, I am programming them and associating them around my house. So far, I like them.

 

I am trying to create a program that will call the REST API of the ISY to update variables. But I am getting an error. 

"Updates ISY with new temperature (in F) when change happens (SyntaxError: Missing closing token ')')

 

var isy_ip=<%ISY IP Address%>;
var isy_user = <%ISY username%>;
var isy_password=<%ISY password%>;
var isy_variable=<%ISY Variable%>;
 
var tags = <#tag with temperature sensor_[12|13|21|26|52|72]_N#>;
tags.forEach(
    function (tag) {
        var cur_temp = tag.temperature;
        var cur_temp_f = cur_temp * 9 / 5 + 32;
        var cur_temp_new = Math.round(cur_temp_f * 10);
        KumoApp.httpCall("http://"+isy_user+":"+isy_password+"@"+isy_ip+"rest/vars/set/2/"+isy_variable+"/"+cur_temp_new, "GET");
        };
    );
});
 
 
Can anyone see what I am missing? I know it is likely something simple, but my brain is adjusting to a lot of changes....
 
Thank you.
Posted

See the thread on this. You seem to have eliminated a lot of necessary lines to make this work, but I cannot follow the format of your program on Tapatalk. The lines are scrambled badly with Tapatalk. :(

 

I have no access to my kumoapps code until I get home.

 

Sent from my SGH-I257M using Tapatalk

Posted

 

I just received my CAO tags, I am programming them and associating them around my house. So far, I like them.

 

I am trying to create a program that will call the REST API of the ISY to update variables. But I am getting an error. 

"Updates ISY with new temperature (in F) when change happens (SyntaxError: Missing closing token ')')

 

var isy_ip=<%ISY IP Address%>;
var isy_user = <%ISY username%>;
var isy_password=<%ISY password%>;
var isy_variable=<%ISY Variable%>;
 
var tags = <#tag with temperature sensor_[12|13|21|26|52|72]_N#>;
???
tags.forEach(
    function (tag) {
        var cur_temp = tag.temperature;
        var cur_temp_f = cur_temp * 9 / 5 + 32;
        var cur_temp_new = Math.round(cur_temp_f * 10);
        KumoApp.httpCall("http://"+isy_user+":"+isy_password+"@"+isy_ip+"rest/vars/set/2/"+isy_variable+"/"+cur_temp_new, "GET");
        };
    );
});
 
 
Can anyone see what I am missing? I know it is likely something simple, but my brain is adjusting to a lot of changes....
 
Thank you.

 

Count your parenthesis and match them against each other in pairs.

 

A quick look appears you don't have them matched up with quantity or style.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.3k
×
×
  • Create New...