Перейти к содержанию

Навигация

Node-RED/en: различия между версиями

Нет описания правки
(Новая страница: «To set up an MQTT connection in Node-RED, follow these steps: #Drag the '''mqtt in''' node to the workspace. #Enter the node configuration and click on the '''Pencil''' next to the '''Server''' field. #On the '''Connecting''' tab, set the broker address and port number. #:In the '''Name''' field, enter any server name. #:On the '''Security''' tab, you can specify the Username and Password to connect to the broker. If the Wiren Board controller acts as a brok...»)
Метки: правка с мобильного устройства правка из мобильной версии
 
(не показано 11 промежуточных версий этого же участника)
Строка 110: Строка 110:
[[File:Installing node-red-contrib-wirenboard.PNG|500px|thumb|right| Installing WB Nodes on a Wiren Board Controller]]
[[File:Installing node-red-contrib-wirenboard.PNG|500px|thumb|right| Installing WB Nodes on a Wiren Board Controller]]
[[Image: nr+wb-settings.png |600px|thumb|right|Configuring the connection to the Wiren Board controller]]
[[Image: nr+wb-settings.png |600px|thumb|right|Configuring the connection to the Wiren Board controller]]
To simplify the interaction of Node-RED with the Wiren Board controller, the user [https://support.wirenboard.com/t/node-red-contrib-wirenboard/2019 Andrej_Popov] wrote the module <code>node-red-contrib-wirenboard</ code>.
To simplify the interaction of Node-RED with the Wiren Board controller, the user [https://support.wirenboard.com/t/node-red-contrib-wirenboard/2019 Andrej_Popov] wrote the module <code>node-red-contrib-wirenboard</code>.


=== Installation ===
=== Installation ===
Install it via [[#Node-RED Web Interface | Node-RED web interface]]:
Install it via Node-RED web-interface:
{{Node-RED Install plugin
{{Node-RED Installing plugin
|search=wireboard
|search= wirenboard
|name=node-red-contrib-wirenboard
|name= node-red-contrib-wirenboard
|en= true
}}
}}


Строка 163: Строка 164:
#Press the '''Done''' button.
#Press the '''Done''' button.


По такому же принципу настраивается нода '''mqtt out'''.
The '''mqtt out''' node is configured according to the same principle.
<gallery mode="packed" heights="150px" caption="Настройка MQTT-брокера (Server)>
<gallery mode="packed" heights="150px" caption="Configuring MQTT Broker (Server)>
Image: NodeRed_mqtt2.jpg | Вкладка ''Connecting''
Image: NodeRed_mqtt2.jpg | ''Connecting'' tab
Image: NodeRed_mqtt3.jpg | Вкладка ''Security''
Image: NodeRed_mqtt3.jpg | Tab ''Security''
</gallery>
</gallery>


=== Отправка команд ===
=== Sending commands ===
Для отправки команды контроллеру по MQTT используется нода '''mqtt out'''. При этом в поле '''Topic''' указывается адрес mqtt-топика контроллера, в который необходимо записать параметр. Нужно учитывать, что в конце адреса ноды '''mqtt out''' нужно написать <code>/on</code>, иначе параметр в топик не запишется. Например, <code>/devices/wb-mrgbw-d-fw3_129/controls/RGB Strip/on</code>. Подробнее читайте на странице [[MQTT | MQTT]].
The '''mqtt out''' node is used to send a command to the controller via MQTT. In this case, the '''Topic''' field specifies the address of the mqtt-topic of the controller, in which the parameter must be written. Please note that at the end of the node address '''mqtt out''' you need to write <code>/on</code>, otherwise the parameter will not be written to the topic. For example, <code>/devices/wb-mrgbw-d-fw3_129/controls/RGB Strip/on</code>. Read more on the [[MQTT | MQTT]].
<gallery mode="packed" heights="150px" caption="Настройка нод для работы с MQTT">
<gallery mode="packed" heights="150px" caption="Configuring nodes to work with MQTT">
Image: NodeRed_mqtt4.jpg | Пример настройки ноды '''mqtt in'''
Image: NodeRed_mqtt4.jpg | '''mqtt in''' node configuration example
Image: mqtt_out_no.jpg | Пример настройки ноды '''mqtt out'''
Image: mqtt_out_no.jpg | '''mqtt out''' node setup example
Image: NodeRed_mqtt1.jpg | Обмен данными через MQTT в Node-Red
Image: NodeRed_mqtt1.jpg | Communication via MQTT in Node-Red
</gallery>
</gallery>
Для отправки параметра в ноду '''mqtt out''' можно использовать ноду '''inject'''.
To send a parameter to the '''mqtt out''' node, you can use the '''inject''' node.
#Перетащите ноду '''inject''' в рабочую область.
#Drag the '''inject''' node to the workspace.
#Подключите ее ко входу ноды '''mqtt out'''.
#Connect it to the input of the '''mqtt out''' node.
#Зайдите в настройки ноды '''inject''' и задайте ''Имя'' ноды, ''Тип переменной'' и ее ''Значение''. Нажмите кнопку '''Done'''.
#Go to the settings of the '''inject''' node and set the ''Name'' of the node, the ''Variable Type'' and its ''Value''. Click the '''Done''' button.
<gallery mode="packed" heights="130px">
<gallery mode="packed" heights="130px">
Image: Inject1.jpg | Пример настроек ноды '''inject''' для управления дискретным параметром
Image: Inject1.jpg | An example of '''inject''' node settings for controlling a discrete parameter
Image: Inject2.jpg | Поле настройки периодов повторения отправки ноды '''inject'''
Image: Inject2.jpg | '''inject''' node retry period setting field
</gallery>
</gallery>
<gallery mode="packed" heights="100px">
<gallery mode="packed" heights="100px">
Image: Node_inject.jpg | Пример использования ноды '''inject'''
Image: Node_inject.jpg | An example of using the '''inject''' node
</gallery>
</gallery>


После настройки ввода и вывода можно обрабатывать данные внутри Node-RED и настроить использование сторонних сервисов, например, [[Node-RED_Alice | Умный дом с Алисой]].
After setting up input and output, you can process data inside Node-RED and set up the use of third-party services, for example, [[Node-RED_Alice | Smart home with Alice]].


<gallery mode="packed" heights="150px">
<gallery mode="packed" heights="150px">
Image: NodeRed_mqtt5.jpg | Пример управления с помощью Алисы
Image: NodeRed_mqtt5.jpg | Alice control example
</gallery>
</gallery>


== Примеры использования ==
== Usage examples ==
Примеры использования Node-RED с WB-Nodes на контроллерах Wiren Board:
Examples of using Node-RED with WB-Nodes on Wiren Board controllers:
* [[Node-RED_Telegram | Настройка Telegram-бота]].
* [[Node-RED_Telegram | Telegram bot settings]].
* [[Node-RED_Alice | Настройка Алисы на контроллере Wiren Board]].
* [[Node-RED_Alice | Setting up Alice on the Wiren Board controller]].
* [[Node-RED Apple HomeKit | Настройка Apple HomeKit на контроллере Wiren Board]].
* [[Node-RED Apple HomeKit | Setting up Apple HomeKit on a Wiren Board controller]].
* [[Node-RED Dashboards|Создание панелей (Dashboards) в Node-RED]].
* [[Node-RED Dashboards|Creating Dashboards in Node-RED]].
* [https://youtu.be/cKQmU4LZo4c Видео от нашего партнёра: Wiren Board + Node-RED]
* [https://youtu.be/cKQmU4LZo4c Video from our partner: Wiren Board + Node-RED]
translator, wb_editors
4268

правок