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
    Перейти к: навигация, поиск
    Эта страница является переводом страницы Tokens API. Перевод выполнен на 96%.

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

    • 1 API iRidium. Controlling tags
      • 1.1 IR.SetVariable
      • 1.2 IR.GetVariable
      • 1.3 IR.SaveConfig
      • 1.4 IR.ClearProjectTokens
      • 1.5 System Tokens: reading and writing
        • 1.5.1 Project update mode
        • 1.5.2 Device display
        • 1.5.3 Vibration
        • 1.5.4 Screensaver
      • 1.6 System Tokens: reading only
        • 1.6.1 Time
        • 1.6.2 Date
        • 1.6.3 GPS coordinates
        • 1.6.4 Compass
        • 1.6.5 Accelerometer
        • 1.6.6 Gyroscope
        • 1.6.7 Network connections
        • 1.6.8 Battery
        • 1.6.9 Volume
        • 1.6.10 Proximity sensor
        • 1.6.11 OS name
        • 1.6.12 Control panel type
        • 1.6.13 OS version
        • 1.6.14 Control panel name
        • 1.6.15 Control panel orientation
      • 1.7 Driver Tokens

    API iRidium. Controlling tags

    methods for reading and writing any tags of different objects in iRidium projects: System Tokens, Project Tokens, Driver Tokens, Driver Feedbacks, GUI Properties


    With the help of the IR.SetVariable and IR.GetVariable methods you can refer to properties of any entity of iRidium projects: System Tokens, Project Tokens, Driver Tokens, Driver Feedbacks, a graphic interface item.

    To refer to a tag you are required to indicate its full name in the request:


    System Tokens

    IR.GetVariable("System.name") - system variables. They store values of control panel properties: time, date, GPS coordinates, etc.

    AddSysTokenToItem.png
    Tokens can be assigned to graphic items and the items will output information received from the system. Token values can be sent to scripts.


    The majority of system tokens is available for reading only: see the list, but some can be written: see the list


    Project Tokens

    IR.GetVariable("Tokens.name") - user variables. They store data which are available for reading and writing. Data can be written in tokens or read by a graphic item or script.

    Tokens 1.png
    • Variables are stored in Project Device Panel
    • You can write a number or string (DEC or ASCII) in variables.
    • They can be created, deleted, copied, sorted and grouped in folders.
    • Data in variables can be saved (or not saved) after closing of the application.
    • Data can be writen in variables with the help of commands from items or from iRidium Script


    Driver Tokens

    IR.GetVariable("Drivers.Driver name.Online") - the driver state, available for reading only, see the list


    Driver Feedbacks

    IR.GetVariable("Drivers.Driver name.Channel name") - the feedback channel state of the driver, the channel name is displayed in the Feedbacks list. It can be read and written


    Page or item property

    IR.GetVariable("UI.Page 1.Item 1.Text") - properties of pages, popups or graphic items. They can be read and written


    Теги сервера в iRidum Server

    IR.GetVariable("Server.Tags.Virtual Tag 1") / IR.GetVariable("Server.Tags.Driver.Tag 1") - in the project iRidium Server you can refer to user variables and feedack channels of drivers created on the server.


    IR.SetVariable

    to write values in System Token

    Syntax

    IR.SetVariable("path.name", value)

    input value description
    path Tokens type: String
    indicates the path to the variable and its type:
    • System - System Tokens
    • Tokens - Project Tokens
    • Drivers.<driver name> - Driver Tokens, Driver Feedbacks
    • UI.<page name> - Page (Popup) tags
    • UI.<page name>.<item name> - Item tags
    • Server.Tags - the server varible (Virtual Tags, Driver Tags)
    name Update type: String
    variable name
    value 100 type: string, number
    values for writing
    output

    -


    Sample

    IR.AddListener(IR.EVENT_START, 0, function()
    {
    // System Tokens    
        IR.SetVariable("System.Update", false);
    // Project Tokens
        IR.SetVariable("Tokens.My Var", 100);
        IR.SetVariable("Tokens.Str 1", "data string");
    // Driver Tokens
        IR.SetVariable("Drivers.AV & Custom Systems (TCP).Feedback 1", "string to display");
        IR.SetVariable("Drivers.AV & Custom HTTP Network.AV & Custom Systems:AV Control Feedback", 0)
    // GUI Tags
        IR.SetVariable("UI.Page 1.Text", "Hello World!");
        IR.SetVariable("UI.Page 1.Item 1.Value", 100);
    // Server Tags (in iRidium Server only)
        IR.SetVariable("Server.Tags.Virtual 1", 0);
        IR.SetVariable("Server.Tags.AV & Custom Systems (TCP).Feedback 1", 100);
    });

    alias for Project Token: IR.SetVariable("Global.name", value)
    activation of the IR.SetVariable method for Project Token will create a user variable with the indicated name if it was not created before
    when you call the variable with some name and this name hasn't been used before you call it, the variable will be created by IR.SetVariable
    you can't use this method for sending data from panel to server via Feedback


    IR.GetVariable

    request the variable state

    Syntax

    IR.GetVariable("path.name")

    input value description
    path Tokens type: String
    indicated the path to the variable and its type:
    • System - System Tokens
    • Tokens - Project Tokens
    • Drivers.<driver name> - Driver Tokens
    • UI.<page name> - Page (Popup) tags
    • UI.<page name>.<item name> - Item tags
    name Update type: String
    variable name
    output
    value true type: string, number
    variable value


    Sample

    IR.AddListener(IR.EVENT_START, 0, function()
    {
    // System Tokens    
        var tag1 = IR.GetVariable("System.Update");
    // Project Tokens
        var tag2 = IR.GetVariable("Tokens.My Var 1");
    // Driver Tokens
        var tag3 = IR.GetVariable("Drivers.AV & Custom Systems (TCP).Online");
        var tag4 = IR.GetVariable("Drivers.AV & Custom Systems (TCP).Channel 1");
        var tag5 = IR.GetVariable("Drivers.AV & Custom HTTP Network.AV & Custom Systems:AV Control Feedback");
    // GUI Tags
        var tag6 = IR.GetVariable("UI.Page 1.Text");
        var tag7 = IR.GetVariable("UI.Page 1.Item 1.Value");
    // Server Tags (in iRidium Server only)
        var tag8 = IR.GetVariable("Server.Tags.Virtual 1");
        var tag9 = IR.GetVariable("Server.Tags.AV & Custom Systems (TCP).Feedback 1");
    });

    alias for Project Token: IR.GetVariable("Global.name")


    IR.SaveConfig

    It enables saving a token by means of a script when a project is turned off.

    Syntax

    IR.SaveConfig()

    input value description


    output
    success true type: boolean
    false/true


    Sample

    IR.AddListener(IR.EVENT_START,0,function()
    {
        IR.SetInterval(10000, save);    //  The "save" function is launched every 10 seconds
    })
    function add() {                            //Function to activate writing to a token
       var val = IR.GetVariable("Global.test");
       val++;
       IR.SetVariable("Global.test", val);
       IR.SetVariable("Global.test1", val);
       IR.SetVariable("Global.test2", val);
       IR.SetVariable("Global.test3", val);
       IR.SetVariable("Global.test4", val);
    }
    function save(){                        //It enables saving tokens
       IR.SaveConfig();
    }





    IR.ClearProjectTokens

    It resets values of project tokens to default ones.

    Syntax

    IR.ClearProjectTokens()

    input value description


    output
    success true type: boolean
    true


    Sample

    IR.AddListener(IR.EVENT_START, 0, function () {
        IR.ClearProjectTokens();
    });

    If a token has no default value, it is not cleared.


    System Tokens: reading and writing

    System tokens are available for reading (some of them for writing) on control panels only. iRidium Server does not provide a possibility to get the system state with the help of tokens.

    The list of system variables available for reading and writing:


    Project update mode

    IR.SetVariable("System.Update", true);
    IR.GetVariable("System.Update");
    • false - project update if off
    • true - project update if on


    Device display

    display brightness (available to control on iOS and Android only):

    IR.SetVariable("System.Display.Bright", 80);
    IR.GetVariable("System.Display.Bright");
    • 0...100 - display brightness in percentage terms
    full-screen mode
    IR.GetVariable("System.Display.FullScreen")
    display height
    IR.GetVariable("System.Display.Height")
    display width
    IR.GetVariable("System.Display.Width")

    display orientation

    IR.GetVariable("System.ViewOrientation")
    • 1 - vertical, the Home button is up
    • 2 - vertical, the Home button is down
    • 3 - horizontal, the Home button is to the left (by default)
    • 4 - horizontal, the Home button is to the right


    Vibration

    to activate short vibration (it activates the vibro-motor for a while), for iOS and Android only

    IR.SetVariable("System.Vibro", 1.5);
    • 1.5 - duration of short vibration in seconds (for Android OS); in iOS duration of vibration is not adjusted, set the 1 value always.


    Screensaver

    control demosnstration of screensaver on all the OS

    // set
    IR.SetVariable("System.Screensaver.Show", 1) // 1 - show, 0 - hide
    // get
    IR.GetVariable("System.Screensaver.Show") // 1 - showed, 0 - hided

    You can show screensaver only if "Screensaver.Enable" not a zero

    • 0 -hide screensaver
    • 1 - show screensaver, available only when scrrensaver interval not a zero


    // set 
    IR.SetVariable("System.Screensaver.Enable", 0) // disable screensaver
    IR.SetVariable("System.Screensaver.Enable", 10000)  // enable screensaver with interval of 10000 ms 
    // get
    IR.GetVariable("System.Screensaver.Enable") // interval of scrrensaver in ms, 0 when disabled

    Screensaver can be turned on with Delay > 0. When you set the delay to 0, it turns the screensaver off

    • 0 - remove the delay. Screensaver turns off
    • 10000 - turn on screensaver with Delay (ms)


    System Tokens: reading only

    System tokens are available for reading (some of them for writing) on control panels only. iRidium Server does not provide a possibility to get the system state with the help of tokens.

    The list of system variables available for reading only:


    Time

    seconds

    IR.GetVariable("System.Time.Seconds")

    minutes

    IR.GetVariable("System.Time.Minutes")

    hours

    IR.GetVariable("System.Time.Hour")

    time in the 24-hour format

    IR.GetVariable("System.Time.24")

    time in the 12-hour format

    IR.GetVariable("System.Time.12_AM_PM")

    time in the format set for OS

    IR.GetVariable("System.Time.Standart")


    Server tag in iRidum Server

    время восхода в в 24-часовом формате

    IR.GetVariable("System.Time.SunRise")

    время заката в в 24-часовом формате

    IR.GetVariable("System.Time.SunSet")

    Date

    day of year

    IR.GetVariable("System.Date.DayOfYear")

    year

    IR.GetVariable("System.Date.Year")

    day of week (0 - sunday, ... , 6 - saturday)

    IR.GetVariable("System.Date.DayOfWeek")

    month

    IR.GetVariable("System.Date.Month")

    day of month

    IR.GetVariable("System.Date.Day")

    date in the format YYYY_ММ_DD

    IR.GetVariable("System.Date.YYYY_MM_DD")

    date in the format DD_MONTH_YYYY

    IR.GetVariable("System.Date.DD_MONTH_YYYY"")

    date in the format MONTH_DD_YYYY

    IR.GetVariable("System.Date.MONTH_DD_YYYY")

    date in the format DD_ММ_YYYY

    IR.GetVariable("System.Date.DD_MM_YYYY")

    date in the format ММ_DD_YYYY

    IR.GetVariable("System.Date.MM_DD_YYYY")

    datу in the format DD_ММ

    IR.GetVariable("System.Date.DD_MM")

    date in the format ММ_DD

    IR.GetVariable("System.Date.MM_DD")

    week day

    IR.GetVariable("System.Date.Weekday")


    GPS coordinates

    course

    IR.GetVariable("System.Location.Course")

    speed

    IR.GetVariable("System.Location.Speed")

    altitude

    IR.GetVariable("System.Location.Altitude")

    longitude

    IR.GetVariable("System.Location.Longitude")

    latitude

    IR.GetVariable("System.Location.Latitude")


    Supported on iOS and Android only.

    Compass

    readability (degree of magnetization)

    IR.GetVariable("System.Magnetic.Accuarcy")

    geographic north

    IR.GetVariable("System.Magnetic.True")

    magnetic north

    IR.GetVariable("System.Magnetic.Heading")

    Z coordinates

    IR.GetVariable("System.Magnetic.Z")

    Y coordinates

    IR.GetVariable("System.Magnetic.Y")

    X coordinates

    IR.GetVariable("System.Magnetic.X")


    Supported on iOS and Android only.


    Accelerometer

    shaking

    IR.GetVariable("System.Accelerometer.Shake")

    Z coordinate

    IR.GetVariable("System.Accelerometer.Z")

    Y coordinate

    IR.GetVariable("System.Accelerometer.Y")

    X coordinate

    IR.GetVariable("System.Accelerometer.X")


    Supported on iOS and Android only.

    Gyroscope

    Z coordinate

    IR.GetVariable("System.Gyroscope.Z")

    Y coordinate

    IR.GetVariable("System.Gyroscope.Y")

    X coordinate

    IR.GetVariable("System.Gyroscope.X")


    Supported on iOS and Android only.

    Network connections

    status of connection to 3G/4G networks

    IR.GetVariable("System.Net.Cell")
    • true - there is connection
    • false - there is no connection


    status of connection to the Wi-Fi network

    IR.GetVariable("System.Net.WiFi")
    • true - there is connection
    • false - there is no connection


    identifier of Wi-Fi network

    IR.GetVariable("System.Net.SSID")
    • the name of the WIFi network

    Battery

    Power level

    IR.GetVariable("System.Battery.Level")

    Battery Status

    IR.GetVariable("System.Battery.Status")
    • 1 - is not rechaging
    • 2 - is recharging
    • 3 - maximum charge (for iOS)


    Volume

    volume value

    IR.GetVariable("System.Sound.Volume")

    mute mode

    IR.GetVariable("System.Sound.Mute")


    Proximity sensor

    IR.GetVariable("System.Proximity")
    • false - the sensor is not activated
    • true - the sensor is activated


    OS name

    returns the name of OS where iRidium is running

    IR.GetVariable("System.OS.Name");
    • Microsoft windows
    • Microsoft windows CE
    • Apple OSX
    • Apple iOS
    • Android

    Control panel type

    identifier of the OS version where iRidium is running

    IR.GetVariable("System.OS.Device");
    • when launching on Windows OS
      • 1 - Windows OS x86 32 / 64 bit
    • when launching on Mac OS X
      • 1 - Mac OS X PPC
      • 2 - Mac OS X X86 32 bit
      • 3 - Mac OS X X86 64 bit
    • when launching on iOS
      • 1 - iPhone
      • 2 - iPad
    • when launching on Android
      • 1 - smart phone
      • 2 - tablet


    OS version

    * under development *

    IR.GetVariable("System.OS.Version");


    Control panel name

    network name of the control panel where iRidium is running

    IR.GetVariable("System.Device.Name");
    Starting with iOS 18, Apple has tightened the requirements for accessing the device name. Our application doesn't meet the new criteria, which may cause the token to return incorrect data or empty values on devices running iOS 18 and later.

    Control panel orientation

    IR.GetVariable("System.Orientation");
    • 1 - vertical, the Home/Menu button is in the bottom of the screen
    • 2 - vertical, the Home/Menu button is on the top of the screen
    • 3 - horizontal, the Home/Menu button is to the right of the screen
    • 4 - horizontal, the Home/Menu button is to the left of the screen
    • 5 - horizontal, the screen is up
    • 6 - horizontal, the screen is down
    • 0 - in the process of orientation change


    Driver Tokens

    Driver variables are available for reading only. The set of variables is the same for any driver.

    IR.AddListener(IR.EVENT_START, 0, function()
    {
    // Driver Tokens
        var tag1 = IR.GetVariable("Drivers.AV & Custom Systems.Online");  // Online..Offline = 1..0
        var tag2 = IR.GetVariable("Drivers.AV & Custom Systems.Status");  // Offline..Connecting..Online..Waiting = 0..1..2..3
        var tag3 = IR.GetVariable("Drivers.AV & Custom Systems.Host");  // domain name of remote equipment
        var tag4 = IR.GetVariable("Drivers.AV & Custom Systems.HostPort");  // port of remote device
        var tag5 = IR.GetVariable("Drivers.AV & Custom Systems.IP");  // IP address of Control Panel
        var tag6 = IR.GetVariable("Drivers.AV & Custom Systems.HostIP");  // IP address of remote equipment
        var tag7 = IR.GetVariable("Drivers.AV & Custom Systems.Port");  // local port on Control Panel
    });
    Источник — «https://dev.iridi.com/index.php?title=Tokens_API/en&oldid=148118»
    Категория:
    • Инструкции
    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