Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. OBIS Code

OBIS code

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By Siva_Sentz , 25 November, 2021
Forums
Gurux DLMS for Java

Is it possible to get a OBIS code from the push notification packet?

Profile picture for user Kurumi

Kurumi

4 years 6 months ago

Hi,

Hi,

Content of the push notification packet can be anything. Content is not defined on the DLMS standard. If OBIS code is added to the Push message, it can be read from there.

BR,
Mikko

Siva_Sentz

4 years 6 months ago

Hi,

Hi,
If the push notification packet doesn't have any information about OBIS, is there any way we can get it, as part of the connection/message.

Profile picture for user Kurumi

Kurumi

4 years 6 months ago

Hi,

Hi,

You need to read PushObjectList from the meter and save it somewhere. You can parse received data when you know the push objects. See more from the push listener example.

https://github.com/Gurux/Gurux.DLMS.Net/blob/ee85ea5c64a84372c0d96237bf…

BR,
Mikko

Siva_Sentz

4 years 6 months ago

Hi,

Hi,
1.Can you direct me how exactly i can get the push object list , like before my listener actually receives the push notification or is it something like the listener needs to know the set of values that might come in push notification.

2.Also the second approach that is mentioned in the sample code where like meter describes the content, can you give some reference on how exactly i can write that.Below is a sample code snippet on how i am creating the push notification and sending it, if you can suggest the changes for below that would be really help full.

List<GXSimpleEntry<GXDLMSObject, GXDLMSCaptureObject>> objects = new ArrayList<>();
GXDLMSRegister VOLTAGE_REGISTER = new GXDLMSRegister();
VOLTAGE_REGISTER.setObjectType(ObjectType.REGISTER);
VOLTAGE_REGISTER.setDescription(Unit.VOLTAGE.toString());
VOLTAGE_REGISTER.setLogicalName(Unit.VOLTAGE.toString());
VOLTAGE_REGISTER.setScaler(1);
VOLTAGE_REGISTER.setUnit(Unit.VOLTAGE);
VOLTAGE_REGISTER.setValue(60);
VOLTAGE_REGISTER.setDataType(2, DataType.INT8);

GXDLMSRegister ELECTRIC_CHARGE_REGISTER = new GXDLMSRegister();
ELECTRIC_CHARGE_REGISTER.setObjectType(ObjectType.REGISTER);
ELECTRIC_CHARGE_REGISTER.setDescription(Unit.ELECTRICAL_CHARGE.toString());
ELECTRIC_CHARGE_REGISTER.setLogicalName(Unit.ELECTRICAL_CHARGE.toString());
ELECTRIC_CHARGE_REGISTER.setScaler(1);
ELECTRIC_CHARGE_REGISTER.setUnit(Unit.ELECTRICAL_CHARGE);
ELECTRIC_CHARGE_REGISTER.setValue(10);
ELECTRIC_CHARGE_REGISTER.setDataType(2, DataType.INT8);

objects.add(new GXSimpleEntry<>(VOLTAGE_REGISTER, new GXDLMSCaptureObject(2, 0x11)));
objects.add(new GXSimpleEntry<>(ELECTRIC_CHARGE_REGISTER, new GXDLMSCaptureObject(2, 0x11)));
gxdlmsPushSetup.getPushObjectList().addAll(objects);
gxdlmsPushSetup.getAttributeIndexToRead(true);
try (GXNet conn = new GXNet(NetworkType.TCP, host, port)) {
conn.open();
byte[][] data = notify.generatePushSetupMessages(null, gxdlmsPushSetup);
for (byte[] p : data) {
log.info("{}",p);
log.info("{}", GXCommon.bytesToHex(p));
conn.send(p, null);
}
log.info("Push notification sent successfully");
} catch (Exception e) {
log.error("Unable to send push notification : {}", e);
}

Profile picture for user Kurumi

Kurumi

4 years 6 months ago

Hi,

Hi,

1. If push object is not part of the push messages you need to know what objects are sent in the push message and you need to add them to the push object list. You can get the list if you read the Push object list from the meter.

https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSPushSetup

2. You can parse data if you know the push object list. Something like this:

gxdlmsPushSetup.GetPushValues(client, (List<object>)notify.Value);

Now you have DLMS COSEM objects and values saved to the Push object list of the gxdlmsPushSetup.

BR,
Mikko

Siva_Sentz

4 years 6 months ago

Hi,

Hi,
Thank you for the quick reply.So I understood the parsing of push messages, but i am not able to understand how exactly i can make push objects a part of push message.Like for reference the code snippet i shared above is simulating the meter.So here when i am adding the push object list and sending the push notification to a listener.Now when i try to get the push object list at listener side it throws an error because its expecting a description i.e a sort of list of push objects.
For ref : (This is taken from the push listener example)

List<Object> tmp = (List<Object>) notify.getValue();
List<Entry<GXDLMSObject, Integer>> objects = client
.parsePushObjects((List<?>) tmp.get(0));

Now if send the push notification as shown in the above reply, the notification is received at listener side but it fails for me when i call client.parsePushObjects() method on the listener side.So i want to understand how can change the meter sample code to add that data description when i am sending the push notification.

Profile picture for user Kurumi

Kurumi

4 years 6 months ago

Hi,

Hi,

You can use parsePushObjects if you have added push object as a first item for the push objects. Like this:
objects.add(new GXSimpleEntry<GXDLMSObject, GXDLMSCaptureObject>(p, new GXDLMSCaptureObject(2, 0)));

The objects is a collection from your code.

If the push object list is not sent in the part of the Push message, you need to add push objects for the push object list and use getPushValues to update values.

BR,
Mikko

Siva_Sentz

4 years 6 months ago

Hi ,

Hi ,
As you suggested it worked perfectly for me .Just wanted to thank you for the quick replies and your help.
Thank you

Siva_Sentz

4 years 6 months ago

Hi ,

Hi ,
I had another question ,say there is single push listener and there are n no of meter trying to send push notification to the listener. so from meter side is there any specific value that i need to set in order to differentiate between meters.

Profile picture for user Kurumi

Kurumi

4 years 6 months ago

Hi,

Hi,

It's always good to add the Logical Name of the meter first and the Logical Name of the push object second for all push messages. In that way, you will know the sender and sent push object before you start to parse it.

https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSPushSetup

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin