- Reference
- Drivers
iRidi API. Drivers
Functions, methods, and properties for working with equipment configured in the project: creating and managing drivers, sending commands, and processing incoming data
Methods
IR is a global object containing all iRidi API functions and constants. Its driver methods let you create a driver and access a driver in an iRidi project. Many methods operate on a reference to an existing driver.
You can enter a driver, command, feedback, or token reference manually, or obtain it by dragging the item into the JS editor (see instructions.
IR.CreateDevice
Create a driver in the iRidi project. Only AV & Custom Systems drivers can be created this way. Other drivers must first be added to the project from the database. Attention! In iRidium V2, this function used a different syntax. iRidi V3 supports the old syntax, but its use is not recommended.
Syntax
IR.CreateDevice(type, name, {properties})
| Input | Value | Description |
|---|---|---|
| type | IR.DEVICE_CUSTOM_TCP | type: object driver type |
| name | "AV Driver 1" | type: string unique driver name |
| properties | Host: '192.168.0.47', Port: 80 | type: array comma-separated driver parameters |
| Output | ||
|---|---|---|
| Object | [object DevicePrototype] | type: object reference to the driver as an object |
Example
IR.AddListener(IR.EVENT_START,0,function() {
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_TCP, "AV Device (TCP)",
{Host: "192.168.0.47",
Port: 80,
SSL: false,
SendMode: IR.ALWAYS_CONNECTED,
ScriptMode: IR.DIRECT_AND_SCRIPT,
SendCommandAttempts: 0,
ConnectWaitTimeMax: 3000,
ReceiveWaitTimeMax: 5000,
Login: "admin",
Password: "admin"
});
IR.Log(driver); // [object DevicePrototype]
});
Notes
- the set of parameters differs between drivers
- if a parameter is omitted, its default value is used (for example, you can specify only Host and Port when creating a driver)
- the driver will not be created if you attempt to create it before the application startup event IR.EVENT_START.
- if you create a driver after application startup rather than on IR.EVENT_START, you must call .Connect() for that driver to connect to the equipment. Drivers created at application startup connect automatically. If necessary, they can be disconnected using .Disconnect().
- creating a driver takes some time, so data cannot be sent through it during the first few milliseconds; send data on IR.EVENT_ONLINE.
AV & Custom Systems parameters
AV & Custom Systems (TCP):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_TCP, "AV Device (TCP)",
{Host: "192.168.0.47",
Port: 80,
SSL: false,
SendMode: IR.ALWAYS_CONNECTED,
ScriptMode: IR.DIRECT_AND_SCRIPT,
SendCommandAttempts: 0,
ConnectWaitTimeMax: 3000,
ReceiveWaitTimeMax: 5000,
Login: "",
Password: "",
DisableQueue: false
});
AV & Custom Systems (UDP):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_UDP, "AV Device (UDP)",
{Host: "192.168.0.47",
Port: 80,
LocalPort: 80, // port on iRidium side for data receiving
Group: null, // null - broadcast, "host" - multicast group
Multicast: false, // false - broadcast, true - multicast (if multicast group added)
ScriptMode: IR.DIRECT_AND_SCRIPT
});
AV & Custom Systems (HTTP):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_HTTP_TCP, "AV Device (HTTP)",
{Host: "192.168.0.47",
Port: 8080,
SSL: false,
Login: "",
Password: "",
DisableQueue: false,
SendCommandAttempts: 0,
ConnectWaitTimeMax: 3000,
ReceiveWaitTimeMax: 5000,
UserAgent: ""
});
AV & Custom Systems (RS232):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_SERIAL, "AV Device (RS232)",
{PortName: "\\\\.\\COM1", // double slash "\\" will be converted
// to single slash "\". Result: "\\.\COM1"
BaudRate: 9600,
DataBits: 8,
Parity: 0,
StopBits: 0,
Use485: false // works with RS485, not RS232
});
AV & Custom Systems (TCP Server):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_SERVER_TCP, "iRidium TCP Server",
{Port: 2323,
MaxClients: 10 // maximum of clients connected at the same time
});
To create a server with SSL, enable SSL after creating the driver using SetParameters
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_SERVER_TCP, "iRidium TCP Server",
{Port: 2323,
MaxClients: 10 // maximum of clients connected at the same time
});
driver.SetParameters({SSL:3});
A server with SSL can run only on iRidi Server
AV & Custom Systems (UDP Server):
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_SERVER_UDP, "iRidium UDP Server",
{Port: 2323,
MaxClients: 10, // maximum of clients connected at the same time
ClientTimeOut: 100 // (ms) when the Client will be disconnected if it doesn't send data
});
Constants in driver settings
Send Mode
- IR.ALWAYS_CONNECTED = 0; - the driver remains connected and can receive and send data.
- IR.CONNECT_WHEN_SENDING = 1; - the driver connects when sending, then disconnects; it can only send data.
Script Mode
- IR.DIRECT_AND_SCRIPT = 0; // Commands can be sent through scripts and through editor channels
- IR.SCRIPT_ONLY = 1; // Commands can be sent only through scripts
Background Mode
- IR.BACKGROUND_OFF = 0; // The driver runs only while the application is in the foreground
- IR.BACKGROUND_ON = 1; // The driver runs while the application is in either the foreground or background
IR.GetDevice
Access any driver in the iRidi project. Works with all drivers, not only those created using IR.CreateDevice.
Syntax
IR.GetDevice(name)
| Input | Value | Description |
|---|---|---|
| name | "Driver 1" | type: string driver name in the iRidi project |
| Output | ||
|---|---|---|
| Object | [object DevicePrototype] | type: Object driver reference |
Example
var myDriver = IR.GetDevice("AMX");
var myDriver1 = IR.GetDevice("HDL-BUS Pro Network (UDP)");
IR.Log(myDriver); // [object DevicePrototype]
IR.Log(myDriver1); // [object DevicePrototype]
Notes
HDL, Domintell: use the network name "HDL-BUS Pro Network (UDP)" / "Domintell Network (UDP)", not the name of an individual device on the network.
The following methods can be applied to a driver reference obtained using IR.GetDevice.
.Connect
Establish a connection to the equipment
Syntax
IR.GetDevice(name).Connect()
| Input | Value | Description |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("AV & Custom Systems (TCP)").Connect();
Notes
a connection is established automatically after the driver is created
.Disconnect
Disconnect from the equipment
Syntax
IR.GetDevice(name).Disconnect()
| Input | Value | Description |
|---|---|---|
| name | "Driver 1" | type: string driver name in the iRidi project |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("AV & Custom Systems (TCP)").Disconnect();
.Send
This method works only with AV & Custom Systems and Global Cache drivers. It sends an arbitrary set of data (string, number, array) to the equipment
Syntax
IR.GetDevice(name).Send([data])IR.GetDevice(name).Send(array)IR.GetDevice("Global Cache").Send([data], transport)
| Input | Value | Description |
|---|---|---|
| name | "Driver 1" | type: string driver name in the iRidi project |
| data | a, b, c | type: string list of variables or strings: instructions to send |
| array | [a, b, c] | type: array array of variables or strings: instructions to send |
| transport | 0 | type: number transport identifier. Used with Global Cache to send data to a specific destination: * 0 - port 4998 (IR commands, relays, sensors, system) * 1 - port 4999 (COM 1) * 2 - port 5000 (COM 2) Also used on iRidi Server and in the Custom TCP Server driver. Selects which connected client receives the data: 0 - all, 1..n (client ID received in IR.ACCEPT_CLIENT) - a specific connected client |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
// AV & Custom Systems (TCP, UDP, RS232)
IR.GetDevice("AV Device").Send(['instruction', '\r\n']);
// AV & Custom Systems (HTTP)
// <Type or request>,<URI>,<Data> devided by "," so u cannot use "," inside of <URI> and <Data>
IR.GetDevice("AV Device").Send(['GET,URI']); // GET
IR.GetDevice("AV Device").Send(['POST,URI,Data']); // POST
IR.GetDevice("AV Device").Send(['PUT,URI,Data']); // PUT
// Global Cache:
// IR.GetDevice("Global Cache").Send(<DATA>, <TRANSPORT ID>)
IR.GetDevice("Global Cache").Send(['setstate,1:1,1', '\r\n'], 0)
// iRidium Server:
// IR.GetServer().Send(<DATA>, <TRANSPORT ID>)
IR.GetServer().Send(['command', '\r\n'], 1)
Notes
HTTP: when sending a command to an HTTP driver, begin with the request method: GET, POST, PUT, followed by a comma and the command URI, then Data for POST and PUT. Commas cannot be used within URI or Data. If your protocol uses commas in HTTP commands, send them through AV & Custom Systems (TCP), constructing complete requests. Global Cache: always specify the transport ID to which the data should be sent
.SendEx
This method works only with AV & Custom Systems (HTTP) drivers. It sends an array of data to the equipment with a reference to the parent object (execution context). SendEx can include events that pass information about their operation to functions. These events let you monitor data received from the HTTP server and process the various stages of interaction with it.
Syntax
IR.GetDevice(name).SendEx(params, context)
| Input | Value | Description |
|---|---|---|
| name | "Driver 1" | type: string driver name in the iRidi project |
| params | {a, b, c} | type: object parameters to send |
| context | this | type: object object (this) for the function call |
| Output | ||
|---|---|---|
| - |
Example
//Example 1:
var context = {
appleCount: 10,
key: 777,
}
var params = {
Type: "POST",
Url: "/html/login",
Data: ["Password=2007&name=authform&Login=admin"],
Headers: {"Content-Type": "application/x-www-form-urlencoded"},
cbReceiveText: function(text, code, headers) {IR.Log("cbReceiveText "+text+code+headers); IR.Log(this.key)},
cbReceiveData: function(data, code, headers) {IR.Log("cbReceiveData "+data+code+headers);},
cbReceiveCode: function(code) {IR.Log("cbReceiveCode "+code);},
cbReceiveKey: function(key,value) {IR.Log("cbReceiveKey "+key+value);},
cbReceiveStartBody: function(stream) {IR.Log("cbReceiveStartBody "+stream);},
cbReceivePartBody: function(stream) {IR.Log("cbReceivePartBody "+stream);},
cbReceiveEndBody: function(size) {IR.Log("cbReceiveEndBody "+size);},
cbTimeOut: function() {IR.Log("cbTimeOut");},
cbReceiveStream: function(stream, code, headers) {IR.Log("cbReceiveStream "+stream+code+headers);}
}
IR.GetDevice("Server REST").SendEx(params, context)
//Example 2:
IR.GetDevice("Server REST").SendEx({
Type: "GET",
Url: "/json/ok/server/channel",
Headers: {"Cookie":"ir-session-id=o8lKdEvw2ZlU"},
cbReceiveText: function(text, code, headers) {IR.Log("cbReceiveText "+text);}
});
Params
The parameters to send are specified using the following variables:
| Parameter | Value | Description |
|---|---|---|
| Type | "GET" / "POST" / "PUT" | Request type. |
| Url | "/html/login" | Path to the requested object. |
| Data | ["Password=2007&name=authform&Login=admin"] | Additional parameter available for POST and PUT requests. |
| Header | {"Cookie":"ir-session-id=o8lKdEvw2ZlU"} | Create standard and custom HTTP request headers. |
| cbReceiveData | cbReceiveData: function(data, code, headers){IR.Log("Получение данных в формате Data: Code ответа от сервера: " + code + " Данные: "+ data);} | DATA receive handler, with parameters: data - data, code - server response, headers - headers. |
| cbRecieveText | cbReceiveText: function(text, code, headers){IR.Log("Получение данных в формате Text: \n Code ответа от сервера: " +code + "\n Данные: " + text + "\n Заголовки: " + headers);} | TEXT receive handler, with parameters: data - data, code - server response, headers - headers. |
| cbRecieveKey | cbReceiveKey: function(key, value){IR.Log("Заголовки : "+ key + "\n Значение заголовков: "+ value);}, | Header handler, with parameters: key - header, value - header value. |
| cbReceiveCode | cbReceiveCode: function(code) {IR.Log("Code ответа от сервера: "+code);}, | Server response handler, with parameter: code - server response. |
| cbRecieveStartBody | cbReceiveStartBody: function(){} | Function called when stream processing starts. |
| cbRecievePartBody | cbReceivePartBody: function(stream) {IR.Log("Получение данных в формате ByteStream(Обьект данных): "+stream);}, | Function for processing and receiving the stream body. |
| cbRecieveEndBody | cbReceiveEndBody: function(size) {IR.Log("Размер полученого потока (Stream): "+size);} , | Function called when stream processing ends. |
| cbTimeOut | cbTimeOut: function() {IR.Log("cbTimeOut: TimeOut")}, | Handler for a server response timeout. |
| cbRecieveStream | cbReceiveStream: function(stream, code, headers) { IR.Log("Получение данных в формате ByteStream: \n Code ответа от сервера: " +code + "\n Обьект данных: " + stream); } | Stream handler. |
The Headers: field of SendEx() lets you set standard and custom HTTP request headers. Some standard headers and their behavior in SendEx() are described below.
| Header | Default value or example | Description | Can be set (overridden) in Header | How to set (override) |
|---|---|---|---|---|
| Host | 192.168.0.100:123 | Host domain name and port of the requested resource | no | In the Host and Port parameters of the AV & Custom Systems (HTTP) driver |
| Connection | Keep-Alive or close | HTTP connection method | no | Determined by KeepAliveOut passed to SendEx(): if KeepAliveOut = 0, the "Connection: close" header is sent; if KeepAliveOut > 0, the "Connection: Keep-Alive" header is sent |
| Transfer-Encoding | chunked | Self-determined request content length | no | Not set; see Content-Length |
| Content-Length | 0 | Request content length | no | Not set; calculated automatically from the request content |
| Authorization | - | Authorization data | no | In the Login and Password parameters of the AV & Custom Systems (HTTP) driver. Calculated automatically (Basic Authorization) |
| Content-Type | application/x-www-form-urlencoded | Request content type | Yes | - |
| Accept | / | List of acceptable resource formats | Yes | - |
| User-Agent | iRidi Server/x.x.x | List of client and component names and versions, with comments | Yes | In the User-Agent parameter of the AV & Custom Systems (HTTP) driver |
An example Header block is shown below:
IR.GetDevice("AV & Custom Systems (HTTP)").SendEx({
Type: "GET",
Url: "/device/http",
Headers: {
"Content-Type": "application/json",
"Accept": "application/xml",
"User-Agent": "Project Server v2.0",
"Accept-Language": "en",
"Set-Cookie": "parameter=1",
},
KeepAliveOut: 0; // used for "Connection: close" header
cbReceiveText: function(text, code, headers) {IR.Log("Header: "+headers);}
});
See the attached project for an implementation of this method in a driver:
download:
.Set
Execute a native driver command configured beforehand in the editor's command tree. You pass a value to the command just as when pressing a button in the interface. Works only with native drivers. A command can be activated by index (its position in the tree, starting at one) or by name. A command cannot be executed if it is not configured in the project tree.
Syntax
IR.GetDevice(driver).Set(command, value)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| command | "Channel 1" | type: string command index or name, position in the tree starting at 1, number |
| value | 100 | type: string number or string to pass to the command for sending to the equipment, number |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
//KNX. 1 - first Commands in project Tree; 100 - value to send, "Dimming" - command name
IR.GetDevice("KNX Router (KNXnet/IP)").Set(1, 100);
IR.GetDevice("KNX Router (KNXnet/IP)").Set("Dimming", 100);
//Global Cahe. "Command 1" - name of command on GC output, "" - empty data
IR.GetDevice("Global Cache").Set("Command 1", "")
//HDL. "HDL-BUS Pro Network (UDP)" - name of network
//"Dimmer" - name of Device in Network, "Channel 1" - name of Channel, 100 - value to send
IR.GetDevice("HDL-BUS Pro Network (UDP)").Set("Dimmer:Channel 1", 100);
//Domintell. "Domintell Network (UDP)" - name of network
//"DDIM01" - name of Device in Network, "Channel 1" - name of Channel, 100 - value to send
IR.GetDevice("Domintell Network (UDP)").Set("DDIM01:Channel 1", 100);
//Set data to virtual tag in iRidium Server project
IR.GetDevice("iRidium server").Set("Virtual 1", 100);
//Set data to channel in iRidium Server project
IR.GetDevice("iRidium Server").Set("KNX Router.Address 1", 1);
Notes
HDL, Domintell: use the network name "HDL-BUS Pro Network (UDP)" / "Domintell Network (UDP)", not the name of an individual device on the network.
.SetFeedback
Write a value to a driver feedback channel. The channel must already exist in Project Device Panel. Used to display equipment data received by scripts.
Syntax
IR.GetDevice(driver).SetFeedback(name, value)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| name | "Channel 1" | type: string feedback channel name (Feedbacks) |
| value | "data" | type: string string or number to write to the channel, number |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("MyDevice").SetFeedback("Value 1", 100);
.GetFeedback
Read a value from a driver feedback channel. The channel must already exist in Project Device Panel. Used to access data previously written to the channel.
Syntax
IR.GetDevice(driver).GetFeedback(name)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| name | "Channel 1" | type: string feedback channel name (Feedbacks) |
| Output | ||
|---|---|---|
| value | "data" | type: string, number string or number read from the feedback channel |
Example
IR.GetDevice("MyDevice").GetFeedback("Value 1"); // 100
.SetParameters
Change the specified driver connection parameters for the controlled equipment. A typical example is switching between local and internet connections. Parameters can be changed selectively. The new connection settings do not change the driver's original parameters and are not retained when the application restarts. Every TCP, UDP, or HTTP driver has the standard parameters Host, Port, Login, Password (even if the driver does not use a login and password), as well as parameters specific to its type.
Syntax
IR.GetDevice(driver).SetParameters({Host: host, Port: port, <other>});
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| host | "192.168.0.100" | type: string IP address or domain name for connecting to the equipment |
| port | 8080 | type: number connection port |
| LogLevel | 4 | type: number Log level. LogLevel |
| other | type: - |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("KNX").SetParameters({Host: "215.110.10.22", Port: 8080});
Notes
Current settings are available as Properties of the driver
.GetCookies
Get the Cookies array through the AV & Custom Systems (HTTP) driver
Syntax
IR.GetDevice(driver).GetCookies()
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string HTTP driver name in the iRidi project |
| Output | ||
|---|---|---|
| array | type: array Cookies array |
Example
var num = IR.GetDevice("MyDevice").GetCookies()
.SetCookie
Send a Cookie with the other header information through the AV & Custom Systems (HTTP) driver
Syntax
IR.GetDevice(driver).SetCookie(key, value)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string HTTP driver name in the iRidi project |
| key | type: string key | |
| value | type: string value |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("MyDevice").SetCookie("TestCookie", "value")
.GetLogin
Get the connection login for any driver
Syntax
IR.GetDevice(driver).GetLogin()
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name |
| Output | ||
|---|---|---|
| login | 'admin' | type: string driver login |
Example
var login = IR.GetDevice("MyDevice").GetLogin()
IR.Log(login) // admin
.GetPassword
Get the connection password for any driver
Syntax
IR.GetDevice(driver).GetPassword()
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name |
| Output | ||
|---|---|---|
| login | 'admin' | type: string driver password |
Example
var pass = IR.GetDevice("MyDevice").GetPassword()
IR.Log(pass) // password
.AddChannel
function under development Add a channel to the driver
Syntax
IR.GetDevice(driver).AddChannel(name, data)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name |
| name | "Channel 1" | type: string command name |
| data | type: array driver-specific data array |
| Output | ||
|---|---|---|
| - |
Example
/* under development */
.AddTag
function under development Add a feedback channel to the driver
Syntax
IR.GetDevice(driver).AddTag(name, data)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name |
| name | "Channel 1" | type: string feedback channel name |
| data | type: array driver-specific data array |
| Output | ||
|---|---|---|
| - |
Example
/* under development */
.AddRelation
Create a Relation: a link between interface objects and drivers / variables / other objects.
Syntax
IR.AddRelation(source, destination)
| Input | Value | Description |
|---|---|---|
| source | "Drivers.iRidium Server.Tags.KNX.1/0/1" | type: string data source |
| destination | "UI.Popup 1.Item 1.Value" | type: string data destination |
| Output | ||
|---|---|---|
| - |
Example
var from = "Drivers.iRidium Server.Tags.KNX.1/0/1";
var to = "UI.Popup 1.Item 1.Value";
IR.AddRelation(from, to);
.RemoveRelation
Remove a Relation: a link between interface objects and drivers / variables / other objects.
Syntax
IR.RemoveRelation(source, destination)
| Input | Value | Description |
|---|---|---|
| source | "Drivers.iRidium Server.Tags.KNX.1/0/1" | type: string data source |
| destination | "UI.Popup 1.Item 1.Value" | type: string data destination |
| Output | ||
|---|---|---|
| - |
Example
var from = "Drivers.iRidium Server.Tags.KNX.1/0/1";
var to = "UI.Popup 1.Item 1.Value";
IR.RemoveRelation(from, to);
.GetCommandsCount
Get the number of commands configured in the driver
Syntax
IR.GetDevice(driver).GetCommandsCount()
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| Output | ||
|---|---|---|
| CommandsCount | 52 | type: number number of device commands |
Example
var num = IR.GetDevice("MyDevice").GetCommandsCount();
IR.Log(num); // number of commands
.GetCommandAtName
Get data from the Data field of a driver command. The command is accessed by name.
Syntax
IR.GetDevice(driver).GetCommandAtName(name)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| name | "Command 1" | type: string command name |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the driver command |
| object.id | 1 | type: number object property: numeric command identifier (starting at 1) |
| object.name | Command 1 | type: string object property: command name |
| object.data | 74,65,73,74 | type: array object property: command Data field contents as a byte array |
Example
var Command = IR.GetDevice("AV").GetCommandAtName("Command 1");
IR.Log("id: " + Command.id + ", name: " + Command.name + ", data: " + Command.data);
// id: 1, name: Command 1, data: 74,65,73,74
.GetCommandAtPos
Get data from the Data field of an AV & Custom System (HTTP, TCP, UDP, RS232) driver command. The command is accessed by its position, starting at 0.
Syntax
IR.GetDevice(driver).GetCommandAtPos(position)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| position | 0 | type: number command position (starting at 0) |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the driver command |
| object.id | 1 | type: number object property: numeric command identifier (starting at 1) |
| object.name | Command 1 | type: string object property: command name |
| object.data | 74,65,73,74 | type: array object property: command Data field contents as a byte array |
Example
var Command = IR.GetDevice("AV").GetCommandAtPos(0);
IR.Log("id: " + Command.id + ", name: " + Command.name + ", data: " + Command.data);
// id: 1, name: Command 1, data: 74,65,73,74
.GetFeedbacksCount
Get the number of feedback channels configured in the AV & Custom System (HTTP, TCP, UDP, RS232) driver
Syntax
IR.GetDevice(driver).GetFeedbacksCount()
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| Output | ||
|---|---|---|
| FeedbacksCount | 52 | type: number number of device channels |
Example
var num = IR.GetDevice("MyDevice").GetFeedbacksCount();
IR.Log(num); // number of feedbacks
.GetFeedbackAtName
Get data from the Data field of a driver feedback channel. The feedback channel is accessed by name or identifier.
Syntax
IR.GetDevice(driver).GetFeedbackAtName(name/ID)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| name/ID | "Feedback 1" | type: string channel name / channel identifier/number |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the feedback channel object |
| object.id | 1 | type: number object property: numeric channel identifier (starting at 1) |
| object.name | Command 1 | type: string object property: channel name |
| object.data | 74,65,73,74 | type: array object property: channel Data field contents as a byte array |
Example
var Feedback = IR.GetDevice("AV & Custom System (TCP)").GetFeedbackAtName("Feedback 1");
IR.Log("id: " + Feedback.id + ", name: " + Feedback.name + ", data: " + Feedback.data);
// id: 1, name: Feedback 1, data: 74,65,73,74
.GetFeedbackAtPos
Get data from the Data field of an AV & Custom System (HTTP, TCP, UDP, RS232) driver feedback channel. The command is accessed by its position, starting at 0. Syntax
IR.GetDevice(driver).GetFeedbackAtPos(position)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| position | 0 | type: number channel position (starting at 0) |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the driver channel |
| object.id | 1 | type: number object property: numeric channel identifier (starting at 1) |
| object.name | Command 1 | type: string object property: channel name |
| object.data | 74,65,73,74 | type: array object property: channel Data field contents as a byte array |
Example
var Feedback = IR.GetDevice("AV & Custom System (TCP)").GetFeedbackAtPos(0);
IR.Log("id: " + Feedback.id + ", name: " + Feedback.name + ", data: " + Feedback.data);
// id: 1, name: Feedback 1, data: 74,65,73,74
.AddEndOfString
Specify the string treated as the end of a message in the IR.EVENT_RECEIVE_TEXT listener. Works only with AV & Custom System (TCP, UDP, RS232). When transmitting large messages, devices split them into packets, so IR.EVENT_RECEIVE_TEXT receives the message in parts (packets). With this method, the script looks for the specified string in the packets and automatically combines all preceding packets into one message.
This method does not work with the HTTP driver. For the HTTP driver, the recommended method is .SendEx, which can assemble data received in parts into a single message.
Syntax
IR.GetDevice(driver).AddEndOfString(string)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| string | "happy" | type: string string marking the end of a message |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the driver channel |
| result | true | type: boolean method result. Returns true if the input parameter is a string, or false for any other data type |
Example
var driver = IR.GetDevice("TCP");
IR.AddListener(IR.EVENT_START,0,function()
{
IR.Log(driver);
driver.AddEndOfString("happy");
})
.AddEndOfData
Specify the byte sequence treated as the end of a message in the IR.EVENT_RECEIVE_DATA listener. Works only with AV & Custom System (HTTP, TCP, UDP, RS232). When transmitting large messages, devices split them into packets, so IR.EVENT_RECEIVE_DATA receives the message in parts (packets). With this method, the script looks for the specified sequence in the packets and automatically combines all preceding packets into one message
Syntax
IR.GetDevice(driver).AddEndOfData(data)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| data | 0x0d,0x0a | type: string sequence marking the end of a message |
| Output | ||
|---|---|---|
| object | [object Object] | type: object reference to the driver channel |
| result | true | type: boolean method result. Returns true if the input parameter is a byte array, or false for any other data type |
Example
var driver = IR.GetDevice("TCP");
IR.AddListener(IR.EVENT_START,0,function()
{
IR.Log(driver);
driver.AddEndOfData([0x0d,0x0a]);
})
.GetChannelURI
Access the Custom AV HTTP driver's URI field from JS. This lets you read the string directly from the URI field.
Syntax
IR.GetDevice("AV & Custom Systems (HTTP)").GetChannelURI("AV Control Command")
| Input | Value | Description |
|---|---|---|
| name | "AV Control Command" | type: string command name |
| Output | ||
|---|---|---|
| URI in tag | http://YourURI | type: string URI string |
Example
IR.AddListener(IR.EVENT_START,0,function()
{
var device = IR.GetDevice("AV & Custom Systems (HTTP)");
var URI = device.GetChannelURI("AV Control Command");
IR.Log("************ " + URI);
});
.SendText
This method works only with AV & Custom Systems (WebSoket) drivers. It sends data (except arrays) to the equipment as text (string).
| Input* | Value | Description |
|---|---|---|
| name | "Driver 1" | type: String - driver name in the iRidi project |
| context | "Hello, world!" / 1234 / true, etc. | type: object (not array) / number / string / boolean - data to send |
| Output | ||
|---|---|---|
| success | type: Boolean | success |
Code example:
// Для того что-бы скрипт сработал в проекте должен быть добавлен и настроен драйвер AV & Custom Systems (WebSoket)
var value = 8.2;
function test_runner() {
IR.GetDevice("AV & Custom Systems (WebSocket)").SendText(value); // на оборудование уходит "8.2"
IR.GetDevice("AV & Custom Systems (WebSocket)").SendText(Math.ceil(value)); // на оборудование уходит "9"
};
IR.AddListener(IR.EVENT_START, 0, function () {
IR.SetTimeout(10000, test_runner)
});
Converting data from the Data field
The methods above return Data field contents in HEX format. To convert this data to an ASCII string, use the following:
// process an array of HEX bytes from Data field of Command or Feedback
function HexArrayToAsciiString(in_aArray)
{
// init string
var l_sStr = '';
// aray bypass
for(var i = 0; i < in_aArray.length; i++)
l_sStr += String.fromCharCode(parseInt(in_aArray[i], 16));
// return string in ASCII format
return l_sStr;
}
IR.AddListener(IR.EVENT_START, 0, function()
{
var l_pCommand = IR.GetDevice("Driver").GetCommandAtName(1);
IR.Log("data:" + HexArrayToAsciiString(l_pCommand.data)); // ASCII data
});
IR.GetDevices()
Get an array of all drivers in the iRidi project.
Syntax
IR.GetDevices();
| Output | ||
|---|---|---|
| Object | [object DevicePrototype] | type: Object reference to the driver array |
Example
var devices = IR.GetDevices();
var name_1 = devices[0].Name;
var name_2 = devices[1].Name;
IR.Log("First device: " + name_1);
IR.Log("Second device: " + name_2);
IR.IsModuleLicensed
Checking whether a driver is licensed
Attention! For this function to work with your driver, you must arrange driver support with us. To add your driver to the supported list, contact us at contact@iridiummobile.ru
Syntax
IR.IsModuleLicensed(ID)
| Input | Value | Description |
|---|---|---|
| ID | 452 | type: Number driver type agreed with our company |
| Output | ||
|---|---|---|
| Result | true | type: boolean true - driver licensed, false - driver not licensed |
Example
var hasLicense1= IR.IsModuleLicensed("6") // AV & Custom Systems
var hasLicense2= IR.IsModuleLicensed("14") // AV & Custom HTTP
Events
An event is a process exposed to scripts with an identifier for monitoring.
A listener is a function that executes when its specified event occurs
Add a listener using the method IR.AddListener
IR.AddListener(event, input, action);
- event is the identifier of the event monitored by the listener
- input is an input parameter required to create the listener. If there is no parameter, specify 0
- action is an anonymous function or a reference to a declared function in which actions are performed
- pointer is a pointer to the listener's invocation context (optional). You can access the context using the this operator. The context may change while the program is running
Example:
// выполнение функции внутри слушателя
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("Driver"), function (name, value)
{
IR.Log("changes: "+name+" > "+value); // changes: Feedback 1 > 100
});
IR.EVENT_ONLINE
Identifier of the event triggered when a connection to the equipment is established
Syntax
IR.AddListener(IR.EVENT_ONLINE, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function() {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| - |
Example
IR.AddListener(IR.EVENT_ONLINE, IR.GetDevice("Global Cache"), function()
{
IR.Log("Device online");
});
IR.EVENT_OFFLINE
Identifier of the event triggered when disconnected from the equipment
Syntax
IR.AddListener(IR.EVENT_OFFLINE, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function() {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| - |
Example
IR.AddListener(IR.EVENT_OFFLINE, IR.GetDevice("Global Cache"), function()
{
IR.Log("Device offline");
});
IR.EVENT_TAG_CHANGE
Identifier of the event triggered when a native driver's feedback channel status changes.
Syntax
IR.AddListener(IR.EVENT_TAG_CHANGE, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(name, value) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| name | "Feedback 1" | type: string name of the changed channel |
| value | 100 | type: number new value |
Example
// Subscribe to driver
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("KNX Router (KNXnet/IP)"), function(name, value)
{
IR.Log(name+": "+value); // Feedback 1: 100
});
// subscribe to iRidium Server variables (in Server project)
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetServer(), function(name, value)
{
IR.Log(name+": "+value);
});
Notes
- For the AV & Custom Systems driver! Use IR.EVENT_RECEIVE_DATA or IR.EVENT_RECEIVE_TEXT to parse this driver's data
- HDL: specify the HDL Network name instead of the driver name; by default, it is "HDL-BUS Pro Network (UDP)". The changed channel value is returned as "device:channel"; device is the HDL actuator name, and channel is the channel in that device's settings.
- Domintell: specify the Domintell Network name instead of the driver name; by default, it is "Domintell Network (UDP)". The changed channel value is returned as "device:channel"; device is the Domintell actuator name, and channel is the channel in that device's settings.
- IR.EVENT_TAG_CHANGE occurs:
- whenever data is received (even if the value is unchanged) when accessing the driver directly through IR.GetDevice(),
- only when data changes when accessing it indirectly through the server using IR.GetServer().
IR.EVENT_RECEIVE_DATA
Identifier of the event triggered when an AV & Custom Systems driver receives data, outputting it as a byte array: an array of ASCII character codes. Works only with AV & Custom Systems.
Syntax
IR.AddListener(IR.EVENT_RECEIVE_DATA, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(data) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| data | type: array character array |
Example
IR.AddListener(IR.EVENT_RECEIVE_DATA, IR.GetDevice("AV & Custom Systems (TCP)"), function(data)
{
IR.Log(data);
});
Notes
Works only with AV & Custom Systems.
IR.EVENT_RECEIVE_TEXT
Identifier of the event triggered when an AV & Custom Systems driver receives data, outputting it as a string. Works only with AV & Custom Systems.
Syntax
IR.AddListener(IR.EVENT_RECEIVE_TEXT, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(text) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| text | type: string received data as a string |
Example
IR.AddListener(IR.EVENT_RECEIVE_TEXT, IR.GetDevice("AV & Custom Systems (TCP)"), function(text)
{
IR.Log(text);
});
Notes
Works only with AV & Custom Systems.
IR.EVENT_ERROR
Identifier of the event triggered when an HTTP request is sent to an unavailable resource, or a resource that is available but does not respond within the specified time. Outputs an error code
Syntax
IR.AddListener(IR.EVENT_ERROR, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("AV & Custom Systems (HTTP)") | type: object driver reference |
| function | function(transport_id, local_ip, local_port, host_ip, host_port, errorCode) {} | type: function anonymous function or function reference that processes the listener results |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| transport_id | 0 | type: number transport identifier: 0 for any AV driver except Global Cache, where 0 - IR, system, 1 - COM1, 2 - COM2 |
| local_ipt | 192.168.0.100 | type: string local address of the command sender |
| local_port | 80 | type: number local port of the command sender |
| host_ip | 200.200.10.10 | type: string command recipient address |
| host_port | 80 | type: number command recipient port |
| errorCode | 1 | type: number error code: * 1 - request could not be sent (resource unavailable) * 2 - resource available, but no response received within the specified time |
Example
var driver = IR.CreateDevice(IR.DEVICE_CUSTOM_HTTP_TCP, "AV Device (HTTP)", {
Host: "ResourceUnavailable.net", Port: 80
});
driver.SendEx({
Type: "GET", Url: "/request", Headers: {},
cbReceiveText: function(text, code, headers) {IR.Log("cbReceiveText (code) = "+code);}
});
IR.AddListener(IR.EVENT_ERROR, driver, function(transport_id, local_ip, local_port, host_ip, host_port, errorCode) {
IR.Log("IR.EVENT_ERROR (code) = "+errorCode);
});
Notes
- Works only with AV & Custom Systems (HTTP)
- does not trigger if the resource returns a response, even an error response. To handle errors, use SendEx
IR.EVENT_CHANNEL_SET
Identifier of the event triggered when a driver command is activated
Syntax
IR.AddListener(IR.EVENT_CHANNEL_SET, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(name, value) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| name | "Command 1" | type: string name of the activated command |
| value | 100 | type: number Value written to the command when sending |
| data | 'string' | type: string value stored in the activated command's Data field - available only in AV & Custom Systems drivers |
Example
IR.AddListener(IR.EVENT_CHANNEL_SET, IR.GetDevice("AV & Custom Systems (TCP)"), function(name, value, data) {
switch(name) {
case "Volume":
if (data) IR.Log("Volume set: " + data + " " + value)
else IR.Log("Volume set: " + value)
break;
case "Play":
IR.Log("Play")
break;
}
});
Notes
The event triggers only for AV & Custom Systems and Global Cache drivers
IR.EVENT_TAG_UPDATE_START
The listener triggers when KNX bus polling starts
Syntax
IR.AddListener(IR.EVENT_TAG_UPDATE_START, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(name, value) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
Example
IR.AddListener(IR.EVENT_TAG_UPDATE_START, IR.GetDevice("KNX Router (KNXnet/IP) / Serial (UMC) 1"), function () {IR.Log("EVENT_TAG_UPDATE_START")});
IR.EVENT_TAG_UPDATE_END
The listener triggers when KNX bus polling ends.
Syntax
IR.AddListener(IR.EVENT_TAG_UPDATE_END, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object driver reference |
| function | function(name, value) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
Example
IR.AddListener(IR.EVENT_TAG_UPDATE_END, IR.GetDevice("KNX Router (KNXnet/IP) / Serial (UMC) 1"), function () {IR.Log("EVENT_TAG_UPDATE_END")});
UPnP
.InvokeAction
Send an instruction to a UPnP-capable device
Syntax
IR.GetDevice(driver).InvokeAction(action_name, service_type, [arguments, callback])
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| action_name | "Play" | type: string command name |
| service_type | "service:AVTransport:1" | type: string service used |
| arguments | InstanceID: 0, Speed: 1 | type: string command argument list |
| callback | type: object callback function |
| Output | ||
|---|---|---|
| success | type: Boolean success |
Example
IR.GetDevice("Sonos").InvokeAction("Play", "service:AVTransport:1", {InstanceID: 0, Speed: 1});
.Subscribe
Subscribe to an event from a UPnP-capable device
Syntax
IR.GetDevice(driver).Subscribe(service_type)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| service_type | "urn:schemas-upnp-org:service:AVTransport:1" | type: string service used |
| Output | ||
|---|---|---|
| true | true | type: Boolean success |
Example
IR.GetDevice("Sonos").Subscribe("urn:schemas-upnp-org:service:AVTransport:1");
.Unsubscribe
Unsubscribe from an event from a UPnP-capable device
Syntax
IR.GetDevice(driver).Unsubscribe(service_type)
| Input | Value | Description |
|---|---|---|
| driver | "Driver 1" | type: string driver name in the iRidi project |
| service_type | "urn:schemas-upnp-org:service:AVTransport:1" | type: string service used |
| Output | ||
|---|---|---|
| true | true | type: Boolean success |
Example
IR.GetDevice("BAOS").Unsubscribe("urn:schemas-upnp-org:service:AVTransport:1");
IR.EVENT_DEVICE_FOUND
Identifier of the event triggered by an event on a UPnP device
Syntax
IR.AddListener(IR.EVENT_DEVICE_FOUND, 0, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| function | function(name) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| name | "Device" | type: string name of the discovered UPnP device |
Example
IR.AddListener(IR.EVENT_DEVICE_FOUND, 0, function(name)
{
IR.Log(name);
});
IR.EVENT_RECEIVE_EVENT
Identifier of the event triggered when an event is received from a UPnP device
Syntax
IR.AddListener(IR.EVENT_RECEIVE_EVENT, driver, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| driver | IR.GetDevice("MyDriver") | type: object reference to the UPnP driver |
| function | function(type, text) {} | type: function anonymous function or function reference |
| pointer | - | type: object pointer to the object serving as the function context (optional) |
| Output | ||
|---|---|---|
| type | type: string event type | |
| text | type: string message from the device |
Example
IR.AddListener(IR.EVENT_RECEIVE_EVENT, IR.GetDevice("MyDriver"), function(type, text) {
IR.Log(text);
});
Properties
Driver properties
Driver connection parameters can be read as properties of the Driver object. To change connection parameters, use .SetParameters.
The main driver properties in an iRidi project are its name and type. These can be requested from any driver. :
driver.property
property:
| Property | Example | Description |
|---|---|---|
| Name | Crestron 1 | type: string driver name |
| Type | Crestron (TCP) | type: string driver type. The exact type name is shown in Driver Type in the connection settings window |
| LogLevel | Debug | type: number logging level: 0 - Emergency 1 - Alert 2 - Critical 3 - Error 4 - Warning 5 - Notice 6 - Info 7 - Debug 8 - Never |
var driver = IR.GetDevice("Crestron 1");
IR.AddListener(IR.EVENT_START,0,function()
{
var properties = driver.Name + " (" + driver.Type + ") created";
IR.Log(properties);
});
Other driver parameters are unique to the driver type. Their names can be found in the system menu or in the following list:
driver.property
AMX
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 1319 | number | connection port |
| DeviceID | 10001 | number | unique AMX panel identifier |
| Login | admin | string | secure session login |
| Password | admin | string | secure session password |
AV & Custom Systems (UDP)
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 8080 | number | connection port |
| LocalPort | 80 | number | local receive port (on the iRidi side) |
| Group | null | string | null - broadcast, "host" - multicast group |
| Multicast | false | string | false - broadcast, true - multicast (if a group is specified) |
| ScriptMode | 0 | number | send data directly to the driver and scripts (0), or only to scripts (1) |
AV & Custom Systems (HTTP)
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 8080 | number | connection port |
| SSL | false | number | secure connection |
| Login | admin | string | secure session login |
| Password | admin | string | secure session password |
| DisableQueue | 0 | number | do not queue commands if they could not be sent |
| SendCommandAttempts | 0 | string | number of retries if sending fails (0 - no retries, send once) |
| ConnectWaitTimeMax | 3000 | number | (ms) connection timeout |
| ReceiveWaitTimeMax | 5000 | number | (ms) response timeout |
| UserAgent | iRidi | string | how iRidi identifies itself to the HTTP server |
AV & Custom Systems (RS232)
| Parameter | Value | Type | Description |
|---|---|---|---|
| PortName | \.\COM1 | string | COM port name |
| BaudRate | 19200 | number | data transfer rate |
| DataBits | 8 | number | number of data bits in a frame |
| Parity | e | string | parity |
| StopBits | 1 | number | stop bit in a frame |
| Use485 | 0 | number | use RS485 transport |
AV & Custom Systems (TCP Server)
| Parameter | Value | Type | Description |
|---|---|---|---|
| Port | 8080 | number | connection port |
| MaxClients | 10 | number | maximum number of connected clients |
AV & Custom Systems (UDP Server)
| Parameter | Value | Type | Description |
|---|---|---|---|
| Port | 8080 | number | connection port |
| MaxClients | 10 | number | maximum number of connected clients |
| ClientTimeOut | 100 | number | (ms) time after which a client is disconnected if it sends no data to the server |
Clipsal
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 20023 | number | connection port |
| Project | PROJ | string | Toolkit project name |
Crestron
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 41794 | number | connection port |
| NetID | 3 | number | IP ID (IP Net Address) of the panel from the SIMPL Windows project |
| TelnetPort | 41795 | number | Telnet connection port (system) |
| TelnetSSL | 1 | number | use an SSL connection |
| TelnetLogin | admin | string | SSL login |
| TelnetPassword | admin | string | SSL password |
DVR
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 8080 | number | connection port |
| Login | admin | string | secure session login |
| Password | admin | string | secure session password |
Domintell
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 17481 | number | connection port |
| Password | admin | string | connection password |
| PingTime | 1000 | number | (ms) data refresh rate |
EPSNET
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 61682 | number | connection port |
| UpdateTime | 1000 | number | (ms) data refresh rate |
| DeviceAddress | string | not used by default |
Global Cache
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 4998 | number | system command transmission port - 4998 |
| IrConfirm | 0 | number | confirm IR command delivery |
| SerialPort1 | 4999 | number | COM port 1 (serial 1), if present |
| SerialPort2 | 5000 | number | COM port 2 (serial 2), if present |
| SerialPort3 | 0 | number | reserved |
| PingTime | 0 | number | (ms) periodically check connectivity with GC. 0 - ping disabled |
| DisableQueue | 0 | number | do not queue commands if they could not be sent |
| SendCommandAttempts | 0 | string | number of retries if sending fails (0 - no retries, send once) |
| ConnectWaitTimeMax | 3000 | number | (ms) connection timeout |
| ReceiveWaitTimeMax | 5000 | number | (ms) response timeout |
HDL-Buspro
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 255.255.255.255 | string | IP address or domain name. In a local network, the broadcast address is 255.255.255.255 |
| Port | 6000 | number | connection port |
| SendTimeOut | 20 | number | (ms) enforced interval between commands |
| ConnectMode | 0 | number | 0 - Local, 2 - Internet, 3 - Remote Server |
| Login | User | string | login (for Internet and Remote Server) |
| Password | User | string | password (for Internet and Remote Server) |
| Project | ir_proj | string | project name (for Internet and Remote Server) |
| ExtendedPort | 6000 | string | server port (for Remote Server) |
| Group | ir_group | string | group (for Remote Server) |
// Local (ConnectMode=0)
IR.GetDevice("HDL Buspro UDP").SetParameters({Host: "255.255.255.255", Port: 6000,
SendNeedConfirm: 0, SendTimeout: 20, ConnectMode: 0});
// Internet (ConnectMode=1)
IR.GetDevice("HDL Buspro UDP").SetParameters({Host: "215.110.10.10", Port: 6000,
Login: "User", Password: "User", SendNeedConfirm: 0, SendTimeout: 20, ConnectMode: 2,
Project: "ir_proj"});
// HDL Remote Server (ConnectMode=2)
IR.GetDevice("HDL Buspro UDP").SetParameters({Host: "215.110.10.10", Port: 9999,
Login: "User", Password: "User", SendNeedConfirm: 0, SendTimeout: 20, ConnectMode: 3,
ExtendedPort: 6000, Project: "ir_proj", Group: "ir_group"});
Helvar
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name (absent for Net Internal UDP) |
| Port | 50001 | number | connection port |
KNX
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 3671 | number | connection port |
| ConnectionWaitTime | 120000 | number | (ms) timeout after an unexpected connection loss: 60000 or 120000 ms (depending on the KNX interface) |
| SendWaitTime | 0 | number | (ms) pause between sending commands to the bus, used to reduce bus load |
| PingTime | 60000 | number | (ms) interval between Ping commands that check the router connection |
| Nat | 0 | number | NAT mode (enable when connecting over the internet or using multiple network interfaces) |
KNX IP BAOS
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 12004 | number | connection port |
| UpdateTime | 0 | number | (ms) interval between Ping commands that check the router connection |
Modbus
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 502 | number | connection port |
| UpdateTime | 1000 | number | (ms) data refresh rate |
Modbus Serial
| Parameter | Value | Type | Description |
|---|---|---|---|
| Port | 1 | number | COM port number |
| PortName | \.\COM1 | string | COM port name |
| BaudRate | 19200 | number | data transfer rate |
| DataBits | 8 | number | number of data bits in a frame |
| Parity | e | string | parity |
| StopBits | 1 | number | stop bit in a frame |
| Use485 | 0 | number | use RS485 transport |
SIP
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | SIP server IP address or domain name |
| Port | 502 | number | SIP server connection port |
| CallerID | Ben | string | subscriber alias |
| ID | Ben | number, string | subscriber number |
| Password | Pwd | number, string | subscriber password |
| FirstRTPPort | 40000 | number | first port in the RTP range |
| LastRTPPort | 41000 | number | last port in the RTP range |
| ToneDTMF | 1 | number | send DTMF tones |
| ToneSIP | 0 | number | send SIP tones |
| ExternalIP | string | subscriber external address | |
| PCMU | 1 | number | enable or disable the codec |
| PCMA | 1 | number | enable or disable the codec |
| GSM | 1 | number | enable or disable the codec |
| H263 | 1 | number | enable or disable the codec |
| H263_1998 | 1 | number | enable or disable the codec |
iRidi Server
| Parameter | Value | Type | Description |
|---|---|---|---|
| Host | 192.168.0.100 | string | IP address or domain name |
| Port | 30464 | number | connection port |
| Login | admin | string | secure session login |
| Password | admin | string | secure session password |