Skip to content

Commit

Permalink
SMHE-832: first steps config objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Bolder committed Jun 24, 2022
1 parent d5e6bba commit 6b0e7f3
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.opensmartgridplatform.domain.smartmetering.config;

public class Attribute {
public int id;
public String description;
public String datatype;
public String valuetype;
public String value;
public String access;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.opensmartgridplatform.domain.smartmetering.config;

public class CosumObject {
public String tag;
public String description;

@JsonProperty("class-id")
public int classId;

public int version;
public String obis;
public String group;
public ArrayList<String> meterTypes;
public ArrayList<Attribute> attributes;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.opensmartgridplatform.domain.smartmetering.config;

import java.util.ArrayList;

public class MeterConfig {
public String profile;
public String version;
public String description;
public ArrayList<Setting> settings;
public ArrayList<CosumObject> cosumObjects;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.opensmartgridplatform.domain.smartmetering.config;

public class Setting {
@JsonProperty("firmware update type")
public String firmwareUpdateType;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2022 Alliander N.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/

package org.opensmartgridplatform.domain.smartmetering.config;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;

public class MeterConfigTest {

@Test
void loadJsonFile() throws JsonProcessingException {

final ObjectMapper objectMapper = new ObjectMapper();

objectMapper.readValue("meter-profile-config-SMR-5.0.json", MeterConfig.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"profile": "SMR",
"version": "5.0",
"description": "Profile for Smart Meter Requirements 5.0",
"settings": [
{
"firmware update type": "SMR"
}
],
"cosumObjects": [
{
"tag": "CLOCK",
"description": "Clock",
"class-id": 8,
"version": 0,
"obis": "0-0:1.0.0.255",
"group": "ABSTRACT",
"meterTypes": [
"SP",
"PP"
],
"attributes": [
{
"id": 2,
"description": "time",
"datatype": "octet-string",
"valuetype": "DYNAMIC",
"value": "CURRENT_LOCAL_DATE_AND_TIME",
"access": "RW"
},
{
"id": 3,
"description": "time_zone",
"datatype": "long",
"valuetype": "FIXED_IN_PROFILE",
"value": "-60",
"access": "RW"
},
{
"id": 4,
"description": "status",
"datatype": "clock_status",
"valuetype": "DYNAMIC",
"value": "OK",
"access": "R"
}
]
},
{
"tag": "ACTIVE_FIRMWARE_VERSION",
"description": "Active firmware version",
"class-id": 1,
"version": 0,
"obis": "1-0:0.2.0.255",
"group": "ABSTRACT",
"meterTypes": [
"SP",
"PP"
],
"attributes": [
{
"id": 2,
"description": "value",
"datatype": "octet-string",
"valuetype": "FIXED_IN_METER",
"value": "firmware id 1",
"access": "R"
}
]
},
{
"tag": "ACTIVE_ENERGY_IMPORT",
"description": "Active energy import (+A)",
"class-id": 3,
"version": 0,
"obis": "1-0:1.8.0.255",
"group": "ELECTRICITY",
"meterTypes": [
"SP",
"PP"
],
"attributes": [
{
"id": 2,
"description": "value",
"datatype": "double-long-unsigned",
"valuetype": "DYNAMIC",
"value": "100",
"access": "R"
},
{
"id": 3,
"description": "scaler_unit",
"datatype": "scal_unit_type",
"valuetype": "FIXED_IN_PROFILE",
"value": "0, Wh",
"access": "R"
}
]
},
{
"tag": "ACTIVE_ENERGY_EXPORT",
"description": "Active energy export (-A)",
"class-id": 3,
"version": 0,
"obis": "1-0:2.8.0.255",
"group": "ELECTRICITY",
"meterTypes": [
"SP",
"PP"
],
"attributes": [
{
"id": 2,
"description": "value",
"datatype": "double-long-unsigned",
"valuetype": "DYNAMIC",
"value": "RANDOM(0,1000)",
"access": "R"
},
{
"id": 3,
"description": "scaler_unit",
"datatype": "scal_unit_type",
"valuetype": "FIXED_IN_PROFILE",
"value": "0, Wh",
"access": "R"
}
]
},
{
"tag": "MBUS_CLIENT_SETUP",
"description": "M-Bus client setup",
"class-id": 72,
"version": 1,
"obis": "0-c:24.1.0.255",
"group": "GAS",
"meterTypes": [
"SP",
"PP"
],
"attributes": [
{
"id": 2,
"description": "mbus_port_reference",
"datatype": "octet-string",
"valuetype": "FIXED_IN_PROFILE",
"value": "0-0:24.6.0.255",
"access": "R"
},
{
"id": 3,
"description": "capture_definition",
"datatype": "array",
"valuetype": "DYNAMIC",
"value": "EMPTY_ARRAY",
"access": "R"
},
{
"id": 4,
"description": "capture_period",
"datatype": "double-long-unsigned",
"valuetype": "FIXED_IN_PROFILE",
"value": "0",
"access": "RW"
},
{
"id": 5,
"description": "primary_address",
"datatype": "unsigned",
"valuetype": "FIXED_IN_PROFILE",
"value": "0",
"access": "RW"
}
]
}
]
}

0 comments on commit 6b0e7f3

Please sign in to comment.