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

    Other languages:
    English • ‎русский

    Содержание

    • 1 iRidium for MQTT
    • 2 Description
    • 3 Connection
      • 3.1 Import from a CSV file (*.csv)
      • 3.2 Adding the driver manually
      • 3.3 Connection settings
      • 3.4 Change of Connection Settings
    • 4 Commands & Feedbacks
      • 4.1 Settings

    iRidium for MQTT

    a set of tools for creating visualization interfaces


    The driver is meant to control MQTT equipment. To understand the driver, use the project example:

    download the example:

    • iRidium MQTT

    Examples:
    Connecting Modbus TCP devices to MQTT cloud services
    Connecting iRidium server to IBM Watson IoT

    Description

    iRidium for MQTT is a set of tools to create an interface to control Smart home or office on the basis of MQTT equipement. It realizes commands of MQTT protocol. Supported: MQTT MQisdp and MQTT 3.1.1.

    Connection

    Control panels (iOS, Android, Windows, Mac) can control BACnet equipment only via MQTT controller.


    MqttConnection.png


    You can add an MQTT driver by importing from a CSV file or manually filling in the data.


    Import from a CSV file (*.csv)

    Universal import from CSV File - a capability to import drivers from a table in the CSV format.

    You can read more about detailed instructions on creating a CSV file and importing it into IRidium Studio here.


    Adding the driver manually

    Add MQTT driver to your project from database


    1. Launch iRidium Studio and create a new iRidium project
    2. Open Device side panel and choose the MQTT driver


    MQTTAddDevice.png


    Indicate the controller address in iRidium project otherwise it will not work.


    Connection settings

    When the driver is added to the project, specify the connection settings.

    MQTTDriverParams.png
    • Host - IP address
    • Port - port
    • Login - user's login (if set on the bus)
    • Password - user's password (if set on the bus)
    • MQTT version - Protocol version on a bus: 3 - old protocol MQ Integrator SCADA Device Protocol (MQisdp), 4 - support for MQTT v 3.1.1,
    • Client ID - client identificator
    • Keep Alive - timeout for connection in seconds
    • Clean - "clean start" flag, deleting any subscriptions after disconnect: true - clean session, false - durable connections
    • SSL - turn on/off encription


    When SSL/TLS are used only CA signed server certificate can be used. Self signed certificates and CA certificate only are not supported.

    In the old studio for the correct work of the driver the Client ID field had to contain the unique ID for each panel. In the new studio (iRidium Studio 2019) this field is not compulsory.


    Change of Connection Settings

    You need the possibility to change connection properties when you disconnect from the Wi-Fi network of the automation object and start using 3G or another Wi-Fi network. To maintain control of the object you need to switch from the local to public IP-address of the Internet router.

    The switch is not automatic. You have to select the connection mode. For remote acces you have to make ports for controlling the automation system public. In order to do that you have o set up the Port Forwarding service on your Internet router. VPN can provide protected connection.


    1 Download the template (*.js) (right-click button: "Save object as ..."), add the template in the script editor with the buttonIcon Scripts.png (+) Add Script from file


    2 Set up script properties as it is shown in the example:

    function Internal_1() {
    IR.GetDevice('MQTT').SetParameters({Host: "192.168.0.95", Port: 5001, MQTTVersion: "4", ClientID: "client1", KeepAlive: 20, Clean: true, Login: "admin", Password: "admin"});
    }
    function External_1() {
    IR.GetDevice('MQTT').SetParameters({Host: "215.110.10.10", Port: 5001, MQTTVersion: "4", ClientID: "client1", KeepAlive: 20, Clean: true, Login: "admin", Password: "admin"});
    }

    Copy the driver name from Projeсt Device Panel - the list of properties has to be copied from the example.


    3 Select the button which will be responsible for the switch of Internal and External properties. Open Macros Editor for the Press event (Object Properties > Programming), select the Script Call command and add it by double-clicking on it. Select the name of the function which will be activated by the button:

    Script call internal-external.png

    Now each pressing on the button will apply the corresponding connection properties.


    Commands & Feedbacks

    Commands and feedback channels have to be assigned to graphic items to control equipment:

    • A command is assigned to a graphic item.
    • Feedback channel is assigned to a graphic item to display the variable state.


    To assign commands or channels to graphic items use the drag&drop method.


    To send a command, drag it on a graphic item. To display feedback, drag the channel on the graphic item and indicate where to output the value (Value):

    SendValue.png


    Settings

    To configure the command or feedback, you must set the following fields:

    • Topic is the MQTT path (the max size of data sent to MQTT topic is up to 268435456 bytes);
    • Value Type is the value type;
    • QoS - quality of service, guarantee that a message is delivered from the publisher to the broker:
      • At most once - no more than one time, without repetition, delivery is not guaranteed;
      • At least once - one and more times, there can be repetitions, delivery is guaranteed;
      • Exactly once - only one time, without repetition, delivery is guaranteed;
    • Retain - saving a publication: broker stores the retain topic and when new subscriptions appear sends it to subscribers with a retain flag.


    Value Types

    type description
    Boolean

    logic type (true, false)

    Signed 8-bit signed 8-bit value
    Unsigned 8-bit Unsigned 8-bit value
    Signed 16-bit Signed 16-bit value
    Unsigned 16-bit Unsigned 16-bit value
    Signed 32-bit Signed 32-bit value
    Float 32-bit Float 8-bit value
    Unsigned 32-bit Unsigned 32-bit value
    Signed 64-bit Signed 64-bit value
    Float 64-bit Float 64-bit value
    Unsigned 64-bit Unsigned 64-bit value
    String String


    A WB controller, that transmits ZigBee to MQTT, has several values in one topic. It's required to write logic via the script to display these values.

    Example:

    var device = IR.GetDevice("MQTT");
    var topic_value = 0;
    var topic_name = "Aqara001"; // the name of a feedback channels as it is written in the driver
     
    IR.AddListener(IR.EVENT_TAG_CHANGE, device, function(name, value) {
        if (name == topic_name) {
            try {
                topic_value = JSON.Parse(value); // a string comes, and it must be transformed into JSON
                var humidity = topic_value.humidity; // take only humidity from JSON
                var pressure = topic_value.pressure; // take only pressure from JSON
                var temperature = topic_value.temperature; // take only temperature from JSON
                var voltage = topic_value.voltage; // take only voltage from, JSON
                IR.Log("humidity = " + humidity);
                IR.Log("pressure = " + pressure);
                IR.Log("temperature = " + temperature);
                IR.Log("voltage = " + voltage);
            } 
            catch (err) {
                IR.Log('Invalid data')
            }
        }
    });
    Источник — «https://dev.iridi.com/index.php?title=MQTT/en&oldid=131839»
    Категория:
    • Инструкции
    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