Skip to main content

Universal import from JS

Universal import from JS lets you import drivers from a js text file containing a json data structure. Json describes the list of drivers to import. In this file, you can specify driver connection properties and create commands and feedbacks.

Documentation updated 01.01.2024

Driver examples:

You will need a text editor. One convenient option is Notepad++ with syntax highlighting.

Create a new file and populate it according to the driver structure. The structure can vary by driver type. Different connection, subdevice, and device tag settings can be added.

Import file structure​

The Json file contains the following main sections:

  1. Devices - essential driver settings without which import cannot be performed,
  2. Connection - equipment connection parameters,
  3. Commands - command configuration parameters,
  4. Feedbacks - feedback configuration parameters.

Import_from_js.png

Devices​

Studio_import_33.png

This example creates a file with the minimum settings needed to import an MQTT driver into iRidi Studio.

Basic driver settings:

  • Type - unique numeric driver identifier, represented by ID in the driver's xml file;
  • Name - unique driver name;
  • Protocol - protocol supported by the equipment. The first protocol in the list is used by default;
  • Merge - merges drivers of the same type:
    • 1 - merge,
    • 0 - do not merge.

Type for JSON

  • Alexa ID="1"
  • Google Home ID="2"
  • YandexAlice ID="4"
  • ZWave ID="5"
  • DuoTecno ID="6"
  • ELKO EP iNels ID="7"
  • iNels RF ID="8"
  • KNX Baos kBerry ID="9"
  • KNX IP Baos 771-774,777 ID="10"
  • KNX IP Router ID="11"
  • KNX LMx ID="12"
  • Global Cache ID="13"
  • Larnitech ID="14"
  • iRidi Server ID="15"
  • KNX IP Baos 770 ID="16"
  • Lutron ID="17"
  • SNMP ID="18"
  • HDL ID="19"
  • Velbus ID="20"
  • Domintell ID="21"
  • Helvar Net 8 bit device ID="22"
  • Helvar Net 16 bit device ID="23"
  • Modbus ASCII ID="24"
  • Modbus RTU ID="25"
  • Modbus TCP Server ID="26"
  • Modbus TCP ID="27"
  • BACNet ID="28"
  • Custom ID="29"
  • 1-Wire ID="30"
  • Crestron ID="31"
  • EPSNET ID="32"
  • Beckhoff ID="33"
  • MQTT ID="34"
  • CustomHttp ID="35"
  • AMXDevice ID="36"
  • Virtual ID="37"
  • Clipsal Gate ID="38"
  • Clipsal ID="39"
  • SIP ID="40"
  • Custom Network ID="41"
  • CustomHttp Network ID="42"
  • YandexAlicePlatform ID="43"
  • Sonos ID="44"
  • Modbus TCP Server (Slave mode) Network ID="46"
  • Modbus ASCII Network ID="47"
  • Modbus TCP Network ID="48"
  • Modbus RTU Network ID="49"
  • TestDevice ID="50"
  • AppleTV ID="51"
  • ControlArt ID="52"

Connection​

Obtain the driver connection parameters from its xml file. Open the Devices folder (C:\Program Files (x86)\iRidium Ltd\iRidium Pro\Studio32\Devices) and open the driver file in a text editor.

Tip

To merge drivers of the same type, specify identical Connection parameters

To specify driver connection parameters, add a "Connection" block to the structure shown above.

Import10.png

It includes the equipment Host and Port, as well as driver-specific settings.

The complete list of connection parameters is available in the driver's xml file, in the block delimited by "...".

Import30.png

Note
  • The ID variable contains the parameter name.
  • Some parameter names in Studio may differ from those in the xml file.

Commands / Feedbacks​

Each device in iRidi Studio has commands and feedbacks. Add the required number and configure each tag.

Import28.png

Each tag (channel or feedback) has two required parameters:

  • Direction - tag type
    • 1 - command;
    • 2 - feedback.
  • Name - unique command or feedback name.

There are also driver-specific parameters, specified in the "Params" block. The complete list of tag parameters is available in the driver's xml file. The tag parameters are delimited by opening and closing "...".

Import7.png

Note

The Caption variable contains the tag parameter name. The Value variable is the unique identifier of this parameter.

RootFolder​

iRidi Pro lets you create a separate folder containing any commands, feedbacks, devices, and subdevices. Required fields:

  • Name - folder name;
  • Items - command, feedback, device, or subdevice parameters.

Import27.png

Importing a driver​

  1. Select Script (*.js) in the import window.

  2. Specify the path to the required js file.

Import11.png

Driver examples​

Domintell​

Creating a file template for importing a Domintell driver.

Tip

Example:Domintell

Connection​

Import5.png

Connection parameters:

  • Host - controller IP address;
  • Port - control port;
  • Password - password for protected access;
  • UpdateTime - data update frequency (ms).

SubDevice​

Import15.png

  • Name - subdevice name;
  • Module - supported device:

Import40.png

Import41.png

  • Serial Number - serial number.

Commands​

Import26.png

Command parameters:

  • Direction = 1 - command;
  • Name - register name;
  • Channel - channel number;
  • Command (CommandDampli in this example) - command type.

Import12.png

Domintell Light Protocol command list:

CommandValueDescription
None-change the output
%I-set the output
%O-reset the output
%D+decimal dimmer/volume value assignment
%P+simulate a push on a input (1 - begin shot push, 2 - end shot push, 3 - begin long push, 4 - end long push)
%I%D+increase dimmer/volume value by step of decimail percent
%O%D+decrease dimmer/volume value by step of decimail percent
%DB-execute a Start dim on a dimmer output
%DE-execute a Stop dim on a dimmer output
%M+set Temperature mode
%A+sound Auxiliary selection 1-4 - AUX1-4, 5 - Tuner
%F+decimail Tuner Frequency in Mhz (1015000 = 101.5 Mhz, multiple of 500)
%R+set regulation mode
%U+set Coling Setpoint (decimal T value)
%T+set Heating Setpoint (decimal T value)
%H+shutters goes High
%L+Shutters goes Low

Feedbacks​

Import24.png

Feedback parameters:

  • Direction = 2 - feedback;
  • Name - feedback name;
  • Channel - channel number;
  • Command (CommandDampliFeedback in this example) - feedback type;

Import3.png

  • Property (Property3Item in this example) - additional parameters.

Import1.png

DuoTecno​

Creating a file template for importing a DuoTecno driver.

Tip

Example:DuoTecno

Connection​

Import22.png

Connection parameters:

  • Host - controller IP address;
  • Port - control port;
  • Login - server access login.

SubDevice​

Import4.png

  • Name - subdevice name;
  • NodeID - node identifier (HEX format);
  • UnitID - unit identifier (HEX format).

Commands​

Import19.png

Command parameters:

  • Direction = 1 - command;
  • Name - command name;
  • Command - command type;

Import6.png

  • Method (MethodSwitch in this example) - method used.

Import3.png

Feedbacks​

Import8.png

Feedback parameters:

  • Direction = 2 - feedback;
  • Name - feedback name;
  • Command (Switch Status in this example) - feedback type;

Import23.png

  • Method - method number;
  • UnitType (UnitTypeSwitch in this example) - block type;

Import31.png

  • Parameter - additional parameters available for this feedback type;

Import32.png

  • Value (Value3ItemFeedback in this example) - available input values.

Import14.png

EPSNET (UDP)​

Creating a file template for importing an EPSNET (UDP) driver.

Tip

Example:EPSNET

Connection​

Import17.png

Connection parameters:

  • Host - controller IP address;
  • Port - UDP control port, 61682;
  • UpdateTime - data update frequency (ms);
  • DeviceAddress - device address.

Commands & Feedbacks​

Import20.png

Command and feedback parameters:

  • Direction:
    • 1 - command,
    • 2 - feedback.
  • Name - register name;
  • Type - data type;

Import38.png

  • Register - register type;

Import39.png

  • Address - register number;
  • Bit - bit number in the byte (for Bool).

Lutron Homeworks QS (Beta)​

Creating a file template for importing a Lutron Homeworks QS (Beta) driver. Example:Lutron Homeworks QS (Beta)

Connection​

ImportFromJS_Lutron.png

Connection parameters:

  • Host - controller IP address;
  • Port - controller connection port;
  • Login - controller access login;
  • Password - controller access password;
  • Keep Alive - connection keep-alive time in seconds.

Commands & Feedbacks​

ImportFromJS_Lutron2.png

Command and feedback parameters:

  • Direction:
  • 1 - command,
  • 2 - feedback.
  • Name - command / feedback name;
  • Command - command used to address the required device (SHADEGRP = 6 in this example);

ImportFromJS_Lutron3.png

  • IntegrationID - device address (configured beforehand in Lutron designer);
  • Component - button number on the control panel (for button panels);
  • Action - command type (ActionSHADEGRP = 6 in this example):
    • ActionDEVICE - controls device inputs, such as buttons and dry contacts.

ImportFromJS_Lutron4.png

  • ActionOUTPUT - controls outputs, such as dimmers and dry-contact outputs.

ImportFromJS_Lutron5.png

  • ActionSHADEGRP - controls shades.

ImportFromJS_Lutron6.png

  • ActionHVAC - controls HVAC equipment.

ImportFromJS_Lutron7.png

  • ActionAREA - controls areas.

ImportFromJS_Lutron8.png

  • Value - value sent to the channel. Value types (this example uses ValueInt32):

ImportFromJS_Lutron9.png

All possible values of this type are listed in the driver's xml file. For example, for Command = DEVICE and Action = Set/Get LED State, the values are:

ImportFromJS_Lutron10.png

MQTT​

Creating a file template for importing an MQTT driver.

Tip

Example:MQTT

Connection​

Import29.png

Connection parameters:

  • MQTTVersion - protocol version on the controller;
    • 3 - MQ Integrator SCADA Device Protocol (MQisdp) version,
    • 4 - MQTT protocol version.
  • ClientID - panel identifier;
  • KeepAlive - connection keep-alive time in seconds;
  • Clean - "clean start" flag, removes subscriptions when the connection is lost:
    • 1 - clean session,
    • 0 - persistent connections.
  • Host - controller IP address;
  • Port - controller connection port.

Commands​

Import9.png

Command parameters:

  • Direction = 1 - command;
  • Name - command name;
  • Topic - MQTT path;
  • ValueType - value type.

Import36.png

  • QoS - quality of service, message delivery guarantee from publisher to broker:
    • At most once - no more than once, no duplicates, delivery is not guaranteed,
    • At least once - one or more times, duplicates are possible, delivery is guaranteed,
    • Exactly once - exactly once, no duplicates, delivery is guaranteed.

Import37.png

  • Retain - retains the publication: the broker stores the retained topic and sends it to new subscribers with the retain flag:
    • 1 - enabled,
    • 0 - disabled.

Feedback​

Import2.png

Feedback parameters:

  • Direction = 2 - feedback;
  • Name - feedback name;
  • Topic - MQTT path;
  • ValueType - value type.

Import36.png

SNMP​

Creating a file template for importing an SNMP driver. Example:SNMP

Connection​

Import21.png

Connection parameters:

  • Host - device IP address;
  • Port - device connection port for sending data (default 161; the driver sends requests to the agent);
  • LocalPort - device connection port for receiving data (default 162; the agent sends a response to the driver);
  • InitTagsAtStart - poll at startup (true/false);
  • InitTagInterval - interval between tag polls. After an unsuccessful poll, the driver moves on to poll another tag;
  • InitTagAttemptsCount - number of polling attempts for each tag.

Commands​

SNMP_command.png

Command parameters:

  • Direction = 1 - command;
  • Name - command name;
  • OID - numeric object identifier;
  • TypeCommand - command type:
    • 0 - Get,
    • 3 - Set;
  • Value Type - value type:
    • 2 - Int;
    • 4 - String;
    • 5 - Null;
    • 6 - OID;
    • 64 - IP4;
    • 65 - Counter;
    • 67 - Time;
  • CommunityCommand - a character sequence indicating group membership, a form of password.

Feedback​

SNMP_feedback.png

Feedback parameters:

  • Direction = 2 - feedback;
  • Name - feedback name;
  • OID - numeric object identifier;
  • TypeTag - feedback type:
    • Value = 0 - feedback returning the requested value,
    • Trap = 1 - event feedback triggered when something happens.
  • IPAddres - IP address;
  • CommunityTag - a character sequence indicating group membership, a form of password.

Virtual channels​

Creating a file template for importing virtual commands and feedbacks into a server project.

Tip

Example:Virtual

Commands & Feedbacks​

Virtual1.png

Virtual2.png

Command and feedback parameters:

  • Direction:
    • 1 - command,
    • 2 - feedback.
  • Name - command / feedback name.