Wb-mqtt-serial templates: различия между версиями

Строка 444: Строка 444:
</pre>
</pre>
Он описывает регистры и значения, которые однократно заносятся в эти регистры при инициализации устройства. Его можно использовать для конфигурирования устройств для работы в каком-то определенном режиме, задавать изначальные значения яркости, положения сервоприводов, состояния реле, режима работы с входами релейных модулей и т. п.
Он описывает регистры и значения, которые однократно заносятся в эти регистры при инициализации устройства. Его можно использовать для конфигурирования устройств для работы в каком-то определенном режиме, задавать изначальные значения яркости, положения сервоприводов, состояния реле, режима работы с входами релейных модулей и т. п.
----
==== WB-MAP3H ====
Устройство [WB-MAP3H_Power_Meter|WB-MAP3H] — трехканальный счетчик электроэнергии. Он измеряет большое количество параметров электрической сети. Поскольку опрос всех регистров такого устройства может занять достаточно много времени, имеется несколько шаблонов, содержащих оптимальный набор параметров для решения текущей задачи. Мы рассмотрим базовый шаблон. По ссылке "Expand" можно увидеть полный код шаблона.
<div class="mw-collapsible mw-collapsed"  style="width:500px; overflow: hidden;" >
<pre>
{
"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
  }
  ]
}
}
</pre>
</div>


====MSU34+TLP, MSU24 и MSU21 и подобные устройства====
====MSU34+TLP, MSU24 и MSU21 и подобные устройства====
5813

правок