MQTT KNX V.0.1.x/en: различия между версиями

Материал из Wiren Board
(Новая страница: «Package: wb-mqtt-knx Source code:https://github.com/contactless/wb-mqtt-knx»)
м (FuzzyBot переименовал страницу MQTT KNX/en в MQTT KNX V.0.1.x/en без оставления перенаправления: Часть переводимой страницы MQTT KNX.)
 
(не показано 11 промежуточных версий 2 участников)
Строка 7: Строка 7:
Source code:https://github.com/contactless/wb-mqtt-knx
Source code:https://github.com/contactless/wb-mqtt-knx


wb-mqtt-knx пересылает KNX телеграммы из специализированного MQTT топика в KNX сеть и обратно. Для работы с KNX используется KNXD - https://github.com/knxd/knxd.
wb-mqtt-knx sends KNX telegrams from the specialized MQTT topic to the KNX network and back. To work with KNX, KNXD is used- https://github.com/knxd/knxd


= Установка =
= Installation=  
wb-mqtt-knx в wirenboard устанавливается через apt-get:<pre>$ apt-get install wb-mqtt-knx</pre>
wb-mqtt-knx in Wiren Board controllers is installed via apt-get:<pre>$ apt-get install wb-mqtt-knx</pre>


= Настройка =
= Setting=  
На данный момент wb-mqtt-knx не имеет конфигурационного файла.
At the moment, wb-mqtt-knx does not have a configuration file.


Информацию по настройке knxd можно найти в конфигурационном файле /etc/knxd.conf - https://github.com/knxd/knxd/blob/master/systemd/knxd.conf и в<pre>$ knxd --help</pre>
Information on setting up knxd can be found in the configuration file /etc/knxd.conf - https://github.com/knxd/knxd/blob/master/systemd/knxd.conf and in<pre>$ knxd --help</pre>


= Адреса в MQTT =
= Адреса в MQTT =
Строка 49: Строка 49:
</pre>
</pre>


== Формат MQTT сообщений ==
== Format MQTT messages ==
Чтобы отправить групповую телеграмму в KNX необходимо отправить подготовленное сообщение в MQTT топик:
To send a group telegram to KNX, you must send the prepared message to the MQTT topic:


<pre>mosquitto_pub -t '/devices/knx/controls/data/on' -m "g:${DstAddr} ${APCI} ${Data}"</pre>
<pre>mosquitto_pub -t '/devices/knx/controls/data/on' -m "g:${DstAddr} ${APCI} ${Data}"</pre>


Чтобы отправить индивидуальную телеграмму в KNX необходимо отправить:
To send an individual telegram to KNX, you must send:


<pre>mosquitto_pub -t '/devices/knx/controls/data/on' -m "i:${SrcAddr}:${DstAddr} ${APCI} ${Data}"</pre>
<pre>mosquitto_pub -t '/devices/knx/controls/data/on' -m "i:${SrcAddr}:${DstAddr} ${APCI} ${Data}"</pre>


Все сообщения из KNX будут доставлены в MQTT топик /devices/knx/controls/data в виде:
All messages from the KNX bus will be delivered to the MQTT topic /devices/knx/controls/data in the form:


<pre>i:${SrcAddr} [i,g]:${DstAddr} ${APCI} ${Data}</pre>
<pre>i:${SrcAddr} [i,g]:${DstAddr} ${APCI} ${Data}</pre>


* SrcAddr, DstAddr - Адреса KNX устройств в формате "n/n/n" или "n/n".
* SrcAddr, DstAddr - Addresses of KNX devices in the format "n/n/n" or "n/n".
* APCI - Тип сообщения: строка или 4х-битное число.
* APCI - message Type: string or 4-bit number.
* Data - Сообщение в виде байт, разделенных пробелами. Первый байт сообщения должен иметь длину не более 6 бит.
* Data - a Message in the form of bytes separated by spaces. The first byte of the message must be no longer than 6 bits.


Поддерживаемые типы сообщений(APCI):
Supported message types(APCI):


* GroupValueRead
* GroupValueRead
Строка 84: Строка 84:
* Restart
* Restart
* Escape
* Escape
* любое 4х-битное числовое значение
* Any 4-bit numeric value

Текущая версия на 20:00, 8 апреля 2022

Другие языки:


Devices using the KNX Protocol.

Package: wb-mqtt-knx Source code:https://github.com/contactless/wb-mqtt-knx

wb-mqtt-knx sends KNX telegrams from the specialized MQTT topic to the KNX network and back. To work with KNX, KNXD is used- https://github.com/knxd/knxd

Installation

wb-mqtt-knx in Wiren Board controllers is installed via apt-get:

$ apt-get install wb-mqtt-knx

Setting

At the moment, wb-mqtt-knx does not have a configuration file.

Information on setting up knxd can be found in the configuration file /etc/knxd.conf - https://github.com/knxd/knxd/blob/master/systemd/knxd.conf and in

$ knxd --help

Адреса в MQTT

Default MQTT topics are:

/devices/knx/meta/name wb-knx
/devices/knx/controls/data/meta/type data

Input data:

/devices/knx/controls/data

Outgoing data:

/devices/knx/controls/data/on

Example:

$ mosquitto_sub -t '/devices/knx/#' -v
/devices/knx/controls/data/meta/type data
/devices/knx/meta/name wb-knx

$ mosquitto_pub -t '/devices/knx/controls/data/on' -m "i:0/0/1:9/7/55 GroupValueWrite 0b110111 0xcf 14 0xff"

/devices/knx/controls/data/on i:0/0/1:9/7/55 GroupValueWrite 0b110111 0xcf 14 0xff
/devices/knx/controls/data i:0/0/1 i:9/7/55 GroupValueWrite 0x37 0xcf 0x0e 0xff

$ mosquitto_pub -t '/devices/knx/controls/data/on' -m "g:9/7/55 GroupValueRead"

/devices/knx/controls/data/on g:9/7/55 GroupValueRead
/devices/knx/controls/data i:0/0/0 g:9/7/55 GroupValueRead 0x00

Format MQTT messages

To send a group telegram to KNX, you must send the prepared message to the MQTT topic:

mosquitto_pub -t '/devices/knx/controls/data/on' -m "g:${DstAddr} ${APCI} ${Data}"

To send an individual telegram to KNX, you must send:

mosquitto_pub -t '/devices/knx/controls/data/on' -m "i:${SrcAddr}:${DstAddr} ${APCI} ${Data}"

All messages from the KNX bus will be delivered to the MQTT topic /devices/knx/controls/data in the form:

i:${SrcAddr} [i,g]:${DstAddr} ${APCI} ${Data}
  • SrcAddr, DstAddr - Addresses of KNX devices in the format "n/n/n" or "n/n".
  • APCI - message Type: string or 4-bit number.
  • Data - a Message in the form of bytes separated by spaces. The first byte of the message must be no longer than 6 bits.

Supported message types(APCI):

  • GroupValueRead
  • GroupValueResponse
  • GroupValueWrite
  • IndividualAddrWrite
  • IndividualAddrRequest
  • IndividualAddrResponse
  • AdcRead
  • AdcResponse
  • MemoryRead
  • MemoryRead
  • MemoryWrite
  • UserMessage
  • MaskVersionRead
  • MaskVersionResponse
  • Restart
  • Escape
  • Any 4-bit numeric value