MQTT KNX V.0.1.x/en: различия между версиями
(Новая страница: «To send an individual telegram to KNX, you must send:») |
(Новая страница: «All messages from the KNX bus will be delivered to the MQTT topic /devices/knx/controls/data in the form:») |
||
Строка 58: | Строка 58: | ||
<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> | ||
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> |
Версия 20:16, 18 июля 2019
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 - Адреса KNX устройств в формате "n/n/n" или "n/n".
- APCI - Тип сообщения: строка или 4х-битное число.
- Data - Сообщение в виде байт, разделенных пробелами. Первый байт сообщения должен иметь длину не более 6 бит.
Поддерживаемые типы сообщений(APCI):
- GroupValueRead
- GroupValueResponse
- GroupValueWrite
- IndividualAddrWrite
- IndividualAddrRequest
- IndividualAddrResponse
- AdcRead
- AdcResponse
- MemoryRead
- MemoryRead
- MemoryWrite
- UserMessage
- MaskVersionRead
- MaskVersionResponse
- Restart
- Escape
- любое 4х-битное числовое значение