0
Answered
IR.GetServer doesn't work
Hello,
I want to execute an command when one of my server tags changes, so i tried using IR.GetServer but that doesn't work i get a syntaxerror
here an example:
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetServer(), function(name, value){
if(name == "test" && value == 0)
{
testoff();
}
testoff();
}
else if(name == "test" && value == 1)
{
teston();
}
});
function testoff()
{
IR.GetDevice("KNX").Set("address1", 0);
IR.GetDevice("KNX").Set("address1", 0);
}
function teston()
{
IR.GetDevice("KNX").Set("address1", 1);
IR.GetDevice("KNX").Set("address1", 1);
}
does anyone know whats wrong here, or maybe another solution?
Thanks,
Marco
Customer support service by UserEcho
Hi
http://dev.iridiummobile.net/Systems_API/en#IR.EVENT_GLOBAL_TAG_CHANGE
I tend to use Global_Tag_Change in the client, for example
If you see the error like this:
it means that you try to use IR.GetServer() method in i3 pro app. This method can be used only on Server side.
For the Client side you have to use IR.GetDevice("iRidium Server") method.
If you see another error please share more details.
I run the script on iridium server.
This is the error i get in the server log screen:
WARNING SCRIPT Script exception: SyntaxError: C:\users\...\test.js:1:
I don't see any errors when start your script on iRIdium server in empty project.
Please send your own project with error, please tell the version of Server you use
"SyntaxError" doesn't mean that some IR. method doesn't work. It means there is some syntax error (ha-ha). Like you lost some comma or bracket. Pls check it again
I will check extra tonight, if i still got the error i will send you the project. How can i send it to you?
Yesterday i tried to replace the getserver for a getdevice to a knx object and than the same script did work.
please send your projects and questions to support team to support@iridiummobile.ru
Done, thanks
When i got the errors last night i tested the server by downloading my server project from iridium cloud.
Now i tried it in test mode trough file transfer.
Now i don't get the error in the server log, but the script still doesn't work.
I made a simple project with one script for testing, i will upload it here. Can you tell me if i did anything wrong in this project?
Thanks
testserver.sirpz
testpanel.irpz