Skip to content

Commit 9e0f40e

Browse files
SMHE-2379-SMR52c-protocol-adapter (#1754)
* SMR52c-protocol-adapter Signed-off-by: Harry Middelburg <harry.middelburg@alliander.com>
1 parent 4d69054 commit 9e0f40e

28 files changed

Lines changed: 940 additions & 713 deletions

File tree

integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/PlatformSmartmeteringDefaults.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public class PlatformSmartmeteringDefaults
7373
new ProtocolInfo.Builder().withProtocol("SMR").withProtocolVersion("5.1").build(), 1028L);
7474
PORT_MAPPING.put(
7575
new ProtocolInfo.Builder().withProtocol("SMR").withProtocolVersion("5.2").build(), 1029L);
76+
PORT_MAPPING.put(
77+
new ProtocolInfo.Builder().withProtocol("SMR").withProtocolVersion("5.2c").build(), 1032L);
7678
PORT_MAPPING.put(
7779
new ProtocolInfo.Builder().withProtocol("SMR").withProtocolVersion("5.5").build(), 1030L);
7880
PORT_MAPPING.put(

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/bundle/BundledFindEvents.feature

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @FindEvents
5+
@SmartMetering @Platform @FindEvents @SMR52c
66
Feature: SmartMetering Bundle - FindEvents
77
As a grid operator
88
I want to retrieve the events from a meter via a bundle request
@@ -72,7 +72,8 @@ Feature: SmartMetering Bundle - FindEvents
7272
| TEST1031000000001 | SMR | 4.3 | 21 | 9 | 7 | 30 | | | | |
7373
| TEST1027000000001 | SMR | 5.0.0 | 21 | 9 | 7 | 30 | 19 | | | |
7474
| TEST1028000000001 | SMR | 5.1 | 21 | 9 | 7 | 30 | 19 | 169 | | |
75-
| TEST1029000000001 | SMR | 5.2 | 21 | 9 | 7 | 30 | 19 | 169 | 6 | 9 |
75+
| TEST1029000000001 | SMR | 5.2 | 21 | 9 | 7 | 30 | 19 | 169 | 6 | |
76+
| TEST1032000000001 | SMR | 5.2c | 21 | 9 | 7 | 30 | 19 | 169 | 6 | 9 |
7677
| TEST1030000000001 | SMR | 5.5 | 21 | 9 | 7 | 30 | 19 | 169 | 6 | 9 |
7778

7879
Scenario Outline: Retrieve event codes for meter with protocol <protocol> <version> throws an Exception
@@ -148,7 +149,8 @@ Feature: SmartMetering Bundle - FindEvents
148149
| TEST1031000000001 | SMR | 4.3 | not be | not be | not be | not be | be | be | be | be |
149150
| TEST1027000000001 | SMR | 5.0.0 | not be | not be | not be | not be | not be | be | be | be |
150151
| TEST1028000000001 | SMR | 5.1 | not be | not be | not be | not be | not be | not be | be | be |
151-
| TEST1029000000001 | SMR | 5.2 | not be | not be | not be | not be | not be | not be | not be | not be |
152+
| TEST1029000000001 | SMR | 5.2 | not be | not be | not be | not be | not be | not be | not be | be |
153+
| TEST1032000000001 | SMR | 5.2c | not be | not be | not be | not be | not be | not be | not be | not be |
152154
| TEST1030000000001 | SMR | 5.5 | not be | not be | not be | not be | not be | not be | not be | not be |
153155

154156
Scenario: Retrieve an unknown event code

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/bundle/BundledGetThdFingerprint.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @SmartMeteringConfiguration @Fingerprint @NightlyBuildOnly
5+
@SmartMetering @Platform @SmartMeteringConfiguration @Fingerprint @NightlyBuildOnly @SMR52c
66
Feature: SmartMetering Bundle - GetThdFingerprint
77
As a grid operator
88
I want to be able to get the THD fingerprint and counters from a device via a bundle request
@@ -31,7 +31,7 @@ Feature: SmartMetering Bundle - GetThdFingerprint
3131

3232
Examples:
3333
| deviceIdentification | protocol | version |
34-
| TEST1029000000001 | SMR | 5.2 |
34+
| TEST1032000000001 | SMR | 5.2c |
3535
| TEST1030000000001 | SMR | 5.5 |
3636

3737
Scenario Outline: Get THD fingerprint on a single phase <protocol> <version> device
@@ -52,5 +52,5 @@ Feature: SmartMetering Bundle - GetThdFingerprint
5252

5353
Examples:
5454
| deviceIdentification | protocol | version |
55-
| TEST1029000000001 | SMR | 5.2 |
55+
| TEST1032000000001 | SMR | 5.2c |
5656
| TEST1030000000001 | SMR | 5.5 |

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/bundle/BundledSetAlarmNotifications.feature

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform
5+
@SmartMetering @Platform @SMR52c
66
Feature: SmartMetering Bundle - SetAlarmNotifications
77
As a grid operator
88
I want to be able to set alarm notifications on a meter via a bundle request
@@ -35,7 +35,7 @@ Feature: SmartMetering Bundle - SetAlarmNotifications
3535
And a bundle request
3636
| DeviceIdentification | TEST1029000000001 |
3737
And the bundle request contains a set alarm notifications action with parameters
38-
| AlarmNotificationCount | 12 |
38+
| AlarmNotificationCount | 6 |
3939
| AlarmType_1 | VOLTAGE_SAG_IN_PHASE_DETECTED_L1 |
4040
| AlarmTypeEnabled_1 | true |
4141
| AlarmType_2 | VOLTAGE_SAG_IN_PHASE_DETECTED_L2 |
@@ -48,18 +48,33 @@ Feature: SmartMetering Bundle - SetAlarmNotifications
4848
| AlarmTypeEnabled_5 | true |
4949
| AlarmType_6 | VOLTAGE_SWELL_IN_PHASE_DETECTED_L3 |
5050
| AlarmTypeEnabled_6 | true |
51-
| AlarmType_7 | THD_OVERLIMIT_IN_PHASE_L1 |
52-
| AlarmTypeEnabled7 | true |
53-
| AlarmType_8 | THD_OVERLIMIT_IN_PHASE_L2 |
54-
| AlarmTypeEnabled8 | true |
55-
| AlarmType_9 | THD_OVERLIMIT_IN_PHASE_L3 |
56-
| AlarmTypeEnabled9 | true |
57-
| AlarmType_10 | THD_LONG_OVERLIMIT_IN_PHASE_L1 |
58-
| AlarmTypeEnabled10 | true |
59-
| AlarmType_11 | THD_LONG_OVERLIMIT_IN_PHASE_L2 |
60-
| AlarmTypeEnabled11 | true |
61-
| AlarmType_12 | THD_LONG_OVERLIMIT_IN_PHASE_L3 |
62-
| AlarmTypeEnabled12 | true |
51+
When the bundle request is received
52+
Then the bundle response should contain a set alarm notifications response with values
53+
| Result | OK |
54+
55+
Scenario: Set alarm notifications on a device in a bundle request (register 2)
56+
Given a dlms device
57+
| DeviceIdentification | TEST1032000000001 |
58+
| DeviceType | SMART_METER_E |
59+
| Port | 1032 |
60+
| Protocol | SMR |
61+
| ProtocolVersion | 5.2c |
62+
And a bundle request
63+
| DeviceIdentification | TEST1032000000001 |
64+
And the bundle request contains a set alarm notifications action with parameters
65+
| AlarmNotificationCount | 6 |
66+
| AlarmType_1 | THD_OVERLIMIT_IN_PHASE_L1 |
67+
| AlarmTypeEnabled1 | true |
68+
| AlarmType_2 | THD_OVERLIMIT_IN_PHASE_L2 |
69+
| AlarmTypeEnabled2 | true |
70+
| AlarmType_3 | THD_OVERLIMIT_IN_PHASE_L3 |
71+
| AlarmTypeEnabled3 | true |
72+
| AlarmType_4 | THD_LONG_OVERLIMIT_IN_PHASE_L1 |
73+
| AlarmTypeEnabled4 | true |
74+
| AlarmType_5 | THD_LONG_OVERLIMIT_IN_PHASE_L2 |
75+
| AlarmTypeEnabled5 | true |
76+
| AlarmType_6 | THD_LONG_OVERLIMIT_IN_PHASE_L3 |
77+
| AlarmTypeEnabled6 | true |
6378
When the bundle request is received
6479
Then the bundle response should contain a set alarm notifications response with values
6580
| Result | OK |

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/bundle/BundledSetThdConfiguration.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @ThdConfiguration
5+
@SmartMetering @Platform @ThdConfiguration @SMR52c
66
Feature: SmartMetering Bundle - THD Configuation
77
As a grid operator
88
I want to be able to set configuration for THD on a meter via a bundle request
@@ -27,7 +27,7 @@ Feature: SmartMetering Bundle - THD Configuation
2727

2828
Examples:
2929
| deviceIdentification | protocol | version |
30-
| TEST1029000000002 | SMR | 5.2 |
30+
| TEST1032000000002 | SMR | 5.2c |
3131
| TEST1030000000002 | SMR | 5.5 |
3232

3333

@@ -56,3 +56,4 @@ Feature: SmartMetering Bundle - THD Configuation
5656
| TEST1031000000002 | SMR | 4.3 |
5757
| TEST1027000000002 | SMR | 5.0.0 |
5858
| TEST1028000000002 | SMR | 5.1 |
59+
| TEST1029000000002 | SMR | 5.2 |

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/configuration/SetAlarmNotifications.feature

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @SmartMeteringConfiguration
5+
@SmartMetering @Platform @SmartMeteringConfiguration @SMR52c
66
Feature: SmartMetering Configuration - Set Alarm Notifications
77
As a grid operator
88
I want to be able to set alarm notifications on a device
@@ -36,6 +36,28 @@ Feature: SmartMetering Configuration - Set Alarm Notifications
3636
| SMR | 5.0.0 | false | true | |
3737
| SMR | 5.1 | false | true | |
3838

39+
Scenario Outline: Set alarm notifications in register 1 and 2 on a <protocol> <version> device (other alarms in request that are not in register 1 or 2 are ignored)
40+
Given a dlms device
41+
| DeviceIdentification | TEST1029000000001 |
42+
| DeviceType | SMART_METER_E |
43+
| Protocol | <protocol> |
44+
| ProtocolVersion | <version> |
45+
When the set alarm notifications request is received
46+
| DeviceIdentification | TEST1029000000001 |
47+
| AlarmType_1 | CLOCK_INVALID |
48+
| AlarmTypeEnabled1 | TRUE |
49+
| AlarmType_2 | VOLTAGE_SAG_IN_PHASE_DETECTED_L1 |
50+
| AlarmTypeEnabled2 | TRUE |
51+
| AlarmType_3 | LAST_GASP |
52+
| AlarmTypeEnabled3 | TRUE |
53+
Then the specified alarm notifications should be set on the device
54+
| DeviceIdentification | TEST1029000000001 |
55+
56+
Examples:
57+
| protocol | version |
58+
| SMR | 5.2 |
59+
| SMR | 5.5 |
60+
3961
Scenario Outline: Set alarm notifications in register 1 and 2 on a <protocol> <version> device (other alarms in request that are not in register 1 or 2 are ignored)
4062
Given a dlms device
4163
| DeviceIdentification | TEST1029000000001 |
@@ -57,7 +79,7 @@ Feature: SmartMetering Configuration - Set Alarm Notifications
5779

5880
Examples:
5981
| protocol | version |
60-
| SMR | 5.2 |
82+
| SMR | 5.2c |
6183
| SMR | 5.5 |
6284

6385
Scenario: Set alarm notifications in register 1, 2 and 3 on a SMR 5.5 device
@@ -175,21 +197,33 @@ Feature: SmartMetering Configuration - Set Alarm Notifications
175197
| AlarmTypeEnabled5 | false |
176198
| AlarmType_6 | VOLTAGE_SWELL_IN_PHASE_DETECTED_L3 |
177199
| AlarmTypeEnabled6 | false |
178-
| AlarmType_7 | THD_OVERLIMIT_IN_PHASE_L1 |
179-
| AlarmTypeEnabled7 | false |
180-
| AlarmType_8 | THD_OVERLIMIT_IN_PHASE_L2 |
181-
| AlarmTypeEnabled8 | false |
182-
| AlarmType_9 | THD_OVERLIMIT_IN_PHASE_L3 |
183-
| AlarmTypeEnabled9 | false |
184-
| AlarmType_10 | THD_LONG_OVERLIMIT_IN_PHASE_L1 |
185-
| AlarmTypeEnabled10 | false |
186-
| AlarmType_11 | THD_LONG_OVERLIMIT_IN_PHASE_L2 |
187-
| AlarmTypeEnabled11 | false |
188-
| AlarmType_12 | THD_LONG_OVERLIMIT_IN_PHASE_L3 |
189-
| AlarmTypeEnabled12 | false |
190200
Then the specified alarm notifications should be set on the device
191201
| DeviceIdentification | TEST1029000000001 |
192202

203+
@NightlyBuildOnly
204+
Scenario: Set all alarm notifications disabled on a SMR 5.2c device
205+
Given a dlms device
206+
| DeviceIdentification | TEST1032000000001 |
207+
| DeviceType | SMART_METER_E |
208+
| Protocol | SMR |
209+
| ProtocolVersion | 5.2c |
210+
When the set alarm notifications request is received
211+
| DeviceIdentification | TEST1032000000001 |
212+
| AlarmType_1 | THD_OVERLIMIT_IN_PHASE_L1 |
213+
| AlarmTypeEnabled1 | false |
214+
| AlarmType_2 | THD_OVERLIMIT_IN_PHASE_L2 |
215+
| AlarmTypeEnabled2 | false |
216+
| AlarmType_3 | THD_OVERLIMIT_IN_PHASE_L3 |
217+
| AlarmTypeEnabled3 | false |
218+
| AlarmType_4 | THD_LONG_OVERLIMIT_IN_PHASE_L1 |
219+
| AlarmTypeEnabled4 | false |
220+
| AlarmType_5 | THD_LONG_OVERLIMIT_IN_PHASE_L2 |
221+
| AlarmTypeEnabled5 | false |
222+
| AlarmType_6 | THD_LONG_OVERLIMIT_IN_PHASE_L3 |
223+
| AlarmTypeEnabled6 | false |
224+
Then the specified alarm notifications should be set on the device
225+
| DeviceIdentification | TEST1032000000001 |
226+
193227
@NightlyBuildOnly
194228
Scenario: Set all alarm notifications disabled on a SMR 5.5 device
195229
Given a dlms device

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/configuration/SetThdConfiguration.feature

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @SmartMeteringConfiguration @NightlyBuildOnly @ThdConfiguration
5+
@SmartMetering @Platform @SmartMeteringConfiguration @NightlyBuildOnly @ThdConfiguration @SMR52c
66
Feature: SmartMetering Configuration - Set THD Configuration
77
As a grid operator
88
I want to be able to set the THD configuration on a device
@@ -26,10 +26,11 @@ Feature: SmartMetering Configuration - Set THD Configuration
2626

2727
Examples:
2828
| deviceIdentification | protocol | version | shouldBeSetOrNot |
29-
| TEST1029000000002 | SMR | 5.2 | should be set |
29+
| TEST1032000000002 | SMR | 5.2c | should be set |
3030
| TEST1030000000002 | SMR | 5.5 | should be set |
3131
| TEST1024000000002 | DSMR | 2.2 | should not be set |
3232
| TEST1024000000002 | DSMR | 4.2.2 | should not be set |
3333
| TEST1031000000002 | SMR | 4.3 | should not be set |
3434
| TEST1027000000002 | SMR | 5.0.0 | should not be set |
35-
| TEST1028000000002 | SMR | 5.1 | should not be set |
35+
| TEST1028000000002 | SMR | 5.1 | should not be set |
36+
| TEST1029000000002 | SMR | 5.2 | should not be set |

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/monitoring/GetActualMeterReads.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @SmartMeteringMonitoring
5+
@SmartMetering @Platform @SmartMeteringMonitoring @GetActualMeterReads
66
Feature: SmartMetering Monitoring - Get Actual Meter Reads
77
As a grid operator
88
I want to be able to get the actual meter reads from a device

integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/monitoring/GetThdFingerprint.feature

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
@SmartMetering @Platform @SmartMeteringMonitoring @Fingerprint
5+
@SmartMetering @Platform @SmartMeteringMonitoring @Fingerprint @SMR52c
66
Feature: SmartMetering Monitoring - Get Thd Fingerprint
77
As a grid operator
88
I want to be able to get the THD fingerprint and counters from a device
@@ -29,7 +29,7 @@ Feature: SmartMetering Monitoring - Get Thd Fingerprint
2929

3030
Examples:
3131
| DeviceId | Protocol | ProtocolVersion |
32-
| TEST1029000000001 | SMR | 5.2 |
32+
| TEST1032000000001 | SMR | 5.2c |
3333
| TEST1030000000001 | SMR | 5.5 |
3434

3535
Scenario Outline: Get the THD fingerprint from a single phase <Protocol> <ProtocolVersion> E-meter
@@ -48,7 +48,7 @@ Feature: SmartMetering Monitoring - Get Thd Fingerprint
4848

4949
Examples:
5050
| DeviceId | Protocol | ProtocolVersion |
51-
| TEST1029000000001 | SMR | 5.2 |
51+
| TEST1032000000001 | SMR | 5.2c |
5252
| TEST1030000000001 | SMR | 5.5 |
5353

5454
Scenario Outline: Get THD fingerprint is not supported on a <Protocol> <ProtocolVersion> E-meter
@@ -69,3 +69,4 @@ Feature: SmartMetering Monitoring - Get Thd Fingerprint
6969
| TEST1031000000002 | SMR | 4.3 |
7070
| TEST1027000000002 | SMR | 5.0.0 |
7171
| TEST1028000000002 | SMR | 5.1 |
72+
| TEST1029000000002 | SMR | 5.2 |
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
DO
2+
$$
3+
BEGIN
4+
5+
IF NOT EXISTS (
6+
SELECT 1
7+
FROM protocol_info
8+
WHERE protocol = 'SMR'
9+
AND protocol_version = '5.2c') THEN
10+
11+
INSERT INTO protocol_info(
12+
creation_time,
13+
modification_time,
14+
protocol,
15+
protocol_version,
16+
outgoing_requests_property_prefix,
17+
incoming_responses_property_prefix,
18+
incoming_requests_property_prefix,
19+
outgoing_responses_property_prefix,
20+
parallel_requests_allowed)
21+
VALUES (
22+
CURRENT_TIMESTAMP,
23+
CURRENT_TIMESTAMP,
24+
'SMR',
25+
'5.2c',
26+
'jms.protocol.dlms.outgoing.requests',
27+
'jms.protocol.dlms.incoming.responses',
28+
'jms.protocol.dlms.incoming.requests',
29+
'jms.protocol.dlms.outgoing.responses',
30+
true);
31+
32+
END IF;
33+
34+
END;
35+
$$

0 commit comments

Comments
 (0)