Перейти к содержанию
Переключить боковую панель
Поиск
Поиск
Пользовательские ссылки
русский
Создать учётную запись
Персональные инструменты
expanded
collapsed
Создать учётную запись
Войти
Pages for logged out editors
узнать больше
Навигация
Вернуться на главный сайт:
wirenboard.com
Навигация
Заглавная страница
Читателям
Как внести правку или задать вопрос
Справочник по синтаксису
Инструменты
Служебные страницы
Версия для печати
Пространства имён
Перевести
Варианты
expanded
collapsed
Просмотры
Статистика по языкам
Статистика группы сообщений
Экспорт
Ещё
expanded
collapsed
Экспорт переводов
Параметры
Группа
1-Wire
ADC
ADC:Измерение сопротивлений - технические детали
Backup power for Wiren Board devices
Bluetooth
BMP085
Buzzer
CAN
CMUX
CODESYS
Consumer IR
Controller hardware revisions
CryptodevATECCx08 Auth
DDM845R
Device Tree
DI
Disassembling the controller case
Documentation
Fast Modbus
Gas sensor WB-MSGR
GPIO
Hardware Overview rev. 2.8-rus
Hardware Watchdog Disable
How To Build Linux Kernel
I/O Mapping Matrix
ILI9341
IMX233-OLinuXino-MICRO
Includes. Relay tuning
Inspektor SCADA
IntraHouse
IO modules
LAN9514
MediaWiki:Sitenotice
MOD-MRF24J40
Modbus
Modbus RTU/TCP Slave
Modbus-client
Modem-stretch
MQTT KNX V.0.1.x
NFC
Node-RED
Notification module
NRF24L01
Pin pull-up
Power Meter WB-MAP12H
Power Meter WB-MAP12H Measuring Parameters
Power Meter WB-MAP12H Measuring Registers
Power over Ethernet
Reg
Relay Module Modbus Management
RS-485
RS-485: Wiring and Connection
RS-485:Configuration via Web Interface
Rule Examples
SC16IS752
Sensors Modbus Management
Serial Port
SIM5300E
SIM68V
SIM900R
SNMP
SSH
SVG-Dashboards
TFT01-2.2SP
UART Communication Settings
UEXT-разъемы
Using Wiren Board with peripheral devices
Using Wiren Board with pulsed output devices
View controller files from your computer
Watchdog
WB 4: Errata
WB 5: Errata
WB 6: Errata
WB 7: Errata
WB AC rev. E1.0
WB AC rev. E2.0
WB Dimmers Modbus Registers Map
WB Modbus Devices Firmware Update
WB SH 3.5: Errata
WB SH 3.5: GPIO List
WB SH 3.5: UEXT2
WB-IMX233-CORE
WB-M1W2 1-Wire to Modbus Temperature Measurement Module
WB-MAI2-mini/CC 4-20mA Modbus Analog Inputs
WB-MAO4 0-10V Modbus Analog Outputs
WB-MCM16 Модуль счетных входов 16-канальный
WB-MCM8 Modbus Count Inputs
WB-MGE Modbus-Ethernet Interface Converter
WB-MIO Modbus Interface Converters
WB-MIO-Modbus-Registers
WB-MIR v1 - Modbus IR Remote Control
WB-MIR v2 - Modbus IR Remote Control
Wb-mqtt-db-cli
Wb-mqtt-serial driver
Wb-mqtt-serial templates
WB-MR3xV and WB-MR6xV Modbus Relay Modules
WB-MR6F Modbus Relay Module
WB-MR: Errata
WB-MRM2-mini Modbus Relay Modules
WB-MRPS6 Modbus Relay Modules
WB-MRWL3 Modbus Relay Modules
WB-MSW v.3 Modbus Sensor
WB-MSW v.4 Modbus Sensor
WB-MSWv 3 registers
WB-MSx Consumer IR Manual
WB-UPS Backup power supply for DIN rails
WB5 root password recovery
WB6 root password recovery
WBC-4G v.2
WBE-DI-DR-3
WBE-MICROSD Extension Module
WBE2-AO-10V-2 Analog Outputs 0-10V Extension Module
WBE2-DI-DR-3 Dry Contact Inputs Extension Module
WBE2-DO-OC-2 Open Collector Outputs Extension Module
WBE2-DO-R6C-1 Relay Extension Module
WBE2-DO-SSR-2 Dry Contact Outputs Extension Module
WBE2-I-1-WIRE 1-Wire Extension Module
WBE2-I-CAN-ISO CAN Extension Module
WBE2-I-KNX KNX Extension Module
WBE2-I-KNX: Errata
WBE2-I-RS232 RS-232 Extension Module
WBE2-I-RS485-ISO RS485 Extension Module
WBE2R-R-GPS GPS/GLONASS Extension Module
WBE2R-R-LORA v.1 Extension Module
WBE2R-R-ZIGBEE v.1 ZigBee Extension Module
WBE2S-MICROSD MicroSD Extension Module
Wbincludes:1-Wire Network
Wbincludes:1-Wire Warning
Wbincludes:Configuration MOD
Wbincludes:Configuration WBC
Wbincludes:GSM Modem Default Connection Parameters
Wbincludes:How to enter
Wbincludes:Installation MOD WBE2
Wbincludes:Installation MOD WBE2R
Wbincludes:Installing Software In Console
Wbincludes:Mount MOD
Wbincludes:Mount Relay
Wbincludes:Peripherals
Wbincludes:Relay Purpose2
Wbincludes:Revision
Wbincludes:Setup MOD
Wbincludes:WB-MSW v.3 Body Painting
Wbincludes:WB-MSW v.3 Functions
Wbincludes:WB-MSW v.4 Difference v.3
Wbincludes:WBC-4G Info
Wbincludes:WBC-4G Specifications
Wbincludes:WebUI Change Access Level
WBIO-AI-DCM-4 I/O Module
WBIO-AI-DV-12 Analog Inputs
WBIO-AI-DV-12/4-20mA Analog Inputs
WBIO-AO-10V-8 Analog Outputs 0-10V
WBIO-DI-DR-14 I/O Module
WBIO-DI-DR-16 I/O Module
WBIO-DI-DR-8 I/O Module
WBIO-DI-HVD-16 16-Channel 230V Detector Module
WBIO-DI-HVD-8 8-Channel 230V Detector Module
WBIO-DI-WD-14 Discrete Inputs
WBIO-DO-HS-8 Discrete Outputs
WBIO-DO-R10A-8 Relay Module
WBIO-DO-R10R-4 Relay Module For Roller Shutter
WBIO-DO-R1G-16 1A Relay Module
WBIO-DO-SSR-8 Discrete Outputs Dry Contact
WBMZ-BATTERY - модуль резервного питания
WBMZ2-BATTERY Backup Power Module
Wellpro
Wi-Fi Old
Wiren Board 2.8. Исходные файлы
Wiren Board 4: GPIO List
Wiren Board 4: Модуль расширения RS-232
Wiren Board 4:Аппаратная часть
Wiren Board 4:Первое включение
Wiren Board 5.1: GPIO List
Wiren Board 5.5: GPIO List
Wiren Board 5.8:Список GPIO
Wiren Board 5: Build an image to download in USB Mass-Storage mode
Wiren Board 5: GPIO List
Wiren Board 5: Восстановление прошивки
Wiren Board 5: Модуль расширения 1-Wire
Wiren Board 5: Модуль расширения ADC
Wiren Board 5: Модуль расширения GPS/Glonass
Wiren Board 5: Модуль расширения RS-232 (WBE-I-RS232)
Wiren Board 5: Модуль расширения RS485-ISO
Wiren Board 5:Аппаратная часть
Wiren Board 5:Первое включение
Wiren Board 5:Схемотехника
Wiren Board 6.1: GPIO List
Wiren Board 6.2: Peripherals
Wiren Board 6.7: Peripherals
Wiren Board 6: Hardware
Wiren Board 6: WBE2R-R-GPS GPS/GLONASS Extension Module:NTPD PPS Setup
Wiren Board 6: Модуль расширения 433MHz (WBE2S-R-433MHZ)
Wiren Board Device Modbus Address
Wiren Board Devices Modbus Management
Wiren Board NETMON-1
Wiren Board NETMON-1: GPIO List
Wiren Board NETMON-2
Wiren Board Smart Home 3.5
Wiren Board Smart Home rev. 3.5
Wiren Board Software
Wiren Board Web Interface
Wiren Board Web Interface 1.0
Wiren Board: Extension Modules
Wirenboard6:InstallingOnTheRemoteSite
Z-Wave
Zabbix
Датчик SHT1x
Движок правил wb-rules 1.7
Доступ к порту RS-485 контроллера Wiren Board с компьютера
Как разрабатывать ПО для Wiren Board
Консоль
Модули расширения
Модуль ввода-вывода с TTL-уровнями (WBIO-DIO-TTL-8)
Модуль выходов "Открытый коллектор" WBE-DO-OС-2
Модуль выходов "сухой контакт" (оптореле) WBE-DO-SSR-2
Модуль наличия напряжения (WBIO-DI-LVD-16)
Модуль наличия напряжения (WBIO-DI-LVD-8)
Модуль расширения CAN (WBE-I-CAN-ISO)
Модуль расширения CAN (WBE-I-CAN-ISO) wb6
Модуль расширения DAC (WBE-AO-10V-2)
Модуль расширения KNX (WBE-I-KNX)
Модуль релейных выходов 3A (WBIO-DO-R3A-8)
Модуль релейных выходов WBE-DO-R6C-1
ПО МКА-3
Первое включение Wiren Board
Первое включение Wiren Board Smart Home
Периферийные устройства
Периферийные устройства с интерфейсом RS-485 серии WB-xxxx
Питание USB-портов
Получение точного времени через GPS/Glonass
Потеря файлов при обновлении ПО
Работа с GPIO
Сounters Pulsar
Сборка образа
Сборка образов прошивки
Создание microSD-карты с образом
Список GPIO
Стандартный образ ФС
Уникальные идентификаторы
Управление низковольтной нагрузкой
Устарело: низкоуровневая работа с ADC в Wiren Board 2, 3 и 4
Участник:EvgenyBoger/CT309-test
Участник:EvgenyBoger/test2
Участник:EvgenyBoger/testtrans
Участник:EvgenyBoger/testtrans2
Участник:EvgenyBoger/Wbincludes:Revision
Шаблон:Node-RED Installing plugin
Шаблон:Testtrans3
Язык
aa - Afar
ab - Abkhazian
abs - Ambonese Malay
ace - Achinese
ady - Adyghe
ady-cyrl - Adyghe (Cyrillic script)
aeb - Tunisian Arabic
aeb-arab - Tunisian Arabic (Arabic script)
aeb-latn - Tunisian Arabic (Latin script)
af - Afrikaans
ak - Akan
aln - Gheg Albanian
alt - Southern Altai
am - Amharic
ami - Amis
an - Aragonese
ang - Old English
anp - Angika
ar - Arabic
arc - Aramaic
arn - Mapuche
arq - Algerian Arabic
ary - Moroccan Arabic
arz - Egyptian Arabic
as - Assamese
ase - American Sign Language
ast - Asturian
atj - Atikamekw
av - Avaric
avk - Kotava
awa - Awadhi
ay - Aymara
az - Azerbaijani
azb - South Azerbaijani
ba - Bashkir
ban - Balinese
ban-bali - ᬩᬲᬩᬮᬶ
bar - Bavarian
bbc - Batak Toba
bbc-latn - Batak Toba (Latin script)
bcc - Southern Balochi
bci - wawle
bcl - Central Bikol
be - Belarusian
be-tarask - Belarusian (Taraškievica orthography)
bg - Bulgarian
bgn - Western Balochi
bh - Bhojpuri
bho - Bhojpuri
bi - Bislama
bjn - Banjar
bm - Bambara
bn - Bangla
bo - Tibetan
bpy - Bishnupriya
bqi - Bakhtiari
br - Breton
brh - Brahui
bs - Bosnian
btm - Batak Mandailing
bto - Iriga Bicolano
bug - Buginese
bxr - Russia Buriat
ca - Catalan
cbk-zam - Chavacano
cdo - Min Dong Chinese
ce - Chechen
ceb - Cebuano
ch - Chamorro
cho - Choctaw
chr - Cherokee
chy - Cheyenne
ckb - Central Kurdish
co - Corsican
cps - Capiznon
cr - Cree
crh - Crimean Turkish
crh-cyrl - Crimean Tatar (Cyrillic script)
crh-latn - Crimean Tatar (Latin script)
cs - Czech
csb - Kashubian
cu - Church Slavic
cv - Chuvash
cy - Welsh
da - Danish
dag - Dagbani
de - German
de-at - Austrian German
de-ch - Swiss High German
de-formal - German (formal address)
din - Dinka
diq - Zazaki
dsb - Lower Sorbian
dtp - Central Dusun
dty - Doteli
dv - Divehi
dz - Dzongkha
ee - Ewe
egl - Emilian
el - Greek
eml - Emiliano-Romagnolo
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - Spanish
es-419 - Latin American Spanish
es-formal - español (formal)
et - Estonian
eu - Basque
ext - Extremaduran
fa - Persian
ff - Fulah
fi - Finnish
fit - Tornedalen Finnish
fj - Fijian
fo - Faroese
fr - French
frc - Cajun French
frp - Arpitan
frr - Northern Frisian
fur - Friulian
fy - Western Frisian
ga - Irish
gag - Gagauz
gan - Gan Chinese
gan-hans - Gan (Simplified)
gan-hant - Gan (Traditional)
gcr - Guianan Creole
gd - Scottish Gaelic
gl - Galician
glk - Gilaki
gn - Guarani
gom - Goan Konkani
gom-deva - Goan Konkani (Devanagari script)
gom-latn - Goan Konkani (Latin script)
gor - Gorontalo
got - Gothic
grc - Ancient Greek
gsw - Swiss German
gu - Gujarati
guc - Wayuu
guw - gungbe
gv - Manx
ha - Hausa
hak - Hakka Chinese
haw - Hawaiian
he - Hebrew
hi - Hindi
hif - Fiji Hindi
hif-latn - Fiji Hindi (Latin script)
hil - Hiligaynon
ho - Hiri Motu
hr - Croatian
hrx - Hunsrik
hsb - Upper Sorbian
ht - Haitian Creole
hu - Hungarian
hu-formal - magyar (formal)
hy - Armenian
hyw - Western Armenian
hz - Herero
ia - Interlingua
id - Indonesian
ie - Interlingue
ig - Igbo
ii - Sichuan Yi
ik - Inupiaq
ike-cans - Eastern Canadian (Aboriginal syllabics)
ike-latn - Eastern Canadian (Latin script)
ilo - Iloko
inh - Ingush
io - Ido
is - Icelandic
it - Italian
iu - Inuktitut
ja - Japanese
jam - Jamaican Creole English
jbo - Lojban
jut - Jutish
jv - Javanese
ka - Georgian
kaa - Kara-Kalpak
kab - Kabyle
kbd - Kabardian
kbd-cyrl - Kabardian (Cyrillic script)
kbp - Kabiye
kcg - Tyap
kg - Kongo
khw - Khowar
ki - Kikuyu
kiu - Kirmanjki
kj - Kuanyama
kjp - Eastern Pwo
kk - Kazakh
kk-arab - Kazakh (Arabic script)
kk-cn - Kazakh (China)
kk-cyrl - Kazakh (Cyrillic script)
kk-kz - Kazakh (Kazakhstan)
kk-latn - Kazakh (Latin script)
kk-tr - Kazakh (Turkey)
kl - Kalaallisut
km - Khmer
kn - Kannada
ko - Korean
ko-kp - Korean (North Korea)
koi - Komi-Permyak
kr - Kanuri
krc - Karachay-Balkar
kri - Krio
krj - Kinaray-a
krl - Karelian
ks - Kashmiri
ks-arab - Kashmiri (Arabic script)
ks-deva - Kashmiri (Devanagari script)
ksh - Colognian
ku - Kurdish
ku-arab - Kurdish (Arabic script)
ku-latn - Kurdish (Latin script)
kum - Kumyk
kv - Komi
kw - Cornish
ky - Kyrgyz
la - Latin
lad - Ladino
lb - Luxembourgish
lbe - Lak
lez - Lezghian
lfn - Lingua Franca Nova
lg - Ganda
li - Limburgish
lij - Ligurian
liv - Livonian
lki - Laki
lld - Ladin
lmo - Lombard
ln - Lingala
lo - Lao
loz - Lozi
lrc - Northern Luri
lt - Lithuanian
ltg - Latgalian
lus - Mizo
luz - Southern Luri
lv - Latvian
lzh - Literary Chinese
lzz - Laz
mad - Madurese
mai - Maithili
map-bms - Basa Banyumasan
mdf - Moksha
mg - Malagasy
mh - Marshallese
mhr - Eastern Mari
mi - Maori
min - Minangkabau
mk - Macedonian
ml - Malayalam
mn - Mongolian
mni - Manipuri
mnw - Mon
mo - Moldovan
mr - Marathi
mrh - Mara
mrj - Western Mari
ms - Malay
ms-arab - بهاس ملايو
mt - Maltese
mus - Muscogee
mwl - Mirandese
my - Burmese
myv - Erzya
mzn - Mazanderani
na - Nauru
nah - Nāhuatl
nan - Min Nan Chinese
nap - Neapolitan
nb - Norwegian Bokmål
nds - Low German
nds-nl - Low Saxon
ne - Nepali
new - Newari
ng - Ndonga
nia - Nias
niu - Niuean
nl - Dutch
nl-informal - Nederlands (informeel)
nn - Norwegian Nynorsk
no - Norwegian
nov - Novial
nqo - N’Ko
nrm - Norman
nso - Northern Sotho
nv - Navajo
ny - Nyanja
nys - Nyungar
oc - Occitan
ojb - Ojibwemowin
olo - Livvi-Karelian
om - Oromo
or - Odia
os - Ossetic
pa - Punjabi
pag - Pangasinan
pam - Pampanga
pap - Papiamento
pcd - Picard
pdc - Pennsylvania German
pdt - Plautdietsch
pfl - Palatine German
pi - Pali
pih - Norfuk / Pitkern
pl - Polish
pms - Piedmontese
pnb - Western Punjabi
pnt - Pontic
prg - Prussian
ps - Pashto
pt - Portuguese
pt-br - Brazilian Portuguese
pwn - Paiwan
qu - Quechua
qug - Chimborazo Highland Quichua
rgn - Romagnol
rif - Riffian
rm - Romansh
rmc - Carpathian Romani
rmy - Vlax Romani
rn - Rundi
ro - Romanian
roa-tara - Tarantino
ru - Russian
rue - Rusyn
rup - Aromanian
ruq - Megleno-Romanian
ruq-cyrl - Megleno-Romanian (Cyrillic script)
ruq-latn - Megleno-Romanian (Latin script)
rw - Kinyarwanda
sa - Sanskrit
sah - Sakha
sat - Santali
sc - Sardinian
scn - Sicilian
sco - Scots
sd - Sindhi
sdc - Sassarese Sardinian
sdh - Southern Kurdish
se - Northern Sami
sei - Seri
ses - Koyraboro Senni
sg - Sango
sgs - Samogitian
sh - Serbo-Croatian
shi - Tachelhit
shi-latn - Tachelhit (Latin script)
shi-tfng - Tachelhit (Tifinagh script)
shn - Shan
shy - Shawiya
shy-latn - Shawiya (Latin script)
si - Sinhala
simple - Simple English
sjd - Kildin Sami
sje - Pite Sami
sk - Slovak
skr - Saraiki
skr-arab - Saraiki (Arabic script)
sl - Slovenian
sli - Lower Silesian
sm - Samoan
sma - Southern Sami
smn - Inari Sami
sn - Shona
so - Somali
sq - Albanian
sr - Serbian
sr-ec - Serbian (Cyrillic script)
sr-el - Serbian (Latin script)
srn - Sranan Tongo
ss - Swati
st - Southern Sotho
stq - Saterland Frisian
sty - себертатар
su - Sundanese
sv - Swedish
sw - Swahili
szl - Silesian
szy - Sakizaya
ta - Tamil
tay - Tayal
tcy - Tulu
te - Telugu
tet - Tetum
tg - Tajik
tg-cyrl - Tajik (Cyrillic script)
tg-latn - Tajik (Latin script)
th - Thai
ti - Tigrinya
tk - Turkmen
tl - Tagalog
tly - Talysh
tly-cyrl - толыши
tn - Tswana
to - Tongan
tpi - Tok Pisin
tr - Turkish
tru - Turoyo
trv - Taroko
ts - Tsonga
tt - Tatar
tt-cyrl - Tatar (Cyrillic script)
tt-latn - Tatar (Latin script)
tum - Tumbuka
tw - Twi
ty - Tahitian
tyv - Tuvinian
tzm - Central Atlas Tamazight
udm - Udmurt
ug - Uyghur
ug-arab - Uyghur (Arabic script)
ug-latn - Uyghur (Latin script)
uk - Ukrainian
ur - Urdu
uz - Uzbek
uz-cyrl - Uzbek (Cyrillic script)
uz-latn - Uzbek (Latin script)
ve - Venda
vec - Venetian
vep - Veps
vi - Vietnamese
vls - West Flemish
vmf - Main-Franconian
vo - Volapük
vot - Votic
vro - Võro
wa - Walloon
war - Waray
wls - Wallisian
wo - Wolof
wuu - Wu Chinese
xal - Kalmyk
xh - Xhosa
xmf - Mingrelian
xsy - Saisiyat
yi - Yiddish
yo - Yoruba
yue - Cantonese
za - Zhuang
zea - Zeelandic
zgh - Standard Moroccan Tamazight
zh - Chinese
zh-cn - Chinese (China)
zh-hans - Simplified Chinese
zh-hant - Traditional Chinese
zh-hk - Chinese (Hong Kong)
zh-mo - Chinese (Macau)
zh-my - Chinese (Malaysia)
zh-sg - Chinese (Singapore)
zh-tw - Chinese (Taiwan)
zu - Zulu
Формат
Экспорт для оффлайнового перевода
Экспорт в родном формате
Вывести
{{DISPLAYTITLE:WB-mqtt-serial driver: examples of writing templates}}<languages/> === The general structure of the device template=== A device template file is a [https://en.wikipedia.org/wiki/JSON JSON] structure that describes device parameters. The template allows comments. The JSON structure is written inside the space between the opening and closing braces:<code> { ... }</code> The general structure of the device template is as follows: <syntaxhighlight lang="JSON"> //Device template { "device": { "Device1 parameter":"value", "Device2 parameter":"value", ... "channels": [ {channel parameters 1}, {channel parameters 2}, ...] } }</syntaxhighlight> '''Device''' is a device connected to the controller, '''channel''' is a data source: usually it is a Modbus register with a description of the data type, polling frequency, value conversion, etc. See the following sections for a detailed description: template files are stored on the controller in a folder <pre>/usr/share/wb-mqtt-serial/templates</pre> You should copy the new templates you created for the new device to this directory. In our templates, we use indents of 4 spaces per level, which ensures the readability of the template code, and we recommend writing new templates with the same indentation. === Device settings === [[File:Device_properties_mqtt_serial.png|650px|thumb|right|Device parameters are described in wb-mqtt-serial.schema.json (made via [http://www.bodurov.com/JsonFormatter/ Collapsible JSON Formatter])]] The parameters of the device are set in the form of a set of pairs ''key:value'' at the beginning of the pattern. Required parameters are "device_type" and "device" keys. The '''device_type''' key specifies a unique name for the device type as a string, for example: <syntaxhighlight lang="JSON">"device_type":"WB-MAP12H", </syntaxhighlight>. The '''device''' key value is a composite structure that describes specific device parameters: <syntaxhighlight lang="JSON"> "device": { "name": "WB-MAP12H", "id": "wb-map12h", "channels": [...] }</syntaxhighlight> * '''name''' — is the displayed name of the device. Published as<code> .../meta/name in mqtt</code>. The device name is used when displaying the web-interface, stored in the topic <code>"id" + " " + "slave_id"</code>. Example for a device with modbus address 5 (slave_id) and value <code>"name":"WB-MAP12H (basic)"</code> <code>/devices/wb-map12h_5/meta/name WB-MAP12H (basic)</code>. * '''id''' — is the unique identifier of the device to MQTT. Each item in devices must have a unique id. mqtt-topic related to this device in MQTT have a common prefix /devices/<topic ID>/... Also by default it is taken from the template with the addition of slave_id: <code>"id" + "_" + slave_id</code> <!--* '''slave_id''' — Modbus-адрес устройства. Задается в виде <code>"slave_id" : slaveID,</code>. Необязательный параметр для шаблона, slave_id задается при конкурировании устройства и уже с этим параметром включается в конфигурационный файл <cоde>/etc/wb-mqtt-serial.conf</cоde>.--> * '''channels''' — is the list of device channels, is set as <code>[...]</code>, each element represents a description of a particular channel. Other device parameters are either added to the section when the template is included in the wb-mqtt-serial general configuration, or default values are used. The full list can be found in the [https://github.com/contactless/wb-mqtt-serial/blob/master/wb-mqtt-serial.schema.json wb-mqtt-serial.schema.json] file (a copy is also stored on the controller: <code>/usr/share/wb-mqtt-confed/schemas/wb-mqtt-serial.schema.json</code>). See "device" object properties: <code>"device" -> "properties"</code>. === Device channels === [[File:Channel_properties_mqtt_serial.png|450px|thumb|right|Channel parameters are described in wb-mqtt-serial.schema.json (made in app [http://www.bodurov.com/JsonFormatter/ Collapsible JSON Formatter])]] Channel description is a structure <syntaxhighlight lang="JSON"> "channels": [ { "name": "Channel name1", ... }, { "name": "Channel name2", ... }, ... ] </syntaxhighlight> The structure contains the following set of fields. [[File:Vartype_properties_mqtt_serial.png|450px|thumb|right|the format of data representation in Modbus-registers is described in wb-mqtt-serial.schema.json (made in app [http://www.bodurov.com/JsonFormatter/ Collapsible JSON Formatter])]] * '''name''' — имя канала, уникальное для устройство имя канала * '''reg_type''' — тип Modbus-регистра, одно из "coil", "discrete", "holding", "holding_single", "holding_multi", "input", "direct" * '''address''' — адрес Modbus-регистра, связанного с каналом. * '''type''' — тип контрола -- виртуального элемента для представления данных в Web-интерфейсе контроллера: "switch", "pushbutton", "range", "rgb" и другие; полностью перечислены в схеме wb-mqtt-serial.schema.json. * '''readonly''' — "true", если значения можно только считывать. * '''format''' — тип переменной, описывающей значение, см. рис. *'''name''' — the channel name that is unique to the device *'''reg_type''' — type of Modbus register, one of "coil", "discrete", "holding", "holding_single", "holding_multi", "input", "direct" types *'''address''' — the address of the Modbus register associated with the channel. *'''type''' — type of control, a virtual element for data representation in the Web-interface of the controller: "switch", "pushbutton", "range", "rgb" and others; fully listed in the scheme wb-mqtt-serial.schema.json. *'''readonly''' — "true" if the values can only be read. *'''format''' — '''type''' of the variable describing the value, see figure. In the simplest case, the fields "name", "reg_type", "address" and "type"are sufficient. Descriptions of other parameter types are fully listed in the wb-mqtt-serial.schema.json scheme. === Examples of device templates=== The following are sample template files for some Wiren Board devices, covering a basic list of options used when creating templates. ---- ==== WB-MS-THLS v.2 ==== The [[WB-MS_Modbus_Sensor/en|WB-MS]] device is a universal combined Modbus sensor for temperature, humidity, lighting and sound pressure. The device provides access to data via Modbus input registers. The initial settings of the device are recorded in the holding registers, but are not used to obtain data and control the device, so the template is not included.You can see the full template code via the following link. <div class="mw-collapsible mw-collapsed" style="width:500px; overflow: hidden;" > <syntaxhighlight lang="JSON" highlight="6,13-15"> { "device_type": "WB-MS-THLS v.2", "device": { "name": "WB-MS / WB-MSW", "id": "wb-ms-thls-v2", "max_read_registers": 0, "channels": [ { "name": "Temperature", "reg_type": "input", "address": 0, "type": "temperature", "format": "s16", "scale": 0.1, "error_value": "0x7FFF" }, { "name": "Humidity", "reg_type": "input", "address": 1, "type": "rel_humidity", "scale": 0.1, "error_value": "0xFFFF" }, { "name": "Illuminance", "reg_type": "input", "address": 2, "type": "lux" }, { "name": "Sound Level", "reg_type": "input", "address": 3, "scale": 0.01, "type": "sound_level" }, { "name": "Input Voltage", "reg_type": "input", "address": 121, "scale": 0.001, "type": "voltage" }, { "name": "External Sensor 1", "type": "temperature", "reg_type": "input", "address": "6", "format": "s16", "scale": 0.0625, "error_value": "0x7FFF" }, { "name": "External Sensor 2", "type": "temperature", "reg_type": "input", "address": "7", "format": "s16", "scale": 0.0625, "error_value": "0x7FFF" } ] } } </syntaxhighlight> </div> There is an interesting parameter in the settings of the device: <syntaxhighlight lang="JSON"> "max_read_registers": 0,</syntaxhighlight> This parameter describes the maximum number of registers that can be read from the device when requested. The default value is 1, in our case we specify to read all registers in one pass (bulk read). In the settings of the channel "Temperature" there are three parameters that are worth paying attention to: <syntaxhighlight lang="JSON"> "format": "s16", "scale": 0.1, "error_value": "0x7FFF" </syntaxhighlight> Parameter'''"format": "s16"''' indicates that the number in the registers is represented as a signed 16-bit integer, '''"scale": 0.1''' — indicates that the value obtained from the registers should be multiplied by the scaling factor 0.1 to obtain the temperature value, and the parameter '''"error_value": "0x7FFF"''' sets the value sent from the register, indicating that an error occurred during the sensor poll. This parameter will be highlighted in red in the web interface of the controller. You should use this option if you know what value your device sends in case of an error. ---- ==== WB-MRGBW-D ==== [[WB-MRGBW-D/en|WB-MRGBW-D]] is a four channel dimmer to control the led strip. Can control RGB+W tape or four single color tapes independently. Brightness settings are stored in holding registers; the template describes which registers can be changed to get the desired brightness of the channels, track the dimmer button presses and get the value of the number of clicks.You can see the full template code via the following link. <div class="mw-collapsible mw-collapsed" style="width:500px; overflow: hidden;" > <syntaxhighlight lang="JSON" highlight="8-25"> { "device_type": "WB-MRGBW-D", "device": { "name": "WB-MRGBW-D", "id": "wb-mrgbw-d", "max_read_registers": 0, "channels": [ { "name": "RGB", "type": "rgb", "consists_of": [ { "reg_type": "holding", "address": 1 }, { "reg_type": "holding", "address": 0 }, { "reg_type": "holding", "address": 2 } ] }, { "name": "White", "reg_type": "holding", "address": 3, "type": "range", "max": 255 }, { "name": "Button 1", "reg_type": "holding", "readonly": true, "address": 6, "type": "switch" }, { "name": "Button 2", "reg_type": "holding", "readonly": true, "address": 7, "type": "switch" }, { "name": "Button 3", "reg_type": "holding", "readonly": true, "address": 8, "type": "switch" }, { "name": "Button 1 counter", "reg_type": "holding", "readonly": true, "address": 32, "type": "value" }, { "name": "Button 2 counter", "reg_type": "holding", "readonly": true, "address": 33, "type": "value" }, { "name": "Button 3 counter", "reg_type": "holding", "readonly": true, "address": 34, "type": "value" }, { "name": "Serial NO", "type": "text", "reg_type": "holding", "address": 270, "format": "u32" } ] } } </syntaxhighlight> </div> In this template, the RGB composite channel sets the brightness of three color ribbon components stored in three holding registers at the same time and is described as follows: <syntaxhighlight lang="JSON"> { "name": "RGB", "type": "rgb", "consists_of": [ { "reg_type": "holding", "address": 1 }, { "reg_type": "holding", "address": 0 }, { "reg_type": "holding", "address": 2 } ] }, </syntaxhighlight> The white channel is controlled separately, <syntaxhighlight lang="JSON"> { "name": "White", "reg_type": "holding", "address": 3, "type": "range", "max": 255 }, </syntaxhighlight> The maximum value that can be set for the white brightness slider is 255: <syntaxhighlight lang="JSON">"max": 255</syntaxhighlight> The serial number of the device (channel "Serial NO") is read as an unsigned 32-bit integer: <syntaxhighlight lang="JSON">"format": "u32"</syntaxhighlight> ---- ==== WBIO-DO-R10A-8 ==== Устройство [[WBIO-DO-R10A-8_Relay_Module/en|WBIO-DO-R10A-8]] — is a relay side module that connects directly to the controller's WBIO connector and is not Modbus controlled. But when it is connected via a WB-MIO or WB-MIO-E expansion device, it becomes a full-fledged Modbus device for which there is a corresponding template.You can see the full template code via the following link. <div class="mw-collapsible mw-collapsed" style="width:500px; overflow: hidden;" > <syntaxhighlight lang="JSON" highlight="6-15"> { "device_type": "WBIO-DO-R10A-8", "device": { "name": "WBIO-DO-R10A-8", "id": "wb-mio-gpio", "protocol": "modbus_io", "stride": 1000, "shift": 500, "max_read_registers": 0, "setup": [ { "title": "IODIR", "address": 10000, "value": "0x0000" }, { "title": "IPOL", "address": 10001, "value": "0x0000" }, { "title": "GPINTEN", "address": 10002, "value": "0xffff" }, { "title": "DEFVAL", "address": 10003, "value": "0x0000" }, { "title": "INTCON", "address": 10004, "value": "0x0000" }, { "title": "IOCON", "address": 10005, "value": "0x4444" }, { "title": "FLAG", "address": 9999, "value": 1 } ], "channels": [ { "name": "K1", "reg_type": "coil", "address": 0, "type": "switch" }, { "name": "K2", "reg_type": "coil", "address": 1, "type": "switch" }, { "name": "K3", "reg_type": "coil", "address": 2, "type": "switch" }, { "name": "K4", "reg_type": "coil", "address": 3, "type": "switch" }, { "name": "K5", "reg_type": "coil", "address": 4, "type": "switch" }, { "name": "K6", "reg_type": "coil", "address": 5, "type": "switch" }, { "name": "K7", "reg_type": "coil", "address": 6, "type": "switch" }, { "name": "K8", "reg_type": "coil", "address": 7, "type": "switch" } ] } } </syntaxhighlight> </div> In this template, you should pay attention to the following device settings. <syntaxhighlight lang="JSON"> "protocol": "modbus_io", "stride": 1000, "shift": 500, "max_read_registers": 0, "setup": [ </syntaxhighlight> Option ''' ''protocol'': ''modbus_io'' ''' indicates that the device connects to the extension module via special protocol. The parameters '''"stride": 1000''' and '''"shift":500''' set the shift of registers depending on the order in which the modules are connected to the extension module. Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift; Here stride — DeviceConfig()->Stride, a shift — DeviceConfig()->Shift. Register shift (the number to be added to the base register number) is calculated by the formula:<syntaxhighlight lang="C++">Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift;</syntaxhighlight> Здесь stride — ''DeviceConfig()->Stride'', a shift — ''DeviceConfig()->Shift''. Each connected device has a serial number (''SlaveId.Secondary'') starting with 1 for the first device. (Here the sign "%" shows modulу division.) For example, substituting the values of shift and stride in the formula: <syntaxhighlight lang="C++">Shift = ((( 1 - 1) % 4) + 1) * 500 + 1000 = (0 + 1) * 500 + 1000 = 1500</syntaxhighlight> So, you need to add 1500 to all registers specified in the template. Another important parameter — setup-section, array <syntaxhighlight lang="JSON"> "setup": [ { "title": "IODIR", "address": 10000, "value": "0x0000" }, {}, ...] </syntaxhighlight> It describes the registers and values that are entered once in these registers when the device is initialized (when WB-mqtt-serial is started or restarted). It can be used to configure devices to operate in a particular mode, set the initial values of brightness, servo position, relay status, mode of operation with the inputs of relay modules, etc. ---- ==== WB-MAP3H ==== [[WB-MAP3H_Power_Meter/en|WB-MAP3H]] — three-channel electricity meter. It measures a large number of electrical network parameters. Since it can take quite a long time to poll all registers of such a device, there are several templates that contain the optimal set of parameters for the current task. We'll look at the basic pattern. You can see the full template code via the following link. <div class="mw-collapsible mw-collapsed" style="width:500px; overflow: hidden;" > <syntaxhighlight lang="JSON" highlight="6,162-171"> { "device_type": "WB-MAP3H (basic)", "device": { "name": "WB-MAP3H (basic)", "id": "wb-map3h", "max_read_registers": 60, "channels": [ { "name": "Urms L1", "reg_type": "input", "address": "0x10d9", "type": "voltage", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "THDN U L1", "reg_type": "input", "address": "0x10f1", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "Urms L2", "reg_type": "input", "address": "0x10da", "type": "voltage", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "THDN U L2", "reg_type": "input", "address": "0x10f2", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "Urms L3", "reg_type": "input", "address": "0x10db", "type": "voltage", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "THDN U L3", "reg_type": "input", "address": "0x10f3", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "Frequency", "reg_type": "input", "address": "0x10f8", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "Voltage angle L1", "reg_type": "input", "address": "0x10fd", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 }, { "name": "Voltage angle L2", "reg_type": "input", "address": "0x10fe", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 }, { "name": "Voltage angle L3", "reg_type": "input", "address": "0x10ff", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 }, { "name": "Irms L1", "reg_type": "input", "address": "0x10dd", "type": "value", "format": "u16", "scale": 0.001, "round_to": 0.01 }, { "name": "THDN I L1", "reg_type": "input", "address": "0x10f5", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "P L1", "reg_type": "input", "address": "0x1302", "type": "power", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "Q L1", "reg_type": "input", "address": "0x130a", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "S L1", "reg_type": "input", "address": "0x1312", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "PF L1", "reg_type": "input", "address": "0x10bd", "type": "value", "format": "s16", "scale": 0.001, "round_to": 0.01 }, { "name": "AP energy L1", "reg_type": "input", "address": "0x1204", "type": "power_consumption", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "RP energy L1", "reg_type": "input", "address": "0x1224", "type": "value", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "Irms L2", "reg_type": "input", "address": "0x10de", "type": "value", "format": "u16", "scale": 0.001, "round_to": 0.01 }, { "name": "THDN I L2", "reg_type": "input", "address": "0x10f6", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "P L2", "reg_type": "input", "address": "0x1304", "type": "power", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "Q L2", "reg_type": "input", "address": "0x130c", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "S L2", "reg_type": "input", "address": "0x1314", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "PF L2", "reg_type": "input", "address": "0x10be", "type": "value", "format": "s16", "scale": 0.001, "round_to": 0.01 }, { "name": "AP energy L2", "reg_type": "input", "address": "0x1208", "type": "power_consumption", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "RP energy L2", "reg_type": "input", "address": "0x1228", "type": "value", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "Irms L3", "reg_type": "input", "address": "0x10df", "type": "value", "format": "u16", "scale": 0.001, "round_to": 0.01 }, { "name": "THDN I L3", "reg_type": "input", "address": "0x10f7", "type": "value", "format": "u16", "scale": 0.01, "round_to": 0.01 }, { "name": "P L3", "reg_type": "input", "address": "0x1306", "type": "power", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "Q L3", "reg_type": "input", "address": "0x130e", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "S L3", "reg_type": "input", "address": "0x1316", "type": "value", "format": "s32", "scale": 1.52588e-05, "round_to": 0.01 }, { "name": "PF L3", "reg_type": "input", "address": "0x10bf", "type": "value", "format": "s16", "scale": 0.001, "round_to": 0.01 }, { "name": "AP energy L3", "reg_type": "input", "address": "0x120c", "type": "power_consumption", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "RP energy L3", "reg_type": "input", "address": "0x122c", "type": "value", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "Total P", "reg_type": "input", "address": "0x1300", "type": "power", "format": "s32", "scale": 6.10352e-05, "round_to": 0.01 }, { "name": "Total Q", "reg_type": "input", "address": "0x1308", "type": "value", "format": "s32", "scale": 6.10352e-05, "round_to": 0.01 }, { "name": "Total S", "reg_type": "input", "address": "0x1310", "type": "value", "format": "s32", "scale": 6.10352e-05, "round_to": 0.01 }, { "name": "Total PF", "reg_type": "input", "address": "0x10bc", "type": "value", "format": "s16", "scale": 0.001, "round_to": 0.01 }, { "name": "Total AP energy", "reg_type": "input", "address": "0x1200", "type": "power_consumption", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "Total RP energy", "reg_type": "input", "address": "0x1220", "type": "value", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, { "name": "Phase angle L1", "reg_type": "input", "address": "0x10f9", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 }, { "name": "Phase angle L2", "reg_type": "input", "address": "0x10fa", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 }, { "name": "Phase angle L3", "reg_type": "input", "address": "0x10fb", "type": "value", "format": "s16", "scale": 0.1, "round_to": 0.01 } ] } } </syntaxhighlight> </div> What is so important in this template? First of all, we specify in the device parameters that no more than 60 registers should be read at the same time, so as not to stop for a long time the polling of other devices: '''"max_read_registers" : 60'''. Also the parameter describing the accumulated reactive energy in the phase L1 is indicative: <syntaxhighlight lang="JSON"> { "name": "RP energy L1", "reg_type": "input", "address": "0x1224", "type": "value", "format": "u64", "scale": 3.125e-05, "round_to": 0.0001, "word_order": "little_endian" }, </syntaxhighlight> Here you should pay attention to the fact that the address of the register can be set in hexadecimal form:''' "address": "0x1224" ''', the real scaling factor can be set in the exponential notation:''' "scale": 3.125 e-05'''', when reading the value round it to the desired order:''' "round_to": 0.0001''', and also take into account that the number in the Modbus-registers is stored in order from the youngest to the oldest: '''"word_order": "little_endian"'''. Storage formats for 16-bit Modbus registers are described as follows: <pre> big-endian : ( [0xAA 0xBB] [0xCC 0xDD] => 0xAABBCCDD ) little-endian : ( [0xAA 0xBB] [0xCC 0xDD] => 0xCCDDAABB ) </pre> The default format is big-endian. The types of variables used in the templates are listed in the following table: {| class="wikitable" ! Designation !! Type |- | s16 || Signed 16-bit integer |- | u16 || Unsigned 16-bit integer |- | s8 || Signed 8-bit integer |- | u8 || Unsigned 8-bit integer |- | s24 || Signed 24-bit integer |- | u24 || Unsigned 24-bit integer |- | s32 || Signed 32-bit integer |- | u32 || Unsigned 32-bit integer |- | s64 || Signed 64-bit integer |- | u64 || Unsigned 64-bit integer |- | bcd8 || 8-bit BCD |- | bcd16 || 16-bit BCD |- | bcd24 || 24-bit BCD |- | bcd32 || 32-bit BCD |- | float || IEEE754 32-bit float |- | double || IEEE754 64-bit float (double) |- | char8 || 8-bit ASCII char |} === Information resources === This article describes the basic rules for creating device templates for Wiren Board controllers. The information changes and is updated as the SOFTWARE is updated and new products are released. The most complete and up-to-date information can be found in the following sources: *in the WB-mqtt-serial service description on GitHub; *in the template files in the [https://github.com/contactless/wb-mqtt-serial/blob/master/wb-mqtt-serial.schema.json wb-mqtt-serial.schema.json] file on GitHub.