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

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

    Содержание

    • 1 Legrand Netatmo Home Control
    • 2 Connection
    • 3 Integration of Module to Project
    • 4 Getting Legrand Activation Key
    • 5 Work in iRidium studio
      • 5.1 Commands & Feedbacks
      • 5.2 Setting Commands and Feedback Channels
      • 5.3 Creating Script

    Legrand Netatmo Home Control

    Legrand Netatmo Home Control is a module to work with Legrand Netatmo equipment (smart spckets, heaters, dimmers, etc.).

    documentation was last updated on 26.10.2022

    On Septermber 1, 2022 support of Legrand Netatmo Home Control was stopped. The skill is called back due to API change of Legrand manufacturer.


    Legrand Netatmo Home Control is a module to work with Legrand Netatmo equipment (smart sockets, heaters, dimmers, etc.) This module can be build in a project in iRidium studio and equipment can be controller from the i3pro app on a control panel (iOS, Android, Windows, Mac).


    A license is required.

    • AV & Custom Systems


    Download:
    • A template of a panel project
    • An example of a project (server+panel)


    Connection

    The module works via HTTP protocol. It is in the online status only when data are sent, it is offline in the remaining time. The following is required to connect to equipment:

    1 Download the Home+Control app from Play Market or App Store;

    2 Add required devices in the Home+Control app;

    3 Set the module and add required commands and feedback channels to your project.


    Integration of Module to Project

    We made a special panel project that helps to learn all devices added in the app and required commands and feedback channels for these devices. To add a module to your project, it is enough to merge project tabs and confirm merging.

    LegrandNetatmo4.png

    The module contains (main components):

    • Java Script:
      • "Driver" - the basic logic of the module is written in this script (no changes are required);
      • Script 1" - a script with examples of functions fro additional logic of a project (all descriptions to the driver are written in the script comments).
    • Devices:
      • Office (house name) - an example of a driver with commands and feedback channels to control equipment. It can be deleted after importing devices from a .json file. Additional commands and feedback channels can be added to the imported file from the table.
      • Auth - a driver responsible for authorization on the manufacturer's cloud.


    Getting Legrand Activation Key

    To get Legrand activation key, do the following:

    1 Register at Legrand official web-site;

    2 Go to the MY APPLICATIONS tab and click Create new;

    LegrandNetatmo6.png


    3 Fill in all required fields in the form to register a new app.

    It is obligatory to choose Mobile application in the Type of the application, the First Reply Url field is filled in automatically with the following link: https://eliotclouduamprd.b2clogin.com/oauth2/nativeclient

    LegrandNetatmo7.png

    It is recommended to select everything in the Scopes section for the correct work of the app.

    4 After the app is registered and approved, a letter will come to your e-mail with client id and client secret. These keys must be copied to the script of the project (see description in the Work in iRidium studio) section.

    5 Now subscribe to Api Legrand. To do it, go to the Api > SUBSCRIPTIONS > Stater Kit tab.

    LegrandNetatmo8.png

    6 Click Subscribe.

    LegrandNetatmo9.png

    7 Enter the subscription name and click Confirm.

    LegrandNetatmo10.png

    8 You are subscribed. You can see and change the keys and unsubscribe in the My Subscriptions page.

    LegrandNetatmo11.png


    Work in iRidium studio

    The module is set in several steps:

    1 Open the example of a project given above in iRidium Studio and enter client id and client secret in the Driver script.

    LegrandNetatmo12.png

    1 Start a panel project given above (project template) in the Emulator;

    2 An authorization page is displayed in the app window, where it is required to enter an e-mail address and a password of the existing Legrand account (this account is also used to authorize in the Home+Control app);

    LegrandNetatmo2.png

    3 Confirm that you give the i3 pro app access to your Legrand data;

    LegrandNetatmo3.png

    4 After access is given, a project page is opened. Click "Get JSON" button to get a list of commands and feedback channels of added equipment. The list is formed in iRidium Log in the JSON format.

    LegrandNetatmo1.png

    Example:

    "Commands":[{"Name":"Office Lamp|Set value", "Direction":1}, {"Name":"Office Lamp|Get value", "Direction":1}]
     
    "Feedbacks":[{"Name":"Office Lamp|Reachable", "Direction":2}, {"Name":"Office Lamp|Value", "Direction":2}, {"Name":"Office Lamp|Status", "Direction":2}, {"Name":"Office Lamp|Consumption type", "Direction":2}, {"Name":"Office Lamp|Consumption value", "Direction":2}]
    • Name - the name of a command/ a feedback channel. A command / a feedback channel is formed this way:

    room name + blank space (" ") + device name + vertical line ("|") + type of command / feedback channel.

    • Direction - type (1 - command, 2 - feedback channel).

    5 Copy received data into a text file and save it in the *.json format.

    6 Click Scanner / Import > Universal import from JS (*.js, *.json) in the Device tab in iRidium Studio and choose a driver saved earlier (see point 5). A driver will be added to a project with commands and feedback channels for all devices.

    LegrandNetatmo5.png


    Commands & Feedbacks

    As the driver works via HTTP protocol, to get the status of equipment it is required to send a Get request to a corresponding feedback channel.

    Legrand limits the number of requests to 1000 for every account. To decrease the number of requests, use the Get plant or Get ambientcommand, as they request all feedback channels of a device at a time, thus the number of requests is saved.

    All added commands and feedback channels are subdevided into types:

    CommandType

    Command Value* Description
    Run scene not used Start a concrete scene (used only with scenes).
    Example: Scene1|Run scene
    The name of a scene must be the same as in the Home+Control app.
    Get plant not used Get values from all feedback channels.
    Example: Get plant
    Get ambient not used Get values from feedback channels only in one room.
    Example: Kitchen|Get ambient
    Set value Value Set a value for a chosen device.
    Example: Office Lamp|Set value
    Get value not used Get a value for a chosen device.
    Example: Office Lamp|Get value
    Get json not used Get info about all commands and feedback channels of equipment in the json format (the info is displayed in project log journal).
    Example: Get json
    Authorize not used Authorize in the app with Legrand account.
    Example: Authorize
    Get token not used A service command that sends a request to get a token from a panel project (for a server project).
    Example: Get token
    Refresh token not used A service command that updates the current token forcefully.
    Example: Refresh token

    Value is a value that must be entered when a command is drag'n'dropped on an item. If an item does not use a set value, any value can be entered.


    FeedbackType

    Feedback Value* Description
    Value Value Current value.
    Example: Office Lamp|Value
    Status 0 / 1 Current value.
    Example: Office Lamp|Status
    Reachable 0 / 1 Current connection status of a device.
    Example: Office Lamp|Reachable
    Mode Text Current mode (only for automatic device).
    Example: Office Device1|Mode
    Battery 0-100 Current battery level (for a remote).
    Example: Wireless switch |Battery
    Consumption type Text Type of power consumption (Watt, Watt per hour).
    Example: Electrical cabinet Lamp|Consumption type
    Consumption value Value Current value of power consumtion.
    Example: Electrical cabinet Lamp|Consumption value
    Out of commands 0 / 1 A message about exceeding the limit of requests per day (0 - not exceeded, 1 - exceeded).
    Example: Out of commands
    Out of commands message Text A message about exceeding the limit of requests per day
    Example: Out of commands
    Need authorize Text A message with an authorization request.
    Example: Need authorize

    Value is a value that a feedback channel will display on a graphic item.


    Setting Commands and Feedback Channels

    SendRecieve.png

    To control equipment it is required to set commands (Commands) and feedback channels (Feedbacks). To send a command, drag'n'drop it on a graphic item and enter a value to send. To display feedback, drag'n'drop a feedback channel on a graphic item and choose how to output or display a value.


    Read more about work with graphic items in the "Types of graphic items" article.


    Creating Script

    Script 1 contains templates of functions that can be used to transform values of feedback channels (text value of a feedback channel can be transformed to a numerical one and vice versa) and to create additional logic in a project (for example, to send a push-notification when the number of requests is exceeded).

    How to do it:

    1 Replace the name of the "Office" driver into the name of your house that was added with the help of device import in the first line;

    var l_oTest = new Legrand.Netatmo(IR.GetDevice("Office"), IR.GetDevice("Auth"), true);

    2 Use the template of given functions to create logic:

    l_oTest.onCommandsLimit = function() {
        //do something
    }
    l_oTest.onModeReceive = function(in_sName, in_sText) {
        return in_sText
    }
    l_oTest.onBatteryReceive = function(in_sName, in_sText) {
        return in_sText
    }
    • .onCommandsLimit - actions to limit the number of attempts to get values;
    • .onModeReceive - used to transform received values (for equipment of the "Heater" type);
    • .onBatteryReceive(in_sText) - serves to transform received values (for equipment of the "Battery" type).


    Example 1 (sending push notifications to a panel when the limit of requests is exceeded):

    l_oTest.onCommandsLimit = function() {
        IR.SendPush('You have reached limit for commands', '', 1);
    }


    Пример 2 (transforming a text value into a numeric one):

    • in_sName - device name (till the vertical line);
    • in_sText - received value.
    l_oTest.onBatteryReceive = function(in_sName, in_sText) {
    	var l_Value = in_sText;
    	if(in_sName == 'Room 1 Light 1') {
    		l_Value = 0;
    		switch(in_sText) {
    			case "full":
    				l_Value = 0;
    				break;
    			case "high":
    				l_Value = 1;
    				break;
    			case "medium":
    				l_Value = 2;
    				break;
    			case "low":
    				l_Value = 3;
    				break;
    			case "very_low":
    				l_Value = 4;
    				break;
    			case "unknown":
    				l_Value = 5;
    				break;
    		    }
    		} 
    	return l_Value;
    }
    Источник — «https://dev.iridi.com/index.php?title=Legrand_Netatmo/en&oldid=125091»
    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