Skip to content

Commit fd21d7f

Browse files
authored
yobiiq: add EM2101 + EM4301 + EM4301-CT profiles (#18)
1 parent 3402905 commit fd21d7f

21 files changed

Lines changed: 4623 additions & 0 deletions

vendors/yobiiq/codecs/dsmr.js

Lines changed: 1357 additions & 0 deletions
Large diffs are not rendered by default.

vendors/yobiiq/codecs/em2101.js

Lines changed: 984 additions & 0 deletions
Large diffs are not rendered by default.

vendors/yobiiq/codecs/em4301.js

Lines changed: 641 additions & 0 deletions
Large diffs are not rendered by default.

vendors/yobiiq/codecs/sd1001.js

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
[
2+
{
3+
"description": "fPort 0 - MAC command",
4+
"input": {
5+
"fPort": 0,
6+
"bytes": [0]
7+
},
8+
"expected": {
9+
"data": {
10+
"mac": "MAC COMMAND RECEIVED",
11+
"fPort": 0,
12+
"codecVersion": "1.0.0",
13+
"genericModel": "DSMR",
14+
"productCode": "P1002005",
15+
"manufacturer": "YOBIIQ B.V."
16+
},
17+
"errors": [],
18+
"warnings": []
19+
}
20+
},
21+
{
22+
"description": "fPort 50 - downlink success",
23+
"input": {
24+
"fPort": 50,
25+
"bytes": [0]
26+
},
27+
"expected": {
28+
"data": {
29+
"info": "DOWNLINK COMMAND SUCCEEDED",
30+
"codecVersion": "1.0.0",
31+
"genericModel": "DSMR",
32+
"productCode": "P1002005",
33+
"manufacturer": "YOBIIQ B.V."
34+
},
35+
"errors": [],
36+
"warnings": []
37+
}
38+
},
39+
{
40+
"description": "fPort 50 - generic registers",
41+
"input": {
42+
"fPort": 50,
43+
"bytes": [
44+
255, 100, 1,
45+
255, 109, 12, 228,
46+
255, 159, 2,
47+
255, 160, 1
48+
]
49+
},
50+
"expected": {
51+
"data": {
52+
"deviceStatus": "NORMAL MODE",
53+
"batteryVoltage": 3.3,
54+
"deviceClass": "CLASS C",
55+
"adr": "ENABLED",
56+
"codecVersion": "1.0.0",
57+
"genericModel": "DSMR",
58+
"productCode": "P1002005",
59+
"manufacturer": "YOBIIQ B.V."
60+
},
61+
"errors": [],
62+
"warnings": []
63+
}
64+
},
65+
{
66+
"description": "fPort 3 - device data with aliases",
67+
"input": {
68+
"fPort": 3,
69+
"bytes": [
70+
1, 19, 0, 0, 48, 57,
71+
1, 26, 0, 0, 4, 76,
72+
1, 37, 0, 0, 8, 252,
73+
1, 40, 0, 0, 0, 25
74+
]
75+
},
76+
"expected": {
77+
"data": {
78+
"electricityDeliveredToClient": 12345,
79+
"totalImportedActiveEnergy": 12345,
80+
"electricityPowerDelivered": 1100,
81+
"totalImportedActivePower": 1100,
82+
"voltageL1": 230,
83+
"currentL1": 25,
84+
"codecVersion": "1.0.0",
85+
"genericModel": "DSMR",
86+
"productCode": "P1002005",
87+
"manufacturer": "YOBIIQ B.V."
88+
},
89+
"errors": [],
90+
"warnings": []
91+
}
92+
},
93+
{
94+
"description": "fPort 11 - alarm data",
95+
"input": {
96+
"fPort": 11,
97+
"bytes": [
98+
160, 122, 9, 41,
99+
161, 167, 1
100+
]
101+
},
102+
"expected": {
103+
"data": {
104+
"internalCircuitTemperature": 23.45,
105+
"lorawanWatchdogAlarm": "ALARM",
106+
"codecVersion": "1.0.0",
107+
"genericModel": "DSMR",
108+
"productCode": "P1002005",
109+
"manufacturer": "YOBIIQ B.V."
110+
},
111+
"errors": [],
112+
"warnings": []
113+
}
114+
},
115+
{
116+
"description": "fPort 20 - historic data with one measurement",
117+
"input": {
118+
"fPort": 20,
119+
"bytes": [
120+
1, 254, 0, 0, 3, 232,
121+
160, 19, 0, 10, 0, 0, 0, 100
122+
]
123+
},
124+
"expected": {
125+
"data": {
126+
"packageTimestamp": 1000,
127+
"listOfMeasurements": [
128+
{
129+
"name": "electricityDeliveredToClient",
130+
"data": 100,
131+
"alias": "totalImportedActiveEnergy",
132+
"ts": 990
133+
}
134+
],
135+
"codecVersion": "1.0.0",
136+
"genericModel": "DSMR",
137+
"productCode": "P1002005",
138+
"manufacturer": "YOBIIQ B.V."
139+
},
140+
"errors": [],
141+
"warnings": []
142+
}
143+
},
144+
{
145+
"description": "fPort 100 - parameter data",
146+
"input": {
147+
"fPort": 100,
148+
"bytes": [
149+
255, 180, 1,
150+
255, 221, 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255
151+
]
152+
},
153+
"expected": {
154+
"data": {
155+
"dsmrProfile": "LUX",
156+
"decryptionKey": "00112233445566778899AABBCCDDEEFF",
157+
"codecVersion": "1.0.0",
158+
"genericModel": "DSMR",
159+
"productCode": "P1002005",
160+
"manufacturer": "YOBIIQ B.V."
161+
},
162+
"errors": [],
163+
"warnings": []
164+
}
165+
}
166+
]
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
[
2+
{
3+
"description": "fPort 0 - MAC command received",
4+
"input": {
5+
"fPort": 0,
6+
"bytes": [0]
7+
},
8+
"expected": {
9+
"data": {
10+
"mac": "MAC command received",
11+
"fPort": 0,
12+
"codecVersion": "1.0.1",
13+
"genericModel": "EM2101",
14+
"productCode": "P1002009",
15+
"manufacturer": "YOBIIQ B.V."
16+
}
17+
}
18+
},
19+
{
20+
"description": "fPort 50 - Downlink command ACK (succeeded)",
21+
"input": {
22+
"fPort": 50,
23+
"bytes": [0]
24+
},
25+
"expected": {
26+
"data": {
27+
"info": "Downlink command succeeded",
28+
"codecVersion": "1.0.1",
29+
"genericModel": "EM2101",
30+
"productCode": "P1002009",
31+
"manufacturer": "YOBIIQ B.V."
32+
}
33+
}
34+
},
35+
{
36+
"description": "fPort 50 - Basic device information (hwVersion, fwVersion, serialNumber, deviceClass)",
37+
"input": {
38+
"fPort": 50,
39+
"bytes": [
40+
255, 9, 1, 8,
41+
255, 10, 1, 5,
42+
255, 22, 0, 1, 35, 69,
43+
255, 15, 0
44+
]
45+
},
46+
"expected": {
47+
"data": {
48+
"hardwareVersion": "V1.8",
49+
"firmwareVersion": "V1.5",
50+
"deviceSerialNumber": 74565,
51+
"deviceClass": "Class A",
52+
"codecVersion": "1.0.1",
53+
"genericModel": "EM2101",
54+
"productCode": "P1002009",
55+
"manufacturer": "YOBIIQ B.V."
56+
}
57+
}
58+
},
59+
{
60+
"description": "fPort 50 - Relay status HIGH and AC power-on event",
61+
"input": {
62+
"fPort": 50,
63+
"bytes": [
64+
255, 0, 1,
65+
255, 11, 1
66+
]
67+
},
68+
"expected": {
69+
"data": {
70+
"relayStatus": "HIGH",
71+
"powerEvent": "AC Power On",
72+
"codecVersion": "1.0.1",
73+
"genericModel": "EM2101",
74+
"productCode": "P1002009",
75+
"manufacturer": "YOBIIQ B.V."
76+
}
77+
}
78+
},
79+
{
80+
"description": "fPort 50 - Current limit fallback (10.0 A) and voltage limit fallback (260 V)",
81+
"input": {
82+
"fPort": 50,
83+
"bytes": [
84+
255, 60, 0, 100,
85+
255, 61, 1, 4
86+
]
87+
},
88+
"expected": {
89+
"data": {
90+
"currentLimitFallback": { "data": 10, "unit": "A" },
91+
"voltageLimitFallback": { "data": 260, "unit": "V" },
92+
"codecVersion": "1.0.1",
93+
"genericModel": "EM2101",
94+
"productCode": "P1002009",
95+
"manufacturer": "YOBIIQ B.V."
96+
}
97+
}
98+
},
99+
{
100+
"description": "fPort 1 - Measurement data: index, timestamp, active energy, voltage (230V), current (5A), active power (1150W), frequency (50Hz)",
101+
"input": {
102+
"fPort": 1,
103+
"bytes": [
104+
1, 0, 0, 0, 0, 1,
105+
1, 1, 0, 0, 3, 232,
106+
1, 4, 0, 188, 97, 78,
107+
1, 12, 0, 0, 8, 252,
108+
1, 16, 0, 0, 19, 136,
109+
1, 20, 0, 0, 4, 126,
110+
1, 35, 19, 136
111+
]
112+
},
113+
"expected": {
114+
"data": {
115+
"index": 1,
116+
"timestamp": 1000,
117+
"activeEnergyImportL1T1": { "data": 12345678, "unit": "Wh" },
118+
"voltageL1N": { "data": 230, "unit": "V" },
119+
"currentL1": { "data": 5000, "unit": "mA" },
120+
"activePowerL1": { "data": 1150, "unit": "W" },
121+
"frequency": { "data": 50, "unit": "Hz" },
122+
"codecVersion": "1.0.1",
123+
"genericModel": "EM2101",
124+
"productCode": "P1002009",
125+
"manufacturer": "YOBIIQ B.V."
126+
}
127+
}
128+
},
129+
{
130+
"description": "fPort 11 - Change of state: relay CLOSED, digital input OPEN",
131+
"input": {
132+
"fPort": 11,
133+
"bytes": [
134+
1, 1, 1,
135+
2, 2, 0
136+
]
137+
},
138+
"expected": {
139+
"data": {
140+
"relayStatus": "CLOSED",
141+
"digitalInputStatus": "OPEN",
142+
"codecVersion": "1.0.1",
143+
"genericModel": "EM2101",
144+
"productCode": "P1002009",
145+
"manufacturer": "YOBIIQ B.V."
146+
}
147+
}
148+
},
149+
{
150+
"description": "fPort 60 - Event log: relay switched off due to over-current, with timestamp and current value",
151+
"input": {
152+
"fPort": 60,
153+
"bytes": [
154+
253, 1, 1,
155+
253, 3, 0, 0, 3, 232,
156+
253, 5, 0, 0, 19, 136
157+
]
158+
},
159+
"expected": {
160+
"data": {
161+
"relaySwitchingOffReason": "Due to too high current limit",
162+
"relaySwitchOffTime": 1000,
163+
"currentWhenRelaySwitchingOff": 5000,
164+
"codecVersion": "1.0.1",
165+
"genericModel": "EM2101",
166+
"productCode": "P1002009",
167+
"manufacturer": "YOBIIQ B.V."
168+
}
169+
}
170+
}
171+
]

0 commit comments

Comments
 (0)