Logo Logo en
  • iRidi Pro
    Основные компоненты
    • Приложение i3 Pro
    • iRidi Pro Server
    • iRidi Studio
    • iRidium studio v. 1.3.8 (устаревшая версия)
    Java Script в iRidi
    • Руководство
    • Справочник
    • Примеры
    • JS драйвера
    другие
    • Личный Кабинет
    • iRidium Cloud
    • iRidium Transfer
    • Push-уведомления
    • Лучшая практика
    Лицензирование
    • Лицензирование и передача проекта
    • Оффлайн-лицензирование
    • Активация iRidi Pro Server
  • Продукты
    i3 lite
    • Приложение i3 lite
    • Регистрация и лицензирование
    • Сервер
    • Модули
    KNX Home Server
    • Приложение i3 KNX
    • KNX Home Server
    BUS77 HOME SERVER
    • Приложения Bus77 Home и Bus77 Lite
    • Bus77 Home Server
    Решения
    • BYOD - решение для гостиниц
    • Портал жителя - решение для МКД
    iRidi SCADA
    • iRidi SCADA
  • Bus77
    НАСТРОЙКА BUS77
    • Основы Bus77
    • Приложения Bus77 Home и Bus77 Lite
    • Работа с драйвером Bus77 в iRidi Studio
    • Настройка шины Bus77 в iRidi Studio
    ПРОТОКОЛ BUS77
    • Характеристики CAN (Bus77)
    • Описание протокола
    • Исходники на GitHub
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
  • Поддерживаемое оборудование
    Драйверы
    • Список драйверов
    • ProAV драйвера
    • AV & Custom Systems
    • JS драйвера
    • Сторонние драйвера и фриланс
    Протоколы и интерфейсы
    • Голосовое управление
    • 1-Wire
    • BACnet IP
    • Bus77
    • KNX
    • KNX IP BAOS
    • Weinzierl kBerry
    • Microsoft Exchange
    • Modbus
    • MQTT
    • NFC
    • ODBC
    • Onvif
    • SIP
    • SNMP
    • Wake On Lan
    • Z-Wave
    • ZigBee
    Производители
    • AMX
    • AVCiT
    • Beckhoff ADS
    • Biamp Tesira
    • Bluesound
    • Casambi
    • BSS Harman
    • Clipsal
    • ControlArt 7Port
    • Crestron
    • DigiBird
    • Domintell
    • Duotecno
    • EIDE
    • EPSNET
    • Global Cache
    • HDL Buspro
    • Helvar
    • IEAST
    • INELS BUS
    • INELS Wireless
    • Intesis
    • Kleger
    • Kramer VIA
    • Kramer 3000
    • Larnitech
    • Legrand Netatmo
    • LG TV
    • Lutron
    • Lutron Homeworks QS
    • MyHome
    • Nest
    • Novastar
    • Panasоnic PTZ
    • Philips Dynalite
    • PJLink
    • Satel
    • SamsungTV
    • Sonos
    • Somfy
    • SpinetiX
    • Televic Conference
    • TIS
    • Tion
    • URRI
    • Velbus
    • Velocio
    • Vinteo
    • WyreStorm
    • WiiM
    • Xicato
    • Yamaha
    • ZONT
    • Z-Wave.me
    Протестированное оборудование
    • Панель HDL S57
    • Панель HDL S10
    • SIP-домофон
    • Akuvox
    • Arlight
    • Divus
    • QBic TD-1050 PRO
    • QBic TD-1060 Slim
    • QBic TD-1070
    • Sigur
    • Uni-Ubi
    • Velocio
  • Оборудование iRidi

    Серверы
    • HS Сервер
    • ProAV Control Processor Basic
    • ProAV Control Processor Advanced
    • Спецификация контроллеров UMC
    • Настройка контроллера UMC C2
    • Настройка контроллера UMC C3
    • Настройка контроллера HDL IntelliCenter 2 (UMC C4)
    Модули расширения
    • I-PX-RS1
    • I-PX-RS4
    • I-PX-IR3
    KNX
    • KNX Home Server
    • KNX IP Interface
    Панели управления
    • iRidium Panel 7
    • Touch Panel P3
    • Touch Panel P6
    • Touch Panel P8
    • Touch Panel P10
    • Tabletop Touch Panel 10
    • AV Remote Control
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
    • Differences
iRidium mobile web-site
Содержание
    Инструменты‌
    • Сведения о странице
    • Постоянная ссылка
    • Версия для печати
    • Спецстраницы
    • Связанные правки
    • Ссылки сюда
    Login / Create Account
    Материал из for iRidium developers
    Перейти к: навигация, поиск
    Эта страница является переводом страницы Server API. Перевод выполнен на 100%.

    Other languages:
    English • ‎русский
  • Handbook
  • iRidium Server API
  • Содержание

    • 1 iRidium Server API
    • 2 Methods
      • 2.1 IR.GetServer
    • 3 Events
      • 3.1 IR.EVENT_ACCEPT
      • 3.2 IR.EVENT_AUTHORIZE
      • 3.3 IR.EVENT_RELEASE
      • 3.4 IR.EVENT_SCHEDULE_EVENT_CHANGE

    iRidium Server API

    The unique functions, methods and properties that can be used in iRidium Server project (*.sirpz)

    Methods

    IR is a global object that includes all the functions and constants of iRidium API. All the methods that can be used an IR object includes.

    IR.GetServer

    This method works only in Server project (*.sirpz). It can be used to work with internal variables of iRidium server available for control panels. You can call the variable using the full name. The method returns the object that you can use to call the methods from this list: IR.GetDevice.

    Syntax

    IR.GetServer()

    input value description

    -

    output
    Object [object DevicePrototype] type: Object
    link to the driver object


    Sample

    var server = IR.GetServer();  // [object DevicePrototype]
     
    server.Set("Virtual 1", 1);    // set 1 to Virtual Channel
    server.Set("KNX.Address 1", 1);    // set 1 to the Address of KNX driver
     
    IR.AddListener(IR.EVENT_TAG_CHANGE , IR.GetServer(), function(name,value)
    {
       if (name == "KNX.Address 1")	IR.Log("KNX Address Changed");
       if (name == "Virtual 1")	IR.Log("Virtual Tag Changed");
    });

    works only in server project (*.sirpz)
    The method returns the object that you can use to call the methods from this list: IR.GetDevice.


    Events


    An event - a process forwarded to scripts with an identifier for monitoring.

    A listener - it is a function which is executed if the event set for it is activated

    Add a listener using the method IR.AddListener

    IR.AddListener(event, input, action);
    • event - the identifier of the event monitored by the listener
    • input - the input parameter required for creating the listener. If there is not such parameter indicate 0
    • action - the unnamed function or the link to the named function in which the actions are performed



    Example:

    // functions inside of listener
    IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("Driver"), function (name, value)
    {
        IR.Log("changes: "+name+" > "+value); // changes: Feedback 1 > 100
    });


    IR.EVENT_ACCEPT

    the identifier of event that fires when trying to connect to iRidium Server. It will the network settings of control panel that tried to connect to the Server. Then the control panel starts authorizing on Server. If the authorization is OK, the IR.EVENT_AUTHORIZE fires. This event means that the panel successfully authorized. The data received from ACCEPT and AUTHORIZE events gives the compleat information about panel. This events can be related via ID property - the identifier of connection.

    Syntax

    IR.AddListener(IR.EVENT_ACCEPT, IR.GetServer(), function (ID, LocalIP, LocalPort, HostIP, HostPort) {});

    input value description
    driver IR.GetServer() type: object
    link to iRidium Server driver
    output
    ID 1 type: string
    the serial number of control panel in the list of connections (from 1)
    LocalIP 192.168.0.100 type: string
    local host of control panel
    LocalPort 30464 type: string
    port on control panel opened to receive the data from server
    HostIP 192.168.0.100 type: string
    IP-address of remote system from where the panel connected to server
    HostPort 30464 type: string
    the external port of remote system opened to receive the data from server


    Sample

    IR.AddListener(IR.EVENT_ACCEPT, IR.GetServer(), function (ID, LocalIP, LocalPort, HostIP, HostPort)
    {
        var time = IR.GetVariable("System.Time.24");
        IR.Log("Accept Client: "+time+", "+ID+", "+LocalIP+", "+LocalPort+", "+HostIP+", "+HostPort);
    });





    IR.EVENT_AUTHORIZE

    *The function is outdated and does not fulfill what is stated in it, left for compatibility. At the moment, the server starts any panel, regardless of the presence of a password*
    the identifier of event that fires when the control panel successfully authorized on iRidium Server. This event fires after IR.EVENT_ACCEPT and returns information about panel: connection ID, HWID of control panel, user's login, the identifier of Object and the name of visualization project started on panel. The combination of data received from ACCEPT and AUTHORIZE events gives the full information about control panel. To associate these two events, use the ID - identifier of the connection.

    Syntax

    IR.AddListener(IR.EVENT_AUTHORIZE, IR.GetServer(), function (ID, ObjectId, Login, ProjectName, HWID) {});

    input value description
    driver IR.GetServer() type: object
    link to iRidium Server driver
    output
    ID 1 type: string
    the serial number of control panel in the list of connections
    ObjectId 7071 type: number
    the ID of the automation object in the iRidium Cloud, from which the control panel loaded the project
    Login user@my.mail type: string
    the login of the user logged on the control panel
    ProjectName Project Home type: string
    the name of the visualization project runs on the control panel
    HWID 69538...a7acf type: string
    the unique identifier of the control panel (sometimes it may change, do not use the HWID as a permanent identifier of the panel!)
    Name DESKTOP-1 type: string
    name of a device where a panel was connected to a server
    Model Windows 6.2 build 9200 sp 0.0 type: string
    model of a device where a panel was connected to a server
    Producer Microsoft Windows 8 x64 type: string
    operation system of a device where a panel was connected to a server.
    Version 0.0.3 type: string
    OS version of a device where a panel was connected to a server
    Group 2 type: number
    group of client that connects to the server
    Channel 1 type: number
    variables that can be controlled
    Tags 1 type: number
    variables from which feedback can be received.


    Sample

    IR.AddListener(IR.EVENT_AUTHORIZE, IR.GetServer(), function (ID, ObjectId, Login, ProjectName, HWID, in_oFullInfo)
    {
       var time = IR.GetVariable("System.Time.24");
       IR.Log("Client Authorized: " + time + ", " + ID + " " + ObjectId + " " + Login + " " + ProjectName + " " + HWID)
       IR.Log(JSON.Stringify(in_oFullInfo))
    });





    IR.EVENT_RELEASE

    the identifier of event that fires when the i3 pro disconnecting from Server and receive the information about this panel

    Syntax

    IR.AddListener(IR.EVENT_RELEASE, IR.GetServer(), function (ID, LocalIP, LocalPort, HostIP, HostPort) {});

    input value description
    driver IR.GetServer() type: object
    link to iRidium Server driver
    output
    ID 1 type: string
    the serial number of control panel in the list of connections (from 1)
    LocalIP 192.168.0.100 type: string
    local host of control panel
    LocalPort 30464 type: string
    port on control panel opened to receive the data from server
    HostIP 192.168.0.100 type: string
    IP-address of remote system from where the panel connected to server.
    HostPort 30464 type: string
    the external port of remote system opened to receive the data from server


    Sample

    IR.AddListener(IR.EVENT_RELEASE, IR.GetServer(), function (ID, LocalIP, LocalPort, HostIP, HostPort)
    {
        var time = IR.GetVariable("System.Time.24");
        IR.Log("Release Client: "+time+", "+ID+", "+LocalIP+", "+LocalPort+", "+HostIP+", "+HostPort);
    });





    IR.EVENT_SCHEDULE_EVENT_CHANGE

    start or end event of any event in the schedule. The event is available only on the server.

    Syntax

    IR.AddListener(IR.EVENT_SCHEDULE_EVENT_CHANGE, 0, function(scheduleName, eventName, status){}, [pointer]);

    input value description
    function(){} function(){} type: function
    an unnamed function or a function call
    pointer - type: object
    a pointer to an object that services a function (optional)
    output
    scheduleName 'Schedule 1' type: string
    schedule name
    eventName 'Event N' type: string
    event name
    status 1 type: number
    states of an event:
    1 - IR.SCHEDULE_EVENT_STATE_START - it has started,
    2 - IR.SCHEDULE_EVENT_STATE_RUN - it is working,
    3 - IR.SCHEDULE_EVENT_STATE_FINISH - it has finished.


    Sample

    IR.AddListener(IR.EVENT_SCHEDULE_EVENT_CHANGE, 0, function(scheduleName, eventName, status)
    {
       if (eventName == "Light" && status == IR.SCHEDULE_EVENT_STATE_START) 
       {
          IR.Log("Light on");
       }
       if (eventName == "Light" && status == IR.SCHEDULE_EVENT_STATE_FINISH) 
       {
          IR.Log("Light off");
       }
       if (eventName == "Heating" && status == IR.SCHEDULE_EVENT_STATE_START) 
       {
          IR.Log("Heater on");
       }
       if (eventName == "Heating" && status == IR.SCHEDULE_EVENT_STATE_FINISH) 
       {
          IR.Log("Heater off");
       }   
    });




    Источник — «https://dev.iridi.com/index.php?title=Server_API/en&oldid=126384»
    Категория:
    • Инструкции
    About us
    Company
    Team
    History
    Philosophy
    Rewards
    Partnership
    Our partner
    Partnership Programs
    Apply for partnership
    products
    iRidium pro
    iRidium lite
    iRidium gate
    iRidium server
    Loads
    iRidium pro
    iRidium lite
    Other version
    Marketing materials
    Support
    On-line courses/Video
    Recommended equipment
    Other version
    iRidium pro
    Documentation
    FAQ
    Forum
    iRidium lite
    Documentation
    Forum
    Projects
    Standart projects
    Smart buildings
    Smart house
    Special solution
    Find a dealer
    News
    Youtube
    Twitter
    VK
    Logo
    contact@iridi.com
    +7 (499) 322-73-29

    Privacy policy