Using the Watteco codec API with NodeRED

Using the Watteco codec API with NodeRED >1.3.0

En Français

The first step is to set-up a Javascript node to import the module you need via npm.
You'll find the modules list here or in the table on the Github Readme.
To set that up, add the module in the "Setup" tab of the Javascript node.

Setup tab

You will then be able to call it from the node like this: moduleName.driver.decodeUplink(input)
with the input being in the format:

{
    "bytes": [17, 10, 4, 2, 0, 0, 41, 11, 137],  // The frame in a bytes list
    "fPort": 125,                                // The port (Watteco always use 125)
    "recvTime": "2023-07-19T07:51:31.598957793Z" // The date in ISO 8601 format
}

You'll find an example of decoding a base64 Vaqa'o+ batch frame below, you can directly import it to NodeRED via the Import button in the right menu.

Vaqa'o+ NodeRED (>1.3.0) decoding example

[
    {
        "id": "40642e89c9349958",
        "type": "tab",
        "label": "Vaqa'o+ decoding example",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "6e327578ec437d82",
        "type": "inject",
        "z": "40642e89c9349958",
        "name": "Sample Vaqa'o+ batch base64 frame",
        "props": [
            {
                "p": "payload.data",
                "v": "cAYAAOJ2AJDPwAFbAoQj+wMnKRmATBIcAD68W9aJXwBAAAtotywnoN203IB225IMaLcsGWBbBA==",
                "vt": "str"
            },
            {
                "p": "payload.time",
                "v": "",
                "vt": "date"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 200,
        "y": 100,
        "wires": [
            [
                "adb486ffd01f5a71"
            ]
        ]
    },
    {
        "id": "bcdb552b5eca5eda",
        "type": "debug",
        "z": "40642e89c9349958",
        "name": "Output",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 550,
        "y": 100,
        "wires": []
    },
    {
        "id": "adb486ffd01f5a71",
        "type": "function",
        "z": "40642e89c9349958",
        "name": "decode",
        "func": "// You must import the sensor decoder from npm via the configuration tab above\n// Don't forget to set \"functionExternalModules: true,\" in your \"settings.js\" file\n\nif (msg.payload.data && typeof msg.payload.data === 'string') {\n\n    const buffer = Buffer.from(msg.payload.data, 'base64'); // The frame arrives in base64 in msg.payload.data\n\n    var date = new Date(msg.payload.time); // The date is recuperated from msg.payload.time\n                                          // under any format and is transformed to ISO 8601\n    var inputObject = {\n        \"bytes\": buffer, // The frame in a bytes list\n        \"fPort\": 125,    // The port (Watteco always use 125)\n        \"recvTime\": date // The date in ISO 8601 format\n    }\n\n} else {\n    node.error(\"The message doesn't carry a Base64 frame\");\n    return null;\n}\n\nmsg.payload = wattecoVaqaOPlus.driver.decodeUplink(inputObject);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "wattecoVaqaOPlus",
                "module": "watteco-vaqa_o_plus"
            }
        ],
        "x": 420,
        "y": 100,
        "wires": [
            [
                "bcdb552b5eca5eda"
            ]
        ]
    }
]

Using the Watteco codec API with NodeRED <1.3.0

En Français

The first step is to import manually the codec into a Javascript node.
You'll find all the codecs, by sensor, here.
Choose your sensor, then copy the content of the corresponding main.js file and simply paste it at the beginning of your javascript node.

You'll need to remove the export section exports.driver=driver at the end of the newly inserted code.

From this:

…{return result=t.watteco_decodeUplink(e,a,n)}})(),driver=i})();exports.driver=driver //remove from "exports" to the end

To this:

…{return result=t.watteco_decodeUplink(e,a,n)}})(),driver=i})();

You will then be able to call it from the node like this: driver.decodeUplink(input)
with the input being in the format:

{
    "bytes": [17, 10, 4, 2, 0, 0, 41, 11, 137],  // The frame in a bytes list
    "fPort": 125,                                // The port (Watteco always use 125)
    "recvTime": "2023-07-19T07:51:31.598957793Z" // The date in ISO 8601 format
}

You'll find an example of decoding a base64 Vaqa'o+ batch frame below, you can directly import it to NodeRED via the Import button in the right menu.

Vaqa'o+ NodeRED (<1.3.0) decoding example

[
     {
         "id": "40642e89c9349958",
         "type": "tab",
         "label": "Vaqa'o+ decoding example",
         "disabled": false,
         "info": "",
         "env": []
     },
     {
         "id": "6e327578ec437d82",
         "type": "inject",
         "z": "40642e89c9349958",
         "name": "Sample Vaqa'o+ batch base64 frame",
         "props": [
             {
                 "p": "payload.data",
                 "v": "cAYAAOJ2AJDPwAFbAoQj+wMnKRmATBIcAD68W9aJXwBAAAtotywnoN203IB225IMaLcsGWBbBA==",
                 "vt": "str"
             },
             {
                 "p": "payload.time",
                 "v": "",
                 "vt": "date"
             }
         ],
         "repeat": "",
         "crontab": "",
         "once": false,
         "onceDelay": 0.1,
         "topic": "",
         "x": 200,
         "y": 100,
         "wires": [
             [
                 "adb486ffd01f5a71"
             ]
         ]
     },
     {
         "id": "bcdb552b5eca5eda",
         "type": "debug",
         "z": "40642e89c9349958",
         "name": "Output",
         "active": true,
         "tosidebar": true,
         "console": false,
         "tostatus": false,
         "complete": "payload",
         "targetType": "msg",
         "statusVal": "",
         "statusType": "auto",
         "x": 550,
         "y": 100,
         "wires": []
     },
     {
         "id": "adb486ffd01f5a71",
         "type": "function",
         "z": "40642e89c9349958",
         "name": "decode",
         "func": "// You must paste below the imported \"main.js\" file from https://github.com/Watteco/Codec-API-LoRaWAN/tree/main/distrib (here /vaqa'o_plus/main.js)\n// Remove \"exports.driver=driver\" from the end of the line.\n\nvar driver; (() => { var t = { 580: e => { let t = 6, a = 10, i = 12, r = { 0: 0, 1: 1, 2: 4, 3: 4, 4: 8, 5: 8 }; r[t] = 16, r[7] = 16, r[8] = 24, r[9] = 24, r[a] = 32, r[11] = 32, r[i] = 32; let n = 14, o = [[{ sz: 2, lbl: 0 }, { sz: 2, lbl: 1 }, { sz: 2, lbl: 3 }, { sz: 3, lbl: 5 }, { sz: 4, lbl: 9 }, { sz: 5, lbl: 17 }, { sz: 6, lbl: 33 }, { sz: 7, lbl: 65 }, { sz: 8, lbl: 129 }, { sz: 10, lbl: 512 }, { sz: 11, lbl: 1026 }, { sz: 11, lbl: 1027 }, { sz: 11, lbl: 1028 }, { sz: 11, lbl: 1029 }, { sz: 11, lbl: 1030 }, { sz: 11, lbl: 1031 }], [{ sz: 7, lbl: 111 }, { sz: 5, lbl: 26 }, { sz: 4, lbl: 12 }, { sz: 3, lbl: 3 }, { sz: 3, lbl: 7 }, { sz: 2, lbl: 2 }, { sz: 2, lbl: 0 }, { sz: 3, lbl: 2 }, { sz: 6, lbl: 54 }, { sz: 9, lbl: 443 }, { sz: 9, lbl: 441 }, { sz: 10, lbl: 885 }, { sz: 10, lbl: 884 }, { sz: 10, lbl: 880 }, { sz: 11, lbl: 1763 }, { sz: 11, lbl: 1762 }], [{ sz: 4, lbl: 9 }, { sz: 3, lbl: 5 }, { sz: 2, lbl: 0 }, { sz: 2, lbl: 1 }, { sz: 2, lbl: 3 }, { sz: 5, lbl: 17 }, { sz: 6, lbl: 33 }, { sz: 7, lbl: 65 }, { sz: 8, lbl: 129 }, { sz: 10, lbl: 512 }, { sz: 11, lbl: 1026 }, { sz: 11, lbl: 1027 }, { sz: 11, lbl: 1028 }, { sz: 11, lbl: 1029 }, { sz: 11, lbl: 1030 }, { sz: 11, lbl: 1031 }]]; function d(e, t, a, i) { return { uncompressSamples: [{ data_relative_timestamp: i, data: { value: (e, t), label: a } }], codingType: 0, codingTable: 0, resolution: null } } function l(e, t) { for (let a = 0; a < e.length; a++)if (e[a].taglbl === t.lbl) return a; throw new Error(\"Batch : Cannot find i1 in argList\") } function s(e, t) { if (t) { let a = e.getNextBifromHi(1); return u(e, t, a) } return e.getNextSample(a) } function u(e, t, i) { return i > n ? e.getNextSample(a) : i > 0 ? function (e, t, i) { return e.getNextSample(a, i) + t + Math.pow(2, i) - 1 }(e, t, i) : t } function (e, t) { let a = e.getNextSample(t); return t === i ? function (e) { let t = 2147483648 & e ? -1 : 1, a = (e >> 23 & 255) - 127, i = 8388607 & e; if (128 === a) return t * (i ? Number.NaN : Number.POSITIVE_INFINITY); if (-127 === a) { if (0 === i) return 0 * t; a = -126, i /= 1 << 22 } else i = (i | 1 << 23) / (1 << 23); return t * i * Math.pow(2, a) }(a) : a } function c(e, a, i, r, n) { let o = e.getNextSample(t, n); return 0 === i ? function (e, t, a, i) { return e >= Math.pow(2, i - 1) ? e * t + a : (e + 1 - Math.pow(2, i)) * t + a }(o, r, a, n) : 1 === i ? (o + Math.pow(2, n) - 1) * r + a : a - (o + (Math.pow(2, n) - 1)) * r } Math.trunc = Math.trunc || function (e) { return isNaN(e) ? NaN : e > 0 ? Math.floor(e) : Math.ceil(e) }, e.exports = { normalisation_batch: function (e) { let t = e.date, _ = function (e, t, , p) { let m = function () { let e = [], t = 0; for (; t < 16;)e.push({ codingType: 0, codingTable: 0, resolution: null, uncompressSamples: [] }), t += 1; return { batch_counter: 0, batch_relative_timestamp: 0, series: e } }(), f = function (e) { function t(e, t, a) { let i = t, r = a - 1; if (8 * e.length < i + a) throw new Error(\"Batch : Verify that dest buf is large enough\"); let n = 0, o = 0; for (; a > 0;)e[i >> 3] & 1 << (7 & i) && (o |= 1 << r - n), a--, n++, i++; return o } return { i1: 0, byteArray: e, getNextSample: function (e, t) { let a = t || r[e], n = this.i1; if (this.i1 += a, e === i && 32 !== a) throw new Error(\"Batch : Mauvais sampletype\"); let o = 0, d = Math.trunc((a - 1) / 8) + 1, l = a % 8; for (0 === l && d > 0 && (l = 8); d > 0;) { let e = 0; for (; l > 0;) { let t = n >> 3; this.byteArray[t] & 1 << (7 & n) && (o |= 1 << 8 * (d - 1) + e), l--, e++, n += 1 } d--, l = 8 } if ((3 == e || 5 == e || 7 == e || 9 == e) && o & 1 << a - 1) for (let e = a; e < 32; e++)o |= 1 << e, a++; return o }, getNextBifromHi: function (e) { for (let a = 2; a < 12; a++) { let i = t(this.byteArray, this.i1, a); for (let t = 0; t < o[e].length; t++)if (o[e][t].sz == a && i == o[e][t].lbl) return this.i1 += a, t } throw new Error(\"Bi not found in HUFF table\") } } }(function (e) { for (var t = []; e.length >= 2;)t.push(parseInt(e.substring(0, 2), 16)), e = e.substring(2, e.length); return t }()), g = function (e) { let t = e.toString(2); for (; t.length < 8;)t = \"0\" + t; return { isCommonTimestamp: parseInt(t[t.length - 2], 2), hasSample: !parseInt(t[t.length - 3], 2), batch_req: parseInt(t[t.length - 4], 2), nb_of_type_measure: parseInt(t.substring(0, 4), 2) } }(f.getNextSample(4)); m.batch_counter = f.getNextSample(4, 3), f.getNextSample(4, 1); let E = function (e, t, a, i, r) { let n = 0, o = 0; for (let u = 0; u < i.nb_of_type_measure; u++) { let _ = { size: r, lbl: t.getNextSample(4, r) }, c = l(a, ); 0 === u && (o = c), n = s(t, n), e.series[c] = d(t, a[c].sampletype, .lbl, n), i.hasSample && (e.series[c].codingType = t.getNextSample(4, 2), e.series[c].codingTable = t.getNextSample(4, 2)) } return { last_timestamp: n, i1_of_the_first_sample: o } }(m, f, t, g, e), P = E.last_timestamp, v = E.i1_of_the_first_sample; return g.hasSample && (P = function (e, t, i, r, o, d, s) { return d.isCommonTimestamp ? function (e, t, i, r, o, d) { let s = t.getNextSample(4, 8), u = {}, _ = function (e, t, i, r) { let o = [], d = 0, l = t.getNextSample(4, 2); for (let s = 0; s < i; s++) { let i = t.getNextBifromHi(l); if (i <= n) if (0 === s) o.push(e.series[r].uncompressSamples[0].data_relative_timestamp); else if (i > 0) { let e = o[s - 1]; o.push(t.getNextSample(a, i) + e + Math.pow(2, i) - 1) } else o.push(precedingTimestamp); else o.push(t.getNextSample(a)); d = o[s] } return { timestampCommon: o, lastTimestamp: d } }(e, t, s, i), p = .timestampCommon, m = .lastTimestamp; for (let a = 0; a < o.nb_of_type_measure; a++) { let a = 1; u.lbl = t.getNextSample(4, d); let i = l(r, u); for (let o = 0; o < s; o++)if (t.getNextSample(4, 1)) { let d = t.getNextBifromHi(e.series[i].codingTable), l = { data_relative_timestamp: 0, data: {} }; if (d <= n) { let n = e.series[i].uncompressSamples[e.series[i].uncompressSamples.length - 1].data.value; if (d > 0) l.data.value = c(t, n, e.series[i].codingType, r[i].resol, d); else { if (a) { a = 0; continue } l.data.value = n } } else l.data.value = t.getNextSample(r[i].sampletype); l.data_relative_timestamp = p[o], e.series[i].uncompressSamples.push(l) } } return m }(e, t, i, r, d, s) : function (e, t, a, i, r, o) { let d = {}; for (let s = 0; s < r.nb_of_type_measure; s++) { d.lbl = t.getNextSample(4, o); let r = l(a, d), s = t.getNextSample(4, 8); if (s) { let o = t.getNextSample(4, 2); for (let d = 0; d < s; d++) { let d = e.series[r].uncompressSamples[e.series[r].uncompressSamples.length - 1].data_relative_timestamp, l = { data_relative_timestamp: 0, data: {} }, s = t.getNextBifromHi(o); if (l.data_relative_timestamp = u(t, d, s), l.data_relative_timestamp > i && (i = l.data_relative_timestamp), s = t.getNextBifromHi(e.series[r].codingTable), s <= n) { let i = e.series[r].uncompressSamples[e.series[r].uncompressSamples.length - 1].data.value; l.data.value = s > 0 ? c(t, i, e.series[r].codingType, a[r].resol, s) : i } else l.data.value = t.getNextSample(a[r].sampletype); e.series[r].uncompressSamples.push(l) } } } return i }(e, t, r, o, d, s) }(m, f, v, t, P, g, e)), m.batch_relative_timestamp = s(f, P), function (e, t, a) { let i = { batch_counter: e.batch_counter, batch_relative_timestamp: e.batch_relative_timestamp }; return a && (i.batch_absolute_timestamp = a), i.dataset = e.series.reduce((function (i, r, n) { return i.concat(r.uncompressSamples.map((function (i) { let r = { data_relative_timestamp: i.data_relative_timestamp, data: { value: t[n].divide ? i.data.value / t[n].divide : i.data.value, label: t[n].taglbl } }; var o, d, l; return t[n].lblname && (r.data.label_name = t[n].lblname), a && (r.data_absolute_timestamp = (o = a, d = e.batch_relative_timestamp, l = i.data_relative_timestamp, new Date(new Date(o) - 1e3 * (d - l)).toISOString())), r }))) }), []), i }(m, t, p) }(e.batch1, e.batch2, e.payload, t), p = []; for (let e = 0; e < .dataset.length; e++) { let t = .dataset[e], a = { variable: t.data.label_name, value: t.data.value, date: t.data_absolute_timestamp }; p.push(a) } return p } } }, 13: (e, t, a) => { const i = a(794), r = a(580); e.exports = { watteco_decodeUplink: function (e, t, a) { e.bytes, e.fPort; let n = e.recvTime; try { let o = i.normalisation_standard(e, a), d = o.payload; if (\"batch\" !== o.type) return { data: o.data, warnings: o.warning }; { let e = { batch1: t[0], batch2: t[1], payload: d, date: n }; try { return { data: r.normalisation_batch(e), warnings: [] } } catch (e) { return { error: e.message, warnings: [] } } } } catch (e) { return { error: e.message, warnings: [] } } } } }, 794: t => { class a extends Error { constructor(e) { super(e), this.name = \"ValidationError\" } } let i = { 16: { name: \"boolean\", size: 1 }, 8: { name: \"general8\", size: 1 }, 9: { name: \"general16\", size: 2 }, 10: { name: \"general24\", size: 3 }, 11: { name: \"general32\", size: 4 }, 24: { name: \"bitmap8\", size: 1 }, 25: { name: \"bitmap16\", size: 2 }, 32: { name: \"uint8\", size: 1 }, 33: { name: \"uint16\", size: 2 }, 34: { name: \"uint24\", size: 3 }, 35: { name: \"uint32\", size: 4 }, 40: { name: \"int8\", size: 1 }, 41: { name: \"int16\", size: 2 }, 43: { name: \"int32\", size: 4 }, 48: { name: \"enum8\", size: 1 }, 66: { name: \"char string\", size: 1 }, 65: { name: \"bytes string\", size: 1 }, 67: { name: \"long bytes string\", size: 2 }, 76: { name: \"structured ordered sequence\", size: 2 }, 57: { name: \"single\", size: 4 } }, r = { 32778: { 0: { 0: { divider: 1, function_type: \"int\", name: \"positive_active_energy\", size: 4 }, 1: { divider: 1, function_type: \"int\", name: \"negative_active_energy\", size: 4 }, 2: { divider: 1, function_type: \"int\", name: \"positive_reactive_energy\", size: 4 }, 3: { divider: 1, function_type: \"int\", name: \"negative_reactive_energy\", size: 4 }, 4: { divider: 1, function_type: \"int\", name: \"positive_active_power\", size: 4 }, 5: { divider: 1, function_type: \"int\", name: \"negative_active_power\", size: 4 }, 6: { divider: 1, function_type: \"int\", name: \"positive_reactive_power\", size: 4 }, 7: { divider: 1, function_type: \"int\", name: \"negative_reactive_power\", size: 4 } } }, 32784: { 0: { 0: { divider: 1, function_type: \"int\", name: \"active_energy_a\", size: 4 }, 1: { divider: 1, function_type: \"int\", name: \"reactive_energy_a\", size: 4 }, 2: { divider: 1, function_type: \"int\", name: \"active_energy_b\", size: 4 }, 3: { divider: 1, function_type: \"int\", name: \"reactive_energy_b\", size: 4 }, 4: { divider: 1, function_type: \"int\", name: \"active_energy_c\", size: 4 }, 5: { divider: 1, function_type: \"int\", name: \"reactive_energy_c\", size: 4 }, 6: { divider: 1, function_type: \"int\", name: \"active_energy_abc\", size: 4 }, 7: { divider: 1, function_type: \"int\", name: \"reactive_energy_abc\", size: 4 } }, 1: { 0: { divider: 1, function_type: \"int\", name: \"active_power_a\", size: 4 }, 1: { divider: 1, function_type: \"int\", name: \"reactive_power_a\", size: 4 }, 2: { divider: 1, function_type: \"int\", name: \"active_power_b\", size: 4 }, 3: { divider: 1, function_type: \"int\", name: \"reactive_power_b\", size: 4 }, 4: { divider: 1, function_type: \"int\", name: \"active_power_c\", size: 4 }, 5: { divider: 1, function_type: \"int\", name: \"reactive_power_c\", size: 4 }, 6: { divider: 1, function_type: \"int\", name: \"active_power_abc\", size: 4 }, 7: { divider: 1, function_type: \"int\", name: \"reactive_power_abc\", size: 4 } } }, 32779: { 0: { 0: { divider: 10, function_type: \"int\", name: \"Vrms\", size: 2 }, 1: { divider: 10, function_type: \"int\", name: \"Irms\", size: 2 }, 2: { divider: 1, function_type: \"int\", name: \"angle\", size: 2 } } }, 32781: { 0: { 0: { divider: 10, function_type: \"int\", name: \"Vrms_a\", size: 2 }, 1: { divider: 10, function_type: \"int\", name: \"Irms_a\", size: 2 }, 2: { divider: 1, function_type: \"int\", name: \"angle_a\", size: 2 }, 3: { divider: 10, function_type: \"int\", name: \"Vrms_b\", size: 2 }, 4: { divider: 10, function_type: \"int\", name: \"Irms_b\", size: 2 }, 5: { divider: 1, function_type: \"int\", name: \"angle_b\", size: 2 }, 6: { divider: 10, function_type: \"int\", name: \"Vrms_c\", size: 2 }, 7: { divider: 10, function_type: \"int\", name: \"Irms_c\", size: 2 }, 8: { divider: 1, function_type: \"int\", name: \"angle_c\", size: 2 } } }, 32850: { 0: { 0: { divider: 1e3, function_type: \"int\", name: \"frequency\", size: 2 }, 1: { divider: 1e3, function_type: \"int\", name: \"frequency_min\", size: 2 }, 2: { divider: 1e3, function_type: \"int\", name: \"frequency_max\", size: 2 }, 3: { divider: 10, function_type: \"int\", name: \"Vrms\", size: 2 }, 4: { divider: 10, function_type: \"int\", name: \"Vrms_min\", size: 2 }, 5: { divider: 10, function_type: \"int\", name: \"Vrms_max\", size: 2 }, 6: { divider: 10, function_type: \"int\", name: \"Vpeak\", size: 2 }, 7: { divider: 10, function_type: \"int\", name: \"Vpeak_min\", size: 2 }, 8: { divider: 10, function_type: \"int\", name: \"Vpeak_max\", size: 2 }, 9: { divider: 1, function_type: \"int\", name: \"over_voltage\", size: 2 }, 10: { divider: 1, function_type: \"int\", name: \"sag_voltage\", size: 2 } } }, 32773: { 0: { 0: { divider: 1, function_type: \"none\", name: \"pin_state_1\", size: 1 }, 1: { divider: 1, function_type: \"none\", name: \"pin_state_2\", size: 1 }, 2: { divider: 1, function_type: \"none\", name: \"pin_state_3\", size: 1 }, 3: { divider: 1, function_type: \"none\", name: \"pin_state_4\", size: 1 }, 4: { divider: 1, function_type: \"none\", name: \"pin_state_5\", size: 1 }, 5: { divider: 1, function_type: \"none\", name: \"pin_state_6\", size: 1 }, 6: { divider: 1, function_type: \"none\", name: \"pin_state_7\", size: 1 }, 7: { divider: 1, function_type: \"none\", name: \"pin_state_8\", size: 1 }, 8: { divider: 1, function_type: \"none\", name: \"pin_state_9\", size: 1 }, 9: { divider: 1, function_type: \"none\", name: \"pin_state_10\", size: 1 } } }, 80: { 6: { 0: { divider: 1e3, function_type: \"none\", name: \"power_modes\", size: 2 }, 1: { divider: 1e3, function_type: \"none\", name: \"current_power_source\", size: 2 }, 2: { divider: 1e3, function_type: \"none\", name: \"constant_power\", size: 2 }, 3: { divider: 1e3, function_type: \"none\", name: \"rechargeable_battery\", size: 2 }, 4: { divider: 1e3, function_type: \"none\", name: \"disposable_battery\", size: 2 }, 5: { divider: 1e3, function_type: \"none\", name: \"solar_harvesting\", size: 2 }, 6: { divider: 1e3, function_type: \"none\", name: \"TIC_harvesting\", size: 2 } } } }; function o(e, t) { return 2 === t && (32768 & e) > 0 && (e -= 65536), 3 === t && (8388608 & e) > 0 && (e -= 16777216), 4 === t && (2147483648 & e) > 0 && (e -= 4294967296), e } function l(e) { let t = 2147483648 & e ? -1 : 1, a = (e >> 23 & 255) - 127, i = 8388607 & e; if (128 === a) return t * (i ? Number.NaN : Number.POSITIVE_INFINITY); if (-127 === a) { if (0 === i) return 0; a = -126, i /= 1 << 23 } else i = (i | 1 << 23) / (1 << 23); return t * i * Math.pow(2, a) } function u(e, t, a, i) { void 0 === i && (i = !1); let r, n, o = \"U\" != a.substr(0, 1), d = parseInt(a.substr(1, 2), 10) / 8, l = d; for (i ? (r = -1, n = t + d - 1) : r = 1, n = t, tmpInt64 = 0, j = n; l > 0; j += r, l--)tmpInt64 = (tmpInt64 << 8) + e[j]; return o && d < 8 && 128 & e[n] && (tmpInt64 -= 1 << 8 * d), tmpInt64 } function (e, t) { let a = e.toString(16).toUpperCase(); for (t = null == t ? t = 2 : t; a.length < t;)a = \"0\" + a; return \"0x\" + a } function c(e, t) { return String(e).padStart(t, \"0\") } function p(e) { return \"\" + c(e.toString(2), 8) } function f(e) { return parseInt(e, 2) } function g(e, t, a, i, r, n) { let o = 0; for (; 0 === a;) { let d = i[n + e * o]; if (void 0 === d) { r.zclheader.alarmmsg = t, a = 1; break } let l = p(d), s = 4 * f(l[5]) + 2 * f(l[6]) + f(l[7]), u = !0; if (\"0\" === l[0] && (u = !1), \"1\" === l[3] && \"0\" === l[4]) { let e = \"\"; e = \"1\" === l[1] ? \"exceed\" : \"fall\"; let a = \"cause:{alarm:\" + u + \", criterion_index: \" + s + \", mode: threshold, crossing: \" + e + \"}\"; t.push(a) } if (\"0\" === l[3] && \"1\" === l[4]) { let e = \"cause:{alarm:\" + u + \", criterion_index: \" + s + \", mode: delta}\"; t.push(e) } o += 1 } } function E(e, t, a, n, d, s, u, , c, m, g, E) { let P = i[c], v = g, h = 0, S = P.size, b = P.name; void 0 !== E && (h = 1, S = r[e][t][E].size), 2 === S ? function (e, t, a, i, n, d, s, u, , c, m, g) { let E = 0, P = 0, v = 0, h = 0, S = 0, b = 0; 1 === c && (e += 1, b = 1), void 0 ===  && (_ = \"single\" === u ? \"float\" : \"int8\" === u || \"int16\" === u || \"int32\" === u ? \"int\" : \"none\"); let z = i[d + e * E]; for (void 0 === z && (n.zclheader.alarmmsg = t, a = 1); 0 === a;) { if (1 === c) { let t = i[d + e * E + 1 + S]; s = r[m][g][t].divider, _ = r[m][g][t].function_type } let u = p(z), A = 4 * f(u[5]) + 2 * f(u[6]) + f(u[7]), y = !0; if (\"0\" === u[0] && (y = !1), \"1\" === u[3] && \"0\" === u[4]) { let a = \"\", n = \"\", c = \"\", f = \"\"; if (f = \"1\" === u[1] ? \"exceed\" : \"fall\", 0 === b) \"none\" === _ ? (a = ((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E + S]) / s).toString(), c = ((256 * i[d + 3 + e * E + S] + i[d + 4 + e * E + S]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E + S]) / s).toString(), c = o((256 * i[d + 3 + e * E + S] + i[d + 4 + e * E + S]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E] + S) / s).toString(), c = l((256 * i[d + 3 + e * E + S] + i[d + 4 + e * E] + S) / s).toString()), P = p(i[d + 5 + e * E + S]), P = parseInt(P, 2), P >= 128 ? (v = p(256 * i[d + 6 + e * E + S] + i[d + 7 + e * E + S]), v = parseInt(v, 2), h = p(256 * i[d + 8 + e * E + S] + i[d + 9 + e * E + S]), h = parseInt(h, 2), S += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + v + \", occurences_down: \" + h + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + P + \"}\"; else { let t = i[d + e * E + 1 + S], u = r[m][g][t].name; \"none\" === _ ? (a = ((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString(), c = ((256 * i[d + 4 + e * E + S] + i[d + 5 + e * E + S]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString(), c = o((256 * i[d + 4 + e * E + S] + i[d + 5 + e * E + S]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString(), c = l((256 * i[d + 4 + e * E + S] + i[d + 5 + e * E + S]) / s).toString()), P = p(i[d + 6 + e * E + S]), P = parseInt(P, 2), P >= 128 ? (v = p(256 * i[d + 7 + e * E + S] + i[d + 8 + e * E + S]), v = parseInt(v, 2), h = p(256 * i[d + 9 + e * E + S] + i[d + 10 + e * E + S]), h = parseInt(h, 2), S += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + v + \", occurences_down: \" + h + \", field: \" + u + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + P + \", field: \" + u + \"}\" } t.push(n) } if (\"0\" === u[3] && \"1\" === u[4]) { e -= 3; let a = \"\", n = \"\"; if (0 === b) \"none\" === _ ? a = ((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E + S]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E + S]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + S] + i[d + 2 + e * E + S]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \"}\"; else { let t = i[d + e * E + 1 + S], u = r[m][g][t].name; \"none\" === _ ? a = ((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + S] + i[d + 3 + e * E + S]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \", field: \" + u + \"}\" } t.push(n) } if (E += 1, P = 0, h = 0, v = 0, z = i[d + e * E + S], void 0 === z) { n.zclheader.alarmmsg = t, a = 1; break } } }(a, n, d, s, u, , m, b, v, h, e, t) : 4 === S ? function (e, t, a, i, n, d, s, u, , c, m, g) { let E = 0, P = 0, v = 0, h = 0, S = 0, b = 0; 1 === c && (e += 1, b = 1), void 0 === _ && (_ = \"single\" === u ? \"float\" : \"int8\" === u || \"int16\" === u || \"int32\" === u ? \"int\" : \"none\"); let z = i[d + e * E]; for (void 0 === z && (n.zclheader.alarmmsg = t, a = 1); 0 === a;) { if (1 === c) { let t = i[d + e * E + 1 + P]; s = r[m][g][t].divider, _ = r[m][g][t].function_type } let u = p(z), A = 4 * f(u[5]) + 2 * f(u[6]) + f(u[7]), y = !0; if (\"0\" === u[0] && (y = !1), \"1\" === u[3] && \"0\" === u[4]) { let a = \"\", n = \"\", c = \"\", f = \"\"; if (f = \"1\" === u[1] ? \"exceed\" : \"fall\", 0 === b) \"none\" === _ ? (a = ((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = ((256 * i[d + 5 + e * E + P] * 256 * 256 + 256 * i[d + 6 + e * E + P] * 256 + 256 * i[d + 7 + e * E + P] + i[d + 8 + e * E + P]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = o((256 * i[d + 5 + e * E + P] * 256 * 256 + 256 * i[d + 6 + e * E + P] * 256 + 256 * i[d + 7 + e * E + P] + i[d + 8 + e * E + P]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = l((256 * i[d + 5 + e * E + P] * 256 * 256 + 256 * i[d + 6 + e * E + P] * 256 + 256 * i[d + 7 + e * E + P] + i[d + 8 + e * E + P]) / s).toString()), v = p(i[d + 9 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 10 + e * E + P] + i[d + 11 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 12 + e * E + P] + i[d + 13 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \"}\"; else { let t = i[d + e * E + 1], u = r[m][g][t].name; \"none\" === _ ? (a = ((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString(), c = ((256 * i[d + 6 + e * E + P] * 256 * 256 + 256 * i[d + 7 + e * E + P] * 256 + 256 * i[d + 8 + e * E + P] + i[d + 9 + e * E + P]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString(), c = o((256 * i[d + 6 + e * E + P] * 256 * 256 + 256 * i[d + 7 + e * E + P] * 256 + 256 * i[d + 8 + e * E + P] + i[d + 9 + e * E + P]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString(), c = l((256 * i[d + 6 + e * E + P] * 256 * 256 + 256 * i[d + 7 + e * E + P] * 256 + 256 * i[d + 8 + e * E + P] + i[d + 9 + e * E + P]) / s).toString()), v = p(i[d + 10 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 11 + e * E + P] + i[d + 12 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 13 + e * E + P] + i[d + 14 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \", field: \" + u + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \", field: \" + u + \"}\" } t.push(n) } if (\"0\" === u[3] && \"1\" === u[4]) { e -= 3; let a = \"\", n = \"\"; if (0 === b) \"none\" === _ ? a = ((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + P] * 256 * 256 + 256 * i[d + 2 + e * E + P] * 256 + 256 * i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \"}\"; else { let t = i[d + e * E + 1], u = r[m][g][t].name; \"none\" === _ ? a = ((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + P] * 256 * 256 + 256 * i[d + 3 + e * E + P] * 256 + 256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \", field: \" + u + \"}\" } t.push(n) } if (E += 1, v = 0, S = 0, h = 0, z = i[d + e * E + P], void 0 === z) { n.zclheader.alarmmsg = t, a = 1; break } } }(a, n, d, s, u, , m, b, v, h, e, t) : 1 === S ? function (e, t, a, i, n, d, s, u, , c, m, g) { let E = 0, P = 0, v = 0, h = 0, S = 0, b = 0; 1 === c && (e += 1, b = 1), void 0 === _ && (_ = \"single\" === u ? \"float\" : \"int8\" === u || \"int16\" === u || \"int32\" === u ? \"int\" : \"none\"); let z = i[d + e * E]; for (void 0 === z && (n.zclheader.alarmmsg = t, a = 1); 0 === a;) { if (1 === c) { let t = i[d + e * E + 1 + P]; s = r[m][g][t].divider, _ = r[m][g][t].function_type } let u = p(z), A = 4 * f(u[5]) + 2 * f(u[6]) + f(u[7]), y = !0; if (\"0\" === u[0] && (y = !1), \"1\" === u[3] && \"0\" === u[4]) { let a = \"\", n = \"\", c = \"\", f = \"\"; if (f = \"1\" === u[1] ? \"exceed\" : \"fall\", 0 === b) \"none\" === _ ? (a = (i[d + 1 + e * E + P] / s).toString(), c = (i[d + 2 + e * E + P] / s).toString()) : \"int\" === _ ? (a = o(i[d + 1 + e * E + P] / s).toString(), c = o(i[d + 2 + e * E + P] / s).toString()) : \"float\" === _ && (a = l(i[d + 1 + e * E + P] / s).toString(), c = l(i[d + 2 + e * E + P] / s).toString()), v = p(i[d + 3 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 6 + e * E + P] + i[d + 7 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \"}\"; else { let t = i[d + e * E + 1 + P], u = r[m][g][t].name; \"none\" === _ ? (a = (i[d + 2 + e * E + P] / s).toString(), c = (i[d + 3 + e * E + P] / s).toString()) : \"int\" === _ ? (a = o(i[d + 2 + e * E + P] / s).toString(), c = o(i[d + 3 + e * E + P] / s).toString()) : \"float\" === _ && (a = l(i[d + 2 + e * E + P] / s).toString(), c = l(i[d + 3 + e * E + P] / s).toString()), v = p(i[d + 4 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 5 + e * E + P] + i[d + 6 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 7 + e * E + P] + i[d + 8 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \", field: \" + u + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \", field: \" + u + \"}\" } t.push(n) } if (\"0\" === u[3] && \"1\" === u[4]) { e -= 3; let a = \"\", n = \"\"; if (0 === b) \"none\" === _ ? a = (i[d + 1 + e * E + P] / s).toString() : \"int\" === _ ? a = o(i[d + 1 + e * E + P] / s).toString() : \"float\" === _ && (a = l(i[d + 1 + e * E + P] / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \"}\"; else { let t = i[d + e * E + 1 + P], u = r[m][g][t].name; \"none\" === _ ? a = (i[d + 2 + e * E + P] / s).toString() : \"int\" === _ ? a = o(i[d + 2 + e * E + P] / s).toString() : \"float\" === _ && (a = l(i[d + 2 + e * E + P] / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \", field: \" + u + \"}\" } t.push(n) } if (E += 1, v = 0, S = 0, h = 0, z = i[d + e * E + P], void 0 === z) { n.zclheader.alarmmsg = t, a = 1; break } } }(a, n, d, s, u, , m, b, v, h, e, t) : 3 === S && function (e, t, a, i, n, d, s, u, , c, m, g) { let E = 0, P = 0, v = 0, h = 0, S = 0, b = 0; 1 === c && (e += 1, b = 1), void 0 === _ && (_ = \"single\" === u ? \"float\" : \"int8\" === u || \"int16\" === u || \"int32\" === u ? \"int\" : \"none\"); let z = i[d + e * E]; for (void 0 === z && (n.zclheader.alarmmsg = t, a = 1); 0 === a;) { if (1 === c) { let t = i[d + e * E + 1 + P]; s = r[m][g][t].divider, _ = r[m][g][t].function_type } let u = p(z), A = 4 * f(u[5]) + 2 * f(u[6]) + f(u[7]), y = !0; if (\"0\" === u[0] && (y = !1), \"1\" === u[3] && \"0\" === u[4]) { let a = \"\", n = \"\", c = \"\", f = \"\"; if (f = \"1\" === u[1] ? \"exceed\" : \"fall\", 0 === b) \"none\" === _ ? (a = ((256 * i[d + 1 + e * E + P] + i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString(), c = ((256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P] + i[d + 6 + e * E + P]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 1 + e * E + P] + i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString(), c = o((256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P] + i[d + 6 + e * E + P]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + P] + i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString(), c = l((256 * i[d + 4 + e * E + P] + i[d + 5 + e * E + P] + i[d + 6 + e * E + P]) / s).toString()), v = p(i[d + 7 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 8 + e * E + P] + i[d + 9 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 10 + e * E + P] + i[d + 11 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \"}\"; else { let t = i[d + e * E + 1 + P], u = r[m][g][t].name; \"none\" === _ ? (a = ((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = ((256 * i[d + 5 + e * E + P] + i[d + 6 + e * E + P] + i[d + 7 + e * E + P]) / s).toString()) : \"int\" === _ ? (a = o((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = o((256 * i[d + 5 + e * E + P] + i[d + 6 + e * E + P] + i[d + 7 + e * E + P]) / s).toString()) : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString(), c = l((256 * i[d + 5 + e * E + P] + i[d + 6 + e * E + P] + i[d + 7 + e * E + P]) / s).toString()), v = p(i[d + 8 + e * E + P]), v = parseInt(v, 2), v >= 128 ? (h = p(256 * i[d + 9 + e * E + P] + i[d + 10 + e * E + P]), h = parseInt(h, 2), S = p(256 * i[d + 11 + e * E + P] + i[d + 12 + e * E + P]), S = parseInt(S, 2), P += 4, n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences_up: \" + h + \", occurences_down: \" + S + \", field: \" + u + \"}\") : n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: threshold, crossing: \" + f + \", value: \" + a + \", gap: \" + c + \", occurences: \" + v + \", field: \" + u + \"}\" } t.push(n) } if (\"0\" === u[3] && \"1\" === u[4]) { e -= 3; let a = \"\", n = \"\"; if (0 === b) \"none\" === _ ? a = ((256 * i[d + 1 + e * E + P] * 256 + 256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 1 + e * E + P] + i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 1 + e * E + P] + i[d + 2 + e * E + P] + i[d + 3 + e * E + P]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \"}\"; else { let t = i[d + e * E + 1], u = r[m][g][t].name; \"none\" === _ ? a = ((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString() : \"int\" === _ ? a = o((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString() : \"float\" === _ && (a = l((256 * i[d + 2 + e * E + P] + i[d + 3 + e * E + P] + i[d + 4 + e * E + P]) / s).toString()), n = \"cause:{alarm:\" + y + \", criterion_index: \" + A + \", mode: delta, value: \" + a + \", field: \" + u + \"}\" } t.push(n) } if (E += 1, v = 0, S = 0, h = 0, z = i[d + e * E + P], void 0 === z) { n.zclheader.alarmmsg = t, a = 1; break } } }(a, n, d, s, u, , m, b, v, h, e, t) } function P(e) { let t = \"\"; for (let a = 0; a < e.length; a++) { let i = e[a].toString(16).toUpperCase(); 1 === i.length && (i = \"0\" + i), t += i } return t } function v(t, i) { let r = {}, f = 0; r.lora = {}, r.lora.port = i; let v = t.length, S = \"\"; r.lora.payload = \"\"; for (let e = 0; e < v; e++) { S = t[e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.lora.payload += S; let a = new Date; r.lora.date = a.toISOString() } if (125 === i) if (!1 == !(1 & t[0])) { r.zclheader = {}, r.zclheader.report = \"standard\"; let i = -1, v = -1, z = -1; if (r.zclheader.endpoint = (224 & t[0]) >> 5 | (6 & t[0]) << 2, v = t[1], r.zclheader.cmdID = (v, 2), z = 256 * t[2] + t[3], r.zclheader.clustID = (z, 4), 10 === v | 138 === v | 1 === v) { f = 1, r.data = {}, i = 256 * t[4] + t[5], r.zclheader.attID = (i, 4); let A = t[4], H = 0; if (10 !== v && 138 !== v || (H = 7), 138 === v && (r.zclheader.alarm = 1), 1 === v && (H = 8, r.zclheader.status = t[6]), 83 !== z && 84 !== z && 85 !== z && 86 !== z && 87 !== z || (r.data = function (t, a, i) { const r = [\"!?!\", \"\", \"\", \" ACTIF\", \"ACTIF\", \"CONSO\", \"CONTROLE\", \"DEP\", \"INACTIF\", \"PROD\", \"TEST\", \"kVA\", \"kW\"], o = [\"!?!\", \"\", \"\", \" ? \", \"000\", \"HC\", \"HCD\", \"HCE\", \"HCH\", \"HH\", \"HH \", \"HP\", \"HP \", \"HPD\", \"HPE\", \"HPH\", \"JA\", \"JA \", \"P\", \"P  \", \"PM\", \"PM \", \"XXX\"], l = [\"!?!\", \"\", \"\", \"BT 4 SUP36\", \"BT 5 SUP36\", \"HTA 5     \", \"HTA 8     \", \"TJ EJP    \", \"TJ EJP-HH \", \"TJ EJP-PM \", \"TJ EJP-SD \", \"TJ LU     \", \"TJ LU-CH  \", \"TJ LU-P   \", \"TJ LU-PH  \", \"TJ LU-SD  \", \"TJ MU     \", \"TV A5 BASE\", \"TV A8 BASE\", \"BASE\", \"H PLEINE-CREUSE\", \"HPHC\", \"HC\", \"HC et Week-End\", \"EJP\", \"PRODUCTEUR\"], _ = [\"!?!\", \"\", \"\", \" ? \", \"000\", \"HC\", \"HCD\", \"HCE\", \"HCH\", \"HH\", \"HH \", \"HP\", \"HP \", \"HPD\", \"HPE\", \"HPH\", \"JA\", \"JA \", \"P\", \"P  \", \"PM\", \"PM \", \"XXX\", \"INDEX NON CONSO\", \"BASE\", \"HEURE CREUSE\", \"HEURE PLEINE\", \"HEURE NORMALE\", \"HEURE POINTE\", \"HC BLEU\", \"BUHC\", \"HP BLEU\", \"BUHP\", \"HC BLANC\", \"BCHC\", \"HP BLANC\", \"BCHP\", \"HC ROUGE\", \"RHC\", \"HP ROUGE\", \"RHP\", \"HEURE WEEK-END\"], p = [\"!?!\", \"*\", \"\", \"BT 4 SUP36\", \"BT 5 SUP36\", \"HTA 5     \", \"HTA 8     \", \"TJ EJP    \", \"TJ EJP-HH \", \"TJ EJP-PM \", \"TJ EJP-SD \", \"TJ LU     \", \"TJ LU-CH  \", \"TJ LU-P   \", \"TJ LU-PH  \", \"TJ LU-SD  \", \"TJ MU     \", \"TV A5 BASE\", \"TV A8 BASE\", \"BASE\", \"H PLEINE-CREUSE\", \"HPHC\", \"HC\", \"HC et Week-End\", \"EJP\", \"PRODUCTEUR\"]; function f(e, t, a) { var i = {}; return 0 == (128 & e[t]) ? (iEnum = 127 & e[t], iEnum++, i = a[iEnum], t += 1) : (sz = 127 & e[t], t += 1, sz > 0 ? (i = String.fromCharCode.apply(null, e.slice(t, t + sz)), t += sz) : i = \"\"), { x: i, i: t } } function g(e, t) { return { x: ze = c(u(e, t, \"U8\"), 2) + \"/\" + c(u(e, t + 1, \"U8\"), 2) + \"/\" + c(u(e, t + 2, \"U8\"), 2) + \" \" + c(u(e, t + 3, \"U8\"), 2) + \":\" + c(u(e, t + 4, \"U8\"), 2) + \":\" + c(u(e, t + 5, \"U8\"), 2), i: t += 6 } } function E(e, t, a) { ts = u(e, t, \"U32\", a), t += 4, ts += new Date(\"2000/01/01 00:00:00\").getTime() / 1e3, ts += 3600; var i = new Date(1e3 * ts); return { x: c(i.getDate(), 2) + \"/\" + c(i.getMonth(), 2) + \"/\" + i.getFullYear() + \" \" + c(i.getHours(), 2) + \":\" + c(i.getMinutes(), 2) + \":\" + c(i.getSeconds(), 2), i: t } } function v(e, t, a) { return { x: ze = String.fromCharCode.apply(null, e.slice(t, t + a)), i: t += a } } function S(e, t) { return { b: e, i: t } } function z(e, t) { return function (e, t) { return eos = e.slice(t).indexOf(0), ze = String.fromCharCode.apply(null, e.slice(t, t + eos)), t += eos + 1, { x: ze, i: t } }(e, t) } function A(e, t) { return { x: ze = u(e, t, \"U8\"), i: t += 1 } } function H(e, t) { return { x: ze = u(e, t, \"U16\"), i: t += 2 } } function C(e, t) { return { x: ze = u(e, t, \"I16\"), i: t += 2 } } function T(e, t) { return { x: ze = u(e, t, \"U24\"), i: t += 3 } } function I(e, t) { var a = {}; for (t = 1; t <= 4; t++)a[\"Value_\" + t] = u(e, t, \"U24\"), t += 3; return { x: a, i: t } } function N(e, t) { return { x: ze = u(e, t, \"U32\"), i: t += 4 } } function R(e, t) { return { x: ze = BytesToFloat32(e, t), i: t += 4 } } function U(e, t) { return g(e, t) } function x(e, t) { return E(e, t) } function w(e, t) { return f(e, t, o) } function O(e, t) { return { x: {}, i: t = f(e, E(e, t).i, o).i } } function F(e, t) { return D = c(u(e, t, \"U8\"), 2), t++, M = c(u(e, t, \"U8\"), 2), t++, h = c(u(e, t, \"U8\"), 2), t++, { x: D + \"/\" + M + \" \" + h, i: t } } function J(e, t) { var a = {}; return s = v(e, t, 1), d = g(e, s.i), n = u(e, t, \"U8\"), t = d.i + 1, a.S = s.x, a.Date = d.x, a.Value = n, { x: a, i: t } } function B(e, t) { var a = {}; return s = v(e, t, 1), d = g(e, s.i), n = u(e, t, \"U16\"), t = d.i + 1, a.S = s.x, a.Date = d.x, a.Value = n, { x: a, i: t } } function V(e, t) { var a = {}; return s = v(e, t, 1), d = g(e, s.i), n = u(e, t, \"U24\"), t = d.i + 1, a.S = s.x, a.Date = d.x, a.Value = n, { x: a, i: t } } function X(e, t) { return f(e, t, r) } function G(t, a) { var i = {}; return dd = u(t, a, \"U24\"), a += 3, i.Value = dd, e = f(t, a, r), i.Label = e.x, { x: i, i: a = e.i } } function q(e, t) { return f(e, t, l) } function k(e, t) { for (var a = [], i = 0; i < 11; i++)y = {}, h = c(u(e, t, \"U8\"), 2), t++, 255 == h ? y.Status = \"NONUTILE\" : (m = c(u(e, t, \"U8\"), 2), t++, s = P(e.slice(t, 2)), t++, y.Time = h + \":\" + m, y.Status = s, t += e[t] + 1), a.push(y); return { x: a, i: t } } function L(e) { return e } function Y(e) { return e } function W(e) { return e } function j(e) { return e } function Z(e) { return e } function Q(e) { return e } function K(e) { return e } function $(e) { return e } function ee(e) { return e } function te(e) { return e } function ae(e) { return e } function ie(e) { return e } function re(e) { return e } function ne(e) { return e } function oe(e) { return e } function de(e) { return e } function le(e) { return e } function se(e) { return e } function ue(e) { return e } function e(e) { return e } function ce(e) { return e } const pe = [[\"CONTRAT\", z, 0, Y], [\"DATECOUR\", U, 0, L], [\"DATE\", U, 0, L], [\"EA\", T, 0, function (e) { return e }], [\"ERP\", T, 0, function (e) { return e }], [\"PTCOUR\", z, 0, Y], [\"PREAVIS\", z, 0, Y], [\"MODE\", S, 0, Y], [\"DATEPA1\", U, 0, L], [\"PA1\", H, 0, ie], [\"DATEPA2\", U, 0, L], [\"PA2\", H, 0, ie], [\"DATEPA3\", U, 0, L], [\"PA3\", H, 0, ie], [\"DATEPA4\", U, 0, L], [\"PA4\", H, 0, ie], [\"DATEPA5\", U, 0, L], [\"PA5\", H, 0, ie], [\"DATEPA6\", U, 0, L], [\"PA6\", H, 0, ie], [\"p\", T, 0, K], [\"KDC\", A, 0, ae], [\"KDCD\", A, 0, ae], [\"TGPHI\", R, 0, ce], [\"PSP\", H, 0, ie], [\"PSPM\", H, 0, ie], [\"PSHPH\", H, 0, ie], [\"PSHPD\", H, 0, ie], [\"PSHCH\", H, 0, ie], [\"PSHCD\", H, 0, ie], [\"PSHPE\", H, 0, ie], [\"PSHCE\", H, 0, ie], [\"PSJA\", H, 0, ie], [\"PSHH\", H, 0, ie], [\"PSHD\", H, 0, ie], [\"PSHM\", H, 0, ie], [\"PSDSM\", H, 0, ie], [\"PSSCM\", H, 0, ie], [\"MODE\", S, 0, Y], [\"PA1MN\", H, 0, ie], [\"PA10MN\", H, 0, ie], [\"PREA1MN\", C, 0, re], [\"PREA10MN\", C, 0, re], [\"TGPHI\", R, 0, ce], [\"U10MN\", H, 0, function (e) { return e }]], me = [[\"DEBUTp\", U, 0, L, 0], [\"FINp\", U, 0, L, 6], [\"CAFp\", H, 0, Q, 12], [\"DATEEAp\", U, 0, L, 14], [\"EApP\", T, 0, se, 20], [\"EApPM\", T, 0, se, 23], [\"EApHCE\", T, 0, se, 26], [\"EApHCH\", T, 0, se, 29], [\"EApHH\", T, 0, se, 32], [\"EApHCD\", T, 0, se, 35], [\"EApHD\", T, 0, se, 38], [\"EApJA\", T, 0, se, 41], [\"EApHPE\", T, 0, se, 44], [\"EApHPH\", T, 0, se, 47], [\"EApHPD\", T, 0, se, 50], [\"EApSCM\", T, 0, se, 53], [\"EApHM\", T, 0, se, 56], [\"EApDSM\", T, 0, se, 59], [\"DATEERPp\", U, 0, L, 62], [\"ERPpP\", T, 0, _e, 68], [\"ERPpPM\", T, 0, _e, 71], [\"ERPpHCE\", T, 0, _e, 74], [\"ERPpHCH\", T, 0, _e, 77], [\"ERPpHH\", T, 0, _e, 80], [\"ERPpHCD\", T, 0, _e, 83], [\"ERPpHD\", T, 0, _e, 86], [\"ERPpJA\", T, 0, _e, 89], [\"ERPpHPE\", T, 0, _e, 92], [\"ERPpHPH\", T, 0, _e, 95], [\"ERPpHPD\", T, 0, _e, 98], [\"ERPpSCM\", T, 0, _e, 101], [\"ERPpHM\", T, 0, _e, 104], [\"ERPpDSM\", T, 0, _e, 107], [\"DATEERNp\", U, 0, L, 110], [\"ERNpP\", T, 0, _e, 116], [\"ERNpPM\", T, 0, _e, 119], [\"ERNpHCE\", T, 0, _e, 122], [\"ERNpHCH\", T, 0, _e, 125], [\"ERNpHH\", T, 0, _e, 128], [\"ERNpHCD\", T, 0, _e, 131], [\"ERNpHD\", T, 0, _e, 134], [\"ERNpJA\", T, 0, _e, 137], [\"ERNpHPE\", T, 0, _e, 140], [\"ERNpHPH\", T, 0, _e, 143], [\"ERNpHPD\", T, 0, _e, 146], [\"ERNpSCM\", T, 0, _e, 149], [\"ERNpHM\", T, 0, _e, 152], [\"ERNpDSM\", T, 0, _e, 155]], fe = [[\"DEBUTp1\", U, 0, L, 0], [\"FINp1\", U, 0, L, 6], [\"CAFp1\", H, 0, Q, 12], [\"DATEEAp1\", U, 0, L, 14], [\"EAp1P\", T, 0, se, 20], [\"EAp1PM\", T, 0, se, 23], [\"EAp1HCE\", T, 0, se, 26], [\"EAp1HCH\", T, 0, se, 29], [\"EAp1HH\", T, 0, se, 32], [\"EAp1HCD\", T, 0, se, 35], [\"EAp1HD\", T, 0, se, 38], [\"EAp1JA\", T, 0, se, 41], [\"EAp1HPE\", T, 0, se, 44], [\"EAp1HPH\", T, 0, se, 47], [\"EAp1HPD\", T, 0, se, 50], [\"EAp1SCM\", T, 0, se, 53], [\"EAp1HM\", T, 0, se, 56], [\"EAp1DSM\", T, 0, se, 59], [\"DATEERPp1\", U, 0, L, 62], [\"ERPp1P\", T, 0, _e, 68], [\"ERPp1PM\", T, 0, _e, 71], [\"ERPp1HCE\", T, 0, _e, 74], [\"ERPp1HCH\", T, 0, _e, 77], [\"ERPp1HH\", T, 0, _e, 80], [\"ERPp1HCD\", T, 0, _e, 83], [\"ERPp1HD\", T, 0, _e, 86], [\"ERPp1JA\", T, 0, _e, 89], [\"ERPp1HPE\", T, 0, _e, 92], [\"ERPp1HPH\", T, 0, _e, 95], [\"ERPp1HPD\", T, 0, _e, 98], [\"ERPp1SCM\", T, 0, _e, 101], [\"ERPp1HM\", T, 0, _e, 104], [\"ERPp1DSM\", T, 0, _e, 107], [\"DATEERNp1\", U, 0, L, 110], [\"ERNp1P\", T, 0, _e, 116], [\"ERNp1PM\", T, 0, _e, 119], [\"ERNp1HCE\", T, 0, _e, 122], [\"ERNp1HCH\", T, 0, _e, 125], [\"ERNp1HH\", T, 0, _e, 128], [\"ERNp1HCD\", T, 0, _e, 131], [\"ERNp1HD\", T, 0, _e, 134], [\"ERNp1JA\", T, 0, _e, 137], [\"ERNp1HPE\", T, 0, _e, 140], [\"ERNp1HPH\", T, 0, _e, 143], [\"ERNp1HPD\", T, 0, _e, 146], [\"ERNp1SCM\", T, 0, _e, 149], [\"ERNp1HM\", T, 0, _e, 152], [\"ERNp1DSM\", T, 0, _e, 155]], ge = [[\"ADIR1\", H, 0, Z], [\"ADIR2\", H, 0, Z], [\"ADIR3\", H, 0, Z], [\"ADCO\", z, 0, Y], [\"OPTARIF\", z, 0, Y], [\"ISOUSC\", A, 0, j], [\"BASE\", N, 0, te], [\"HCHC\", N, 0, te], [\"HCHP\", N, 0, te], [\"EJPHN\", N, 0, te], [\"EJPHPM\", N, 0, te], [\"BBRHCJB\", N, 0, te], [\"BBRHPJB\", N, 0, te], [\"BBRHCJW\", N, 0, te], [\"BBRHPJW\", N, 0, te], [\"BBRHCJR\", N, 0, te], [\"BBRHPJR\", N, 0, te], [\"PEJP\", A, 0, j], [\"GAZ\", N, 0, ee], [\"AUTRE\", N, 0, ee], [\"PTEC\", z, 0, Y], [\"DEMAIN\", z, 0, Y], [\"IINST\", H, 0, Z], [\"IINST1\", H, 0, Z], [\"IINST2\", H, 0, Z], [\"IINST3\", H, 0, Z], [\"ADPS\", H, 0, Z], [\"IMAX\", H, 0, Z], [\"IMAX1\", H, 0, Z], [\"IMAX2\", H, 0, Z], [\"IMAX3\", H, 0, Z], [\"PMAX\", N, 0, K], [\"PAPP\", N, 0, K], [\"HHPHC\", function (e, t) { return { x: ze = String.fromCharCode.apply(null, e.slice(0, 1)), i: t += 1 } }, 0, function (e) { return e }], [\"MOTDETAT\", z, 0, Y], [\"PPOT\", A, 0, function (e) { return e }]], Ee = [[\"JAUNE\", function (e, t) { return h = c(u(e, t, \"U8\"), 2), t++, m = c(u(e, t, \"U8\"), 2), t++, D = c(u(e, t, \"U8\"), 2), t++, M = c(u(e, t, \"U8\"), 2), t++, { x: D + \"/\" + M + \" \" + h + \":\" + m, i: t } }, 0, L], [\"JAUNE\", z, 0, Y], [\"JAUNE\", z, 0, Y], [\"JAUNE\", T, 0, K], [\"JAUNE\", A, 0, j], [\"ENERG\", function (e, t) { var a = {}; for (t = 1; t <= 4; t++)a[\"Value\" + t] = u(e, t, \"U24\"), t += 3; return { x: a, i: t } }, 0, $], [\"ENERG\", T, 0, $], [\"ENERG\", T, 0, $], [\"ENERG\", T, 0, $], [\"ENERG\", T, 0, $], [\"ENERG\", T, 0, $], [\"PERCC\", F, 0, L], [\"PERCC\", A, 0, j], [\"PMAXC\", I, 0, K], [\"PMAXC\", T, 0, K], [\"PMAXC\", T, 0, K], [\"PMAXC\", T, 0, K], [\"TDEPA\", I, 0, K], [\"TDEPA\", T, 0, K], [\"TDEPA\", T, 0, K], [\"TDEPA\", T, 0, K], [\"PERCP\", F, 0, L], [\"PERCP\", A, 0, j], [\"PMAXP\", I, 0, K], [\"PMAXP\", T, 0, K], [\"PMAXP\", T, 0, K], [\"PMAXP\", T, 0, K], [\"PSOUSC\", I, 0, K], [\"PSOUSC\", T, 0, K], [\"PSOUSC\", T, 0, K], [\"PSOUSC\", T, 0, K], [\"PSOUSP\", I, 0, K], [\"PSOUSP\", T, 0, K], [\"PSOUSP\", T, 0, K], [\"PSOUSP\", T, 0, K], [\"FCOU\", function (e, t) { return h = c(u(e, t, \"U8\"), 2), t++, m = c(u(e, t, \"U8\"), 2), t++, { x: h + \":\" + m, i: t } }, 0, L], [\"FCOU\", A, 0, j]], Pe = [[\"ADSC\", z, 0, Y], [\"VTIC\", A, 0, j], [\"DATE\", function (e, t) { var a = {}; return s = v(e, t, 1), d = g(e, s.i), a.S = s.x, a.Date = d.x, { x: a, i: t = d.i } }, 0, L], [\"NGTF\", function (e, t) { return f(e, t, p) }, 0, Y], [\"LTARF\", function (e, t) { return f(e, t, ) }, 0, Y], [\"EAST\", N, 0, te], [\"EASF01\", N, 0, te], [\"EASF02\", N, 0, te], [\"EASF03\", N, 0, te], [\"EASF04\", N, 0, te], [\"EASF05\", N, 0, te], [\"EASF06\", N, 0, te], [\"EASF07\", N, 0, te], [\"EASF08\", N, 0, te], [\"EASF09\", N, 0, te], [\"EASF10\", N, 0, te], [\"EASD01\", N, 0, te], [\"EASD02\", N, 0, te], [\"EASD03\", N, 0, te], [\"EASD04\", N, 0, te], [\"EAIT\", N, 0, te], [\"ERQ1\", N, 0, te], [\"ERQ2\", N, 0, te], [\"ERQ3\", N, 0, te], [\"ERQ4\", N, 0, te], [\"IRMS1\", H, 0, Z], [\"IRMS2\", H, 0, Z], [\"IRMS3\", H, 0, Z], [\"URMS1\", H, 0, Z], [\"URMS2\", H, 0, Z], [\"URMS3\", H, 0, Z], [\"PREF\", A, 0, j], [\"PCOUP\", A, 0, j], [\"SINSTS\", T, 0, K], [\"SINSTS1\", T, 0, K], [\"SINSTS2\", T, 0, K], [\"SINSTS3\", T, 0, K], [\"SMAXSN\", V, 0, K], [\"SMAXSN1\", V, 0, K], [\"SMAXSN2\", V, 0, K], [\"SMAXSN3\", V, 0, K], [\"SMAXSN?1\", V, 0, K], [\"SMAXSN1?1\", V, 0, K], [\"SMAXSN2?1\", V, 0, K], [\"SMAXSN3?1\", V, 0, K], [\"SINSTI\", T, 0, K], [\"SMAXIN\", V, 0, K], [\"SMAXIN-1\", V, 0, K], [\"CCASN\", V, 0, K], [\"CCASN?1\", V, 0, K], [\"CCAIN\", V, 0, K], [\"CCAIN?1\", V, 0, K], [\"UMOY1\", B, 0, Z], [\"UMOY2\", B, 0, Z], [\"UMOY3\", B, 0, Z], [\"STGE\", function (e, t) { var a = P(e.slice(t, 2)); return t += 4, { x: a, i: t += 4 } }, 0, L], [\"DPM1\", J, 0, j], [\"FPM1\", J, 0, j], [\"DPM2\", J, 0, j], [\"FPM2\", J, 0, j], [\"DPM3\", J, 0, j], [\"FPM3\", J, 0, j], [\"MSG1\", z, 0, Y], [\"MSG2\", z, 0, Y], [\"PRM\", z, 0, Y], [\"RELAIS\", function (e, t) { return ze = u(e, t, \"U8\"), t++, { x: ze, i: t } }, 0, Z], [\"NTARF\", A, 0, j], [\"NJOURF\", A, 0, j], [\"NJOURF+1\", A, 0, j], [\"PJOURF+1\", k, 0, L], [\"PPOINTE\", k, 0, L]], ve = [[\"TRAME\", X, 0, Y], [\"ADS\", function (e, t) { var a = P(e.slice(t + 1, t + 1 + e[t])); return t += e[t] + 1, d = { x: a, i: t }, { x: a, i: t } }, 0, L], [\"MESURES1\", q, 0, Y], [\"DATE\", U, 0, L], [\"EA_s\", T, 0, ne], [\"ER+_s\", T, 0, oe], [\"ER-_s\", T, 0, oe], [\"EAPP_s\", T, 0, de], [\"EA_i\", T, 0, ne], [\"ER+_i\", T, 0, oe], [\"ER-_i\", T, 0, oe], [\"EAPP_i\", T, 0, de], [\"PTCOUR1\", w, 0, Y], [\"TARIFDYN\", X, 0, Y], [\"ETATDYN1\", w, 0, Y], [\"PREAVIS1\", w, 0, W], [\"TDYN1CD\", O, 0, L], [\"TDYN1CF\", O, 0, L], [\"TDYN1FD\", O, 0, L], [\"TDYN1FF\", O, 0, L], [\"MODE\", X, 0, Y], [\"CONFIG\", X, 0, Y], [\"DATEPA1\", U, 0, L], [\"PA1_s\", H, 0, ie], [\"PA1_i\", H, 0, ie], [\"DATEPA2\", x, 0, L], [\"PA2_s\", H, 0, ie], [\"PA2_i\", H, 0, ie], [\"DATEPA3\", x, 0, L], [\"PA3_s\", H, 0, ie], [\"PA3_i\", H, 0, ie], [\"DATEPA4\", x, 0, L], [\"PA4_s\", H, 0, ie], [\"PA4_i\", H, 0, ie], [\"DATEPA5\", x, 0, L], [\"PA5_s\", H, 0, ie], [\"PA5_i\", H, 0, ie], [\"DATEPA6\", x, 0, L], [\"PA6_s\", H, 0, ie], [\"PA6_i\", H, 0, ie], [\"DebP\", x, 0, L], [\"EAP_s\", T, 0, le], [\"EAP_i\", T, 0, le], [\"ER+P_s\", T, 0, ue], [\"ER-P_s\", T, 0, ue], [\"ER+P_i\", T, 0, ue], [\"ER-P_i\", T, 0, ue], [\"DebP-1\", x, 0, L], [\"FinP-1\", x, 0, L], [\"EaP-1_s\", T, 0, le], [\"EaP-1_i\", T, 0, le], [\"ER+P-1_s\", T, 0, ue], [\"ER-P-1_s\", T, 0, ue], [\"ER+P-1_i\", T, 0, ue], [\"ER-P-1_i\", T, 0, ue], [\"PS\", G, 0, L], [\"PREAVIS\", X, 0, Y], [\"PA1MN\", H, 0, ie], [\"PMAX_s\", G, 0, L], [\"PMAX_i\", G, 0, L], [\"TGPHI_s\", R, 0, ce], [\"TGPHI_i\", R, 0, ce], [\"MESURES2\", q, 0, Y], [\"PTCOUR2\", w, 0, Y], [\"ETATDYN2\", w, 0, Y], [\"PREAVIS2\", w, 0, W], [\"TDYN2CD\", O, 0, L], [\"TDYN2CF\", O, 0, L], [\"TDYN2FD\", O, 0, L], [\"TDYN2FF\", O, 0, L], [\"DebP_2\", x, 0, L], [\"EaP_s2\", T, 0, le], [\"DebP-1_2\", x, 0, L], [\"FinP-1_2\", x, 0, L], [\"EaP-1_s2\", T, 0, le], [\"_DDMES1\", T, 0, function (e) { return e }]]; if (data = [], 83 == t) if (!1 & attributeID) profil = pe, data.TICFrameType = \"ICE Generale\"; else if (!1 & attributeID) profil = me, data._TICFrameType = \"ICE Periode P\"; else { if (!(!1 & attributeID)) return data; profil = fe, data._TICFrameType = \"ICE Periode P moins 1\" } else if (84 == t) profil = ge, data._TICFrameType = \"CBE/Historique\"; else if (85 == t) profil = Ee, data._TICFrameType = \"CJE\"; else if (86 == t) profil = Pe, data._TICFrameType = \"Standard\"; else { if (87 != t) return data; profil = ve, data._TICFrameType = \"PMEPMI\" } let { DescSize: he, Indexes: Se } = function (e) { var t = [], a = e[0], i = 31 & a; if (0 == i && (i = 8), IsVarIndexes = 0 != (32 & a), IsVarIndexes) for (r = 1; r < i; r++)t.push(e[r]); else { iField = 0; for (var r = i; r > 1; r--)for (b = 0; b < 8; b++)e[r - 1] >> b & 1 && t.push(iField), iField++ } return { DescSize: i, Indexes: t } }(i); var be = i.slice(0, he), ze = {}; 128 == (128 & be[0]) && (ze.Obsolete = !0), ze.Bytes = P(be), ze.Indexes = Se, data._Descriptor = ze; for (var Ae = he, ye = 0; ye < Se.length; ye++)fieldIndex = Se[ye], d = profil[fieldIndex][1](i, Ae), data[profil[fieldIndex][0]] = profil[fieldIndex]3, Ae = d.i; return data }(z, 0, t.slice(H + 1))), 0 === z && 2 === i) { r.data.firmware = \"\"; for (let e = 0; e < 3; e++)r.data.firmware += String(t[H + e]), e < 2 && (r.data.firmware += \".\"); let e = 256 * t[H + 3] * 256 + 256 * t[H + 4] + t[H + 5]; r.data.firmware += \".\" + e.toString() } if (0 === z && 3 === i) { let e = t[H]; r.data.kernel = \"\"; for (let a = 0; a < e; a++)r.data.kernel += String.fromCharCode(t[H + 1 + a]) } if (0 === z && 4 === i) { let e = t[H]; r.data.manufacturer = \"\"; for (let a = 0; a < e; a++)r.data.manufacturer += String.fromCharCode(t[H + 1 + a]) } if (0 === z && 5 === i) { let e = t[H]; r.data.model = \"\"; for (let a = 0; a < e; a++)r.data.model += String.fromCharCode(t[H + 1 + a]) } if (0 === z && 6 === i) { let e = t[H]; r.data.date = \"\"; for (let a = 0; a < e; a++)r.data.date += String.fromCharCode(t[H + 1 + a]) } if (0 === z && 16 === i) { let e = t[H]; r.data.position = \"\"; for (let a = 0; a < e; a++)r.data.position += String.fromCharCode(t[H + 1 + a]) } if (0 === z && 32769 === i) { let e = t[H]; r.data.application_name = \"\"; for (let a = 0; a < e; a++)r.data.application_name += String.fromCharCode(t[H + 1 + a]) } if (1026 === z && 0 === i) { let e = t[H - 1]; r.data.temperature = o(256 * t[H] + t[H + 1], 2) / 100; let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 100, l = \"\", s = \"int\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (1026 === z && 1 === i && (r.data.min_temperature = o(256 * t[H] + t[H + 1], 2) / 100), 1026 === z && 2 === i && (r.data.max_temperature = o(256 * t[H] + t[H + 1], 2) / 100), 1029 === z && 0 === i) { let e = t[H - 1]; r.data.humidity = (256 * t[H] + t[H + 1]) / 100; let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 100, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (1029 === z && 1 === i && (r.data.min_humidity = (256 * t[H] + t[H + 1]) / 100), 1029 === z && 2 === i && (r.data.max_humidity = (256 * t[H] + t[H + 1]) / 100), 15 === z && 1026 === i) { let e = t[H - 1]; r.data.index = 256 * t[H] * 256 * 256 + 256 * t[H + 1] * 256 + 256 * t[H + 2] + t[H + 3]; let a = H + 4; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 10, n, o, t, r, a, e, d, s) } } if (15 === z && 85 === i) { let e = t[H - 1]; r.data.pin_state = !!t[H]; let a = H + 1; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 4, n, o, t, r, a, e, d, s) } } if (15 === z && 84 === i && (0 === t[H] && (r.data.polarity = \"normal\"), 1 === t[H] && (r.data.polarity = \"reverse\")), 15 === z && 1024 === i && (0 === t[H] && (r.data.edge_selection = \"none\"), 1 === t[H] && (r.data.edge_selection = \"falling edge\"), 2 === t[H] && (r.data.edge_selection = \"rising edge\"), 3 === t[H] && (r.data.edge_selection = \"both edges\"), 5 === t[H] && (r.data.edge_selection = \"polling and falling edge\"), 6 === t[H] && (r.data.edge_selection = \"polling and rising edge\"), 7 === t[H] && (r.data.edge_selection = \"polling and both edges\")), 15 === z && 1025 === i && (r.data.debounce_period = t[H]), 15 === z && 1027 === i && (r.data.poll_period = t[H]), 15 === z && 1028 === i && (r.data.force_notify = t[H]), 19 === z && 85 === i) { let e = t[H - 1]; r.data.output_value = t[H]; let a = H + 1; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 4, n, o, t, r, a, e, d, s) } } if (6 === z && 0 === i) { let e = t[H]; r.data.output = 1 === e ? \"ON\" : \"OFF\" } if (32776 === z && 0 === i) { let e = t[H - 1]; r.data.differential_pressure = 256 * t[H] + t[H + 1]; let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (32773 === z && 0 === i) { let e = t[H - 1]; r.data.pin_state_1 = 1 == (1 & t[H + 1]), r.data.pin_state_2 = 2 == (2 & t[H + 1]), r.data.pin_state_3 = 4 == (4 & t[H + 1]), r.data.pin_state_4 = 8 == (8 & t[H + 1]), r.data.pin_state_5 = 16 == (16 & t[H + 1]), r.data.pin_state_6 = 32 == (32 & t[H + 1]), r.data.pin_state_7 = 64 == (64 & t[H + 1]), r.data.pin_state_8 = 128 == (128 & t[H + 1]), r.data.pin_state_9 = 1 == (1 & t[H]), r.data.pin_state_10 = 2 == (2 & t[H]); let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 100, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 4, n, o, t, r, a, e, d, s) } } if (32774 === z && 0 === i && (r.data.speed = 256 * t[H] * 256 + 256 * t[H + 1] + t[H + 2]), 32774 === z && 1 === i && (r.data.data_bit = t[H]), 32774 === z && 2 === i && (r.data.parity = t[H]), 32774 === z && 3 === i && (r.data.stop_bit = t[H]), 12 === z && 85 === i) { let e = t[H - 1]; r.data.analog = l(256 * t[H] * 256 * 256 + 256 * t[H + 1] * 256 + 256 * t[H + 2] + t[H + 3]); let a = H + 4; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"float\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 10, n, o, t, r, a, e, d, s) } } if (12 === z && 256 === i && (5 === t[H + 1] && (r.data.type = \"ppm\"), 255 === t[H + 1] && 0 === t[H + 3] && (r.data.type = \"mA\"), 255 === t[H + 1] && 1 === t[H + 3] && (r.data.type = \"mV\")), 12 === z && 32771 === i && (r.data.power_duration = 256 * t[H] + t[H + 1]), 12 === z && 32772 === i) { let e = {}, a = p(t[H]), i = p(t[H + 1]), r = 2 * a[0] + a[1]; 0 === r && (e.mode = \"idle\"), 1 === r && (e.mode = \"chock\"), 2 === r && (e.mode = \"click\"); let n = 8 * a[2] + 4 * a[3] + 2 * a[4] + a[5]; 0 === n && (e.frequency = \"idle\"), 1 === n && (e.frequency = \"1Hz\"), 2 === n && (e.frequency = \"10Hz\"), 3 === n && (e.frequency = \"25Hz\"), 4 === n && (e.frequency = \"50Hz\"), 5 === n && (e.frequency = \"100Hz\"), 6 === n && (e.frequency = \"200Hz\"), 7 === n && (e.frequency = \"400Hz\"), 8 === n && (e.frequency = \"1620Hz\"), 9 === n && (e.frequency = \"5376Hz\"), e.range = {}; let o = 2 * a[6] + a[7]; 0 === o && (e.range.precision = \"+/- 2g\", e.range.value = 16), 1 === o && (e.range.precision = \"+/- 4g\", e.range.value = 32), 2 === o && (e.range.precision = \"+/- 8g\", e.range.value = 64), 3 === o && (e.range.precision = \"+/- 16g\", e.range.value = 128); let d = 128 * i[0] + 64 * i[1] + 32 * i[2] + 16 * i[3] + 8 * i[4] + 4 * i[5] + 2 * i[6] + i[7]; e.threshold = d * e.range.value } if (32775 === z && 1 === i) { r.data.modbus_payload = \"\"; let e = t[H]; for (let a = 0; a < e; a++)S = t[H + a + 1].toString(16).toUpperCase(), 0 === a ? r.data.modbus_slaveID = t[H + a + 1] : 1 === a ? r.data.modbus_fnctID = t[H + a + 1] : 2 === a ? r.data.modbus_datasize = t[H + a + 1] : r.data.modbus_payload += S } if (32777 === z && 0 === i) { let e = t[H + 2], a = t[H + 3]; r.data.modbus_frame_series_sent = t[H + 1], r.data.modbus_frame_number_in_serie = (224 & e) >> 5, r.data.modbus_last_frame_of_serie = (28 & e) >> 2, r.data.modbus_EP9 = 1 == (1 & e), r.data.modbus_EP8 = 2 == (2 & e), r.data.modbus_EP7 = 128 == (128 & a), r.data.modbus_EP6 = 64 == (64 & a), r.data.modbus_EP5 = 32 == (32 & a), r.data.modbus_EP4 = 16 == (16 & a), r.data.modbus_EP3 = 8 == (8 & a), r.data.modbus_EP2 = 4 == (4 & a), r.data.modbus_EP1 = 2 == (2 & a), r.data.modbus_EP0 = 1 == (1 & a); let i = H + 4; if (without_header = 0, !0 === r.data.modbus_EP0) { if (0 === without_header && (r.data.modbus_slaveID_EP0 = t[i], r.data.modbus_fnctID_EP0 = t[i + 1], r.data.modbus_datasize_EP0 = t[i + 2], i += 3), r.data.modbus_payload_EP0 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP0; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP0 += S; i += r.data.modbus_datasize_EP0 } if (!0 === r.data.modbus_EP1) { if (0 === without_header && (r.data.modbus_slaveID_EP1 = t[i], r.data.modbus_fnctID_EP1 = t[i + 1], r.data.modbus_datasize_EP1 = t[i + 2], i += 3), r.data.modbus_payload_EP1 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP1; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP1 += S; i += r.data.modbus_datasize_EP1 } if (!0 === r.data.modbus_EP2) { if (0 === without_header && (r.data.modbus_slaveID_EP2 = t[i], r.data.modbus_fnctID_EP2 = t[i + 1], r.data.modbus_datasize_EP2 = t[i + 2], i += 3), r.data.modbus_payload_EP2 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP2; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP2 += S; i += r.data.modbus_datasize_EP2 } if (!0 === r.data.modbus_EP3) { if (0 === without_header && (r.data.modbus_slaveID_EP3 = t[i], r.data.modbus_fnctID_EP3 = t[i + 1], r.data.modbus_datasize_EP3 = t[i + 2], i += 3), r.data.modbus_payload_EP3 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP3; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP3 += S; i += r.data.modbus_datasize_EP3 } if (!0 === r.data.modbus_EP4) { if (0 === without_header && (r.data.modbus_slaveID_EP4 = t[i], r.data.modbus_fnctID_EP4 = t[i + 1], r.data.modbus_datasize_EP4 = t[i + 2], i += 3), r.data.modbus_payload_EP4 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP4; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP4 += S; i += r.data.modbus_datasize_EP4 } if (!0 === r.data.modbus_EP5) { if (0 === without_header && (r.data.modbus_slaveID_EP5 = t[i], r.data.modbus_fnctID_EP5 = t[i + 1], r.data.modbus_datasize_EP5 = t[i + 2], i += 3), r.data.modbus_payload_EP5 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP5; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP5 += S; i += r.data.modbus_datasize_EP5 } if (!0 === r.data.modbus_EP6) { if (0 === without_header && (r.data.modbus_slaveID_EP6 = t[i], r.data.modbus_fnctID_EP6 = t[i + 1], r.data.modbus_datasize_EP6 = t[i + 2], i += 3), r.data.modbus_payload_EP6 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP6; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP6 += S; i += r.data.modbus_datasize_EP6 } if (!0 === r.data.modbus_EP7) { if (0 === without_header && (r.data.modbus_slaveID_EP7 = t[i], r.data.modbus_fnctID_EP7 = t[i + 1], r.data.modbus_datasize_EP7 = t[i + 2], i += 3), r.data.modbus_payload_EP7 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP7; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP7 += S; i += r.data.modbus_datasize_EP7 } if (!0 === r.data.modbus_EP8) { if (0 === without_header && (r.data.modbus_slaveID_EP8 = t[i], r.data.modbus_fnctID_EP8 = t[i + 1], r.data.modbus_datasize_EP8 = t[i + 2], i += 3), r.data.modbus_payload_EP8 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP8; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP8 += S; i += r.data.modbus_datasize_EP8 } if (!0 === r.data.modbus_EP9) { if (0 === without_header && (r.data.modbus_slaveID_EP9 = t[i], r.data.modbus_fnctID_EP9 = t[i + 1], r.data.modbus_datasize_EP9 = t[i + 2], i += 3), r.data.modbus_payload_EP9 = \"\", void 0 === t[i]) return r; for (let e = 0; e < r.data.modbus_datasize_EP9; e++)S = t[i + e].toString(16).toUpperCase(), 1 === S.length && (S = \"0\" + S), r.data.modbus_payload_EP9 += S; i += r.data.modbus_datasize_EP9 } } if (82 === z && 0 === i && (r.data.active_energy = o(256 * t[H + 1] * 256 + 256 * t[H + 2] + t[H + 3], 3), r.data.reactive_energy = o(256 * t[H + 4] * 256 + 256 * t[H + 5] + t[H + 6], 3), r.data.nb_samples = 256 * t[H + 7] + t[H + 8], r.data.active_power = o(256 * t[H + 9] + t[H + 10], 2), r.data.reactive_power = o(256 * t[H + 11] + t[H + 12], 2)), 32772 === z && 0 === i && (1 === t[H] && (r.data.message_type = \"confirmed\"), 0 === t[H] && (r.data.message_type = \"unconfirmed\")), 32772 === z && 1 === i && (r.data.nb_retry = t[H]), 32772 === z && 2 === i && (r.data.automatic_association = {}, r.data.automatic_association.period_in_minutes = 256 * t[H + 1] + t[H + 2], r.data.automatic_association.nb_err_frames = 256 * t[H + 3] + t[H + 4]), 32772 === z && 3 === i && (r.data.data_rate = t[H + 2]), 32772 === z && 4 === i) { r.data.ABP_dev_address = \"\"; for (let e = 0; e < 4; e++)r.data.ABP_dev_address += String(t[H + 1 + e]), e < 3 && (r.data.ABP_dev_address += \".\") } if (32772 === z && 5 === i) { r.data.OTA_app_EUI = \"\"; for (let e = 0; e < 8; e++)r.data.OTA_app_EUI += String(t[H + 1 + e]), e < 7 && (r.data.OTA_app_EUI += \".\") } if (80 === z && 4 === i) { t[H], t[H + 1]; let e = {}, a = t[H + 2]; for (let i = 0; i < a; i++) { let a = {}; a.endpoint = t[H + 3 + 7 * i]; let r = t[H + 4 + 7 * i]; a.input_clusters = []; for (let e = 0; e < r; e++)a.input_clusters[e] = (256 * t[H + 5 + 7 * i + 2 * e] + t[H + 6 + 7 * i + 2 * e], 4); let n = t[H + 5 + 7 * i + 2 * r]; a.output_clusters = []; for (let e = 0; e < n; e++)a.output_clusters[e] = (256 * t[H + 6 + 7 * i + 2 * e] + t[H + 7 + 7 * i + 2 * e], 4); e[i] = a } r.data.configuration = e } if (80 === z && 6 === i) { let e = H + 3, a = t[H - 1]; 1 == (1 & t[H + 2]) && (r.data.main_or_external_voltage = (256 * t[e] + t[e + 1]) / 1e3, e += 2), 2 == (2 & t[H + 2]) && (r.data.rechargeable_battery_voltage = (256 * t[e] + t[e + 1]) / 1e3, e += 2), 4 == (4 & t[H + 2]) && (r.data.disposable_battery_voltage = (256 * t[e] + t[e + 1]) / 1e3, e += 2), 8 == (8 & t[H + 2]) && (r.data.solar_harvesting_voltage = (256 * t[e] + t[e + 1]) / 1e3, e += 2), 16 == (16 & t[H + 2]) && (r.data.tic_harvesting_voltage = (256 * t[e] + t[e + 1]) / 1e3, e += 2); let n = e + 1; if (138 === v || void 0 !== t[n]) { let e = []; 138 === v && e.push(\"alarm triggered\"); let o = 0, d = 1e3, l = \"multistate\", s = \"\"; s = p(t[n]), n += 1; let u = t[n + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = e), \"0\" === s[2] && \"1\" === s[3] && g(1, e, o, t, r, n), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 6, e, o, t, r, n, a, d, l, u) } } if (80 === z && 255 === A) { let e = \"action \" + t[5].toString(); r.data[e] = \"\"; let a = t[H + 1], i = \"none\"; for (let e = 0; e < a; e++)i += String.fromCharCode(t[H + 1 + e]); r.data[e] = i } if (32778 === z && 0 === i) { let e = H, a = t[e - 1]; r.data.positive_active_energy = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.negative_active_energy = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.positive_reactive_energy = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.negative_reactive_energy = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.positive_active_power = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.negative_active_power = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.positive_reactive_power = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4), e += 4, r.data.negative_reactive_power = o(256 * t[e + 1] * 256 * 256 + 256 * t[e + 2] * 256 + 256 * t[e + 3] + t[e + 4], 4); let n = e + 5; if (138 === v || void 0 !== t[n]) { let e = []; 138 === v && e.push(\"alarm triggered\"); let o = 0, d = 1, l = \"multistate\", s = \"\"; s = p(t[n]), n += 1; let u = t[n + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = e), \"0\" === s[2] && \"1\" === s[3] && g(1, e, o, t, r, n), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 10, e, o, t, r, n, a, d, l, u) } } if (32784 === z && 0 === i) { let e = t[H - 1]; r.data.active_energy_a = o(256 * t[H + 1] * 256 * 256 + 256 * t[H + 2] * 256 + 256 * t[H + 3] + t[H + 4]), r.data.reactive_energy_a = o(256 * t[H + 5] * 256 * 256 + 256 * t[H + 6] * 256 + 256 * t[H + 7] + t[H + 8]), r.data.active_energy_b = o(256 * t[H + 9] * 256 * 256 + 256 * t[H + 10] * 256 + 256 * t[H + 11] + t[H + 12]), r.data.reactive_energy_b = o(256 * t[H + 13] * 256 * 256 + 256 * t[H + 14] * 256 + 256 * t[H + 15] + t[H + 16]), r.data.active_energy_c = o(256 * t[H + 17] * 256 * 256 + 256 * t[H + 18] * 256 + 256 * t[H + 19] + t[H + 20]), r.data.reactive_energy_c = o(256 * t[H + 21] * 256 * 256 + 256 * t[H + 22] * 256 + 256 * t[H + 23] + t[H + 24]), r.data.active_energy_abc = o(256 * t[H + 25] * 256 * 256 + 256 * t[H + 26] * 256 + 256 * t[H + 27] + t[H + 28]), r.data.reactive_energy_abc = o(256 * t[H + 29] * 256 * 256 + 256 * t[H + 30] * 256 + 256 * t[H + 31] + t[H + 32]); let a = H + 33; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"multistate\", s = \"\"; s = p(t[a]), a += 1; let u = t[a + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = n), \"0\" === s[2] && \"1\" === s[3] && g(1, n, o, t, r, a), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 10, n, o, t, r, a, e, d, l, u) } } else if (32784 === z && 1 === i) { let e = t[H - 1]; r.data.active_power_a = o(256 * t[H + 1] * 256 * 256 + 256 * t[H + 2] * 256 + 256 * t[H + 3] + t[H + 4]), r.data.reactive_power_a = o(256 * t[H + 5] * 256 * 256 + 256 * t[H + 6] * 256 + 256 * t[H + 7] + t[H + 8]), r.data.active_power_b = o(256 * t[H + 9] * 256 * 256 + 256 * t[H + 10] * 256 + 256 * t[H + 11] + t[H + 12]), r.data.reactive_power_b = o(256 * t[H + 13] * 256 * 256 + 256 * t[H + 14] * 256 + 256 * t[H + 15] + t[H + 16]), r.data.active_power_c = o(256 * t[H + 17] * 256 * 256 + 256 * t[H + 18] * 256 + 256 * t[H + 19] + t[H + 20]), r.data.reactive_power_c = o(256 * t[H + 21] * 256 * 256 + 256 * t[H + 22] * 256 + 256 * t[H + 23] + t[H + 24]), r.data.active_power_abc = o(256 * t[H + 25] * 256 * 256 + 256 * t[H + 26] * 256 + 256 * t[H + 27] + t[H + 28]), r.data.reactive_power_abc = o(256 * t[H + 29] * 256 * 256 + 256 * t[H + 30] * 256 + 256 * t[H + 31] + t[H + 32]); let a = H + 33; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"multistate\", s = \"\"; s = p(t[a]), a += 1; let u = t[a + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = n), \"0\" === s[2] && \"1\" === s[3] && g(1, n, o, t, r, a), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 10, n, o, t, r, a, e, d, l, u) } } if (32779 === z && 0 === i) { let e = H, a = t[e - 1]; r.data.Vrms = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Irms = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.angle = o(256 * t[e + 1] + t[e + 2], 2); let n = e + 3; if (138 === v || void 0 !== t[n]) { let e = []; 138 === v && e.push(\"alarm triggered\"); let o = 0, d = 1, l = \"multistate\", s = \"\"; s = p(t[n]), n += 1; let u = t[n + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = e), \"0\" === s[2] && \"1\" === s[3] && g(1, e, o, t, r, n), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 6, e, o, t, r, n, a, d, l, u) } } if (32781 === z && 0 === i) { let e = t[H - 1]; r.data.Vrms_a = o(256 * t[H + 1] + t[H + 2], 2) / 10, r.data.Irms_a = o(256 * t[H + 3] + t[H + 4], 2) / 10, r.data.angle_a = o(256 * t[H + 5] + t[H + 6], 2), r.data.Vrms_b = o(256 * t[H + 7] + t[H + 8], 2) / 10, r.data.Irms_b = o(256 * t[H + 9] + t[H + 10], 2) / 10, r.data.angle_b = o(256 * t[H + 11] + t[H + 12], 2), r.data.Vrms_c = o(256 * t[H + 13] + t[H + 14], 2) / 10, r.data.Irms_c = o(256 * t[H + 15] + t[H + 16], 2) / 10, r.data.angle_c = o(256 * t[H + 17] + t[H + 18], 2); let a = H + 19; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"multistate\", s = \"\"; s = p(t[a]), a += 1; let u = t[a + 1]; \"0\" === s[2] && \"0\" === s[3] && (r.zclheader.alarmmsg = n), \"0\" === s[2] && \"1\" === s[3] && g(1, n, o, t, r, a), \"1\" === s[2] && \"0\" === s[3] && E(z, i, 6, n, o, t, r, a, e, d, l, u) } } if (32780 === z && 0 === i) { let e = t[H - 1]; r.data.concentration = 256 * t[H] + t[H + 1]; let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (32780 === z && 1 === i && (r.data.analog = t[H]), 32780 === z && 2 === i && (r.data.analog = t[H]), 1024 === z && 0 === i) { let e = t[H - 1]; r.data.illuminance = 256 * t[H] + t[H + 1]; let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (1027 === z && 0 === i) { let e = t[H - 1]; r.data.pressure = o(256 * t[H] + t[H + 1], 2); let a = H + 2; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"int\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 6, n, o, t, r, a, e, d, s) } } if (1030 === z && 0 === i) { let e = t[H - 1]; r.data.occupancy = !!t[H]; let a = H + 1; if (138 === v || void 0 !== t[a]) { let n = []; 138 === v && n.push(\"alarm triggered\"); let o = 0, d = 1, l = \"\", s = \"none\"; l = p(t[a]), a += 1, \"0\" === l[2] && \"0\" === l[3] && (r.zclheader.alarmmsg = n), \"0\" === l[2] && \"1\" === l[3] && g(1, n, o, t, r, a), \"1\" === l[2] && \"0\" === l[3] && E(z, i, 4, n, o, t, r, a, e, d, s) } } if (32850 === z && 0 === i) { let e = H; r.data.frequency = (o(256 * t[e + 1] + t[e + 2], 2) + 22232) / 1e3, e += 2, r.data.frequency_min = (o(256 * t[e + 1] + t[e + 2], 2) + 22232) / 1e3, e += 2, r.data.frequency_max = (o(256 * t[e + 1] + t[e + 2], 2) + 22232) / 1e3, e += 2, r.data.Vrms = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Vrms_min = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Vrms_max = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Vpeak = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Vpeak_min = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.Vpeak_max = o(256 * t[e + 1] + t[e + 2], 2) / 10, e += 2, r.data.over_voltage = o(256 * t[e + 1] + t[e + 2], 2), e += 2, r.data.sag_voltage = o(256 * t[e + 1] + t[e + 2], 2) } if (32783 === z) { let e = H + 1; if (0 === i) { let a = r.data.last = {}; a.NbTriggedAcq = u(t, e, \"U32\"), e += 4, a.Mean_X_G = u(t, e, \"U16\") / 100, e += 2, a.Max_X_G = u(t, e, \"U16\") / 100, e += 2, a.Dt_X_ms = u(t, e, \"U16\"), e += 2, a.Mean_Y_G = u(t, e, \"U16\") / 100, e += 2, a.Max_Y_G = u(t, e, \"U16\") / 100, e += 2, a.Dt_Y_ms = u(t, e, \"U16\"), e += 2, a.Mean_Z_G = u(t, e, \"U16\") / 100, e += 2, a.Max_Z_G = u(t, e, \"U16\") / 100, e += 2, a.Dt_Z_ms = u(t, e, \"U16\") } else if (1 === i || 2 === i || 3 === i) { let a = 1 === i ? \"Stats_X\" : 2 === i ? \"Stats_Y\" : \"Stats_Z\", n = r.data[a] = {}; n.NbAcq = u(t, e, \"U16\"), e += 2, n.MinMean_G = u(t, e, \"U16\") / 100, e += 2, n.MinMax_G = u(t, e, \"U16\") / 100, e += 2, n.MinDt = u(t, e, \"U16\"), e += 2, n.MeanMean_G = u(t, e, \"U16\") / 100, e += 2, n.MeanMax_G = u(t, e, \"U16\") / 100, e += 2, n.MeanDt = u(t, e, \"U16\"), e += 2, n.MaxMean_G = u(t, e, \"U16\") / 100, e += 2, n.MaxMax_G = u(t, e, \"U16\") / 100, e += 2, n.MaxDt = u(t, e, \"U16\"), e += 2 } else if (32768 === i) { let a = r.data.params = {}; a.WaitFreq_Hz = u(t, e, \"U16\") / 10, e += 2, a.AcqFreq_Hz = u(t, e, \"U16\") / 10, e += 2; let i = u(t, e, \"U16\"); e += 2, 32768 & i && (i = 60 * (-32769 & i)), a.NewWaitDelay_s = 32768 & i ? i = 60 * (-32769 & i) : i, a.MaxAcqDuration_ms = u(t, e, \"U16\"), e += 2, a.Threshold_X_G = u(t, e, \"U16\") / 100, e += 2, a.Threshold_Y_G = u(t, e, \"U16\") / 100, e += 2, a.Threshold_Z_G = u(t, e, \"U16\") / 100, e += 2, a.OverThrsh_Dt_ms = u(t, e, \"U16\"), e += 2, a.UnderThrsh_Dt_ms = u(t, e, \"U16\"), e += 2, a.Range_G = u(t, e, \"U16\") / 100, e += 2, a.FilterSmoothCoef = u(t, e, \"U8\"), e += 1, a.FilterGainCoef = u(t, e, \"U8\"), e += 1, a = r.data.Params.working_modes = {}, a.SignalEachAcq = 128 & t[e] ? \"true\" : \"false\", a.RstAftStdRpt_X = 1 & t[e] ? \"true\" : \"false\", a.RstAftStdRpt_Y = 2 & t[e] ? \"true\" : \"false\", a.RstAftStdRpt_7 = 4 & t[e] ? \"true\" : \"false\" } } let C = Object.keys(r.data)[0]; if (void 0 === r.data[C]) throw new a(\"bad payload\"); if (t.length <= 7) throw new a(\"bad payload\") } if (7 === v) { f = 1, i = 256 * t[6] + t[7], r.zclheader.attID = (i, 4), r.zclheader.status = t[4], r.zclheader.report_parameters = {}; let e = p(t[5]); r.zclheader.report_parameters.new_mode_configuration = e[0], \"0\" === e[2] && \"0\" === e[3] && (r.zclheader.report_parameters.cause_request = \"none\"), \"0\" === e[2] && \"1\" === e[3] && (r.zclheader.report_parameters.cause_request = \"short\"), \"1\" === e[2] && \"0\" === e[3] && (r.zclheader.report_parameters.cause_request = \"long\"), \"1\" === e[2] && \"1\" === e[3] && (r.zclheader.report_parameters.cause_request = \"reserved\"), r.zclheader.report_parameters.secured_if_alarm = e[4], r.zclheader.report_parameters.secured = e[5], r.zclheader.report_parameters.no_hearde_port = e[6], r.zclheader.report_parameters.batch = e[7] } if (9 === v) { f = 1, i = 256 * t[6] + t[7], r.zclheader.attID = _(i, 4), r.zclheader.status = t[4], r.zclheader.report_parameters = {}; let e = p(t[5]); if (r.zclheader.report_parameters.new_mode_configuration = e[0], \"0\" === e[2] && \"0\" === e[3] && (r.zclheader.report_parameters.cause_request = \"none\"), \"0\" === e[2] && \"1\" === e[3] && (r.zclheader.report_parameters.cause_request = \"short\"), \"1\" === e[2] && \"0\" === e[3] && (r.zclheader.report_parameters.cause_request = \"long\"), \"1\" === e[2] && \"1\" === e[3] && (r.zclheader.report_parameters.cause_request = \"reserved\"), r.zclheader.report_parameters.secured_if_alarm = e[4], r.zclheader.report_parameters.secured = e[5], r.zclheader.report_parameters.no_hearde_port = e[6], r.zclheader.report_parameters.batch = e[7], r.zclheader.attribut_type = t[8], r.zclheader.min = {}, 128 == (128 & t[9]) ? (r.zclheader.min.value = 256 * (t[9] - 128) + t[10], r.zclheader.min.unit = \"minutes\") : (r.zclheader.min.value = 256 * t[9] + t[10], r.zclheader.min.unit = \"seconds\"), r.zclheader.max = {}, 128 == (128 & t[11]) ? (r.zclheader.max.value = 256 * (t[11] - 128) + t[12], r.zclheader.max.unit = \"minutes\") : (r.zclheader.max.value = 256 * t[11] + t[12], r.zclheader.max.unit = \"seconds\"), r.lora.payload = \"\", 80 === z && 6 === i) { let e = t[13] / 5, a = 0; for (; e > 0;)r.zclheader.modepower = t[14 + 5 * a], r.zclheader.powersource = t[15 + 5 * a], r.zclheader.delta = 256 * t[16 + 5 * a] + t[17 + 5 * a], r.zclheader.changedpowersource = t[18 + 5 * a], a++, e-- } } if (0 === f) throw new a(\"bad payload\") } else r.batch = {}, r.batch.report = \"batch\"; return r } t.exports = { normalisation_standard: function (e, t) { let i = [], r = e.bytes, n = !0, o = 0, d = v(r, e.fPort); if (void 0 !== d.zclheader) { if (void 0 !== d.zclheader.alarmmsg && (i = d.zclheader.alarmmsg), 7 === r[1]) return { data: d.zclheader, warning: i }; if (9 === r[1]) return { data: d.zclheader, warning: i }; if (1 === r[1]) { if (void 0 === d.zclheader.data) { let t = []; for (; n;) { let a = Object.keys(d.data)[o]; if (void 0 === a) { n = !1; break } t.push({ variable: a, value: d.data[a], date: e.recvTime }), o++ } return { data: t, type: \"standard\", warning: i } } return { data: { variable: \"read reporting configuration response status\", value: d.zclheader.data, date: e.recvTime }, warning: i } } } if (void 0 !== d.zclheader) { if (void 0 !== t) { let a = d.zclheader.endpoint, r = !0, n = 0, o = [], l = \"\"; for (; r;) { let i = Object.keys(d.data)[n]; if (void 0 === i) { r = !1; break } void 0 === t[i] ? o.push({ variable: i, value: d.data[i], date: e.recvTime }) : (l = t[i][a], \"NA\" === l ? o.push({ variable: l, value: \"NA\", date: e.recvTime }) : o.push({ variable: l, value: d.data[i], date: e.recvTime })), n++ } return { data: o, type: \"standard\", warning: i } } throw a(\"bad decoding\") } return { type: d.batch.report, payload: d.lora.payload } } } } }, a = {}; function i(e) { var r = a[e]; if (void 0 !== r) return r.exports; var n = a[e] = { exports: {} }; return t[e](n, n.exports, i), n.exports } var r = {}; (() => { var e = r; let t = i(13), a = [3, [{ taglbl: 0, resol: 1, sampletype: 4, lblname: \"occupancy\", divide: 1 }, { taglbl: 1, resol: 10, sampletype: 7, lblname: \"temperature_1\", divide: 100 }, { taglbl: 2, resol: 100, sampletype: 6, lblname: \"humidity_1\", divide: 100 }, { taglbl: 3, resol: 10, sampletype: 6, lblname: \"CO2\", divide: 1 }, { taglbl: 4, resol: 10, sampletype: 6, lblname: \"TVOC\", divide: 1 }, { taglbl: 5, resol: 10, sampletype: 6, lblname: \"illuminance\", divide: 1 }, { taglbl: 6, resol: 10, sampletype: 6, lblname: \"pressure\", divide: 10 }]], n = { concentration: [\"TVOC\", \"CO2\"], temperature: [\"temperature_1\", \"temperature_2\"], humidity: [\"humidity_1\", \"humidity_2\"], pin_state: [\"violation_detection\"] }; e.decodeUplink = function (e) { return result = t.watteco_decodeUplink(e, a, n) } })(), driver = r })();\n\nif (msg.payload.data && typeof msg.payload.data === 'string') {\n\n    const buffer = Buffer.from(msg.payload.data, 'base64'); // The frame arrives in base64 in msg.payload.data\n\n    var date = new Date(msg.payload.time); // The date is recuperated from msg.payload.time\n                                          // under any format and is transformed to ISO 8601\n    var inputObject = {\n        \"bytes\": buffer, // The frame in a bytes list\n        \"fPort\": 125,    // The port (Watteco always use 125)\n        \"recvTime\": date // The date in ISO 8601 format\n    }\n\n} else {\n    node.error(\"The message doesn't carry a Base64 frame\");\n    return null;\n}\n\nmsg.payload = driver.decodeUplink(inputObject);\nreturn msg;",
         "outputs": 1,
         "timeout": 0,
         "noerr": 359,
         "initialize": "",
         "finalize": "",
         "libs": [],
         "x": 420,
         "y": 100,
         "wires": [
             [
                 "bcdb552b5eca5eda"
             ]
         ]
     }
 ]
Print Friendly