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. DLMS Python Client

DLMS Python Client

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 technoshell , 18 July, 2020
Forums
Gurux.DLMS

Respected Sir

I am using GURUX.DLMS.Client.Example.python. I am using python3.7 and installed all dependencies listed in requirements.txt. I first read the Inesh make meter from DLMS director with low authentication and it worked fine. I also checked it with Renesas utility and it also worked fine.
I ran it with the command
python main.py -S COM6 -t Verbose -c 32 -s 1 -d India -C None -a Low -P genesis

This gives a huge amount of information.
I actually need only Active Energy , Reactive Energy and Apparent Energy.

Could you please guide on how to get these without going through the entire sequence.

Thanks and Regards
Ajit

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi Ajit,

Hi Ajit,

Each DLMS meter is different and for this reason all the objects are read from the meter. You need to check what is Logical name of the object that you want to read and then find readAll and remove everything after self.initializeConnection().

Then you can read example register object like this:
it = GXDLMSRegister("LOGICAL NAME")
//Read scaler and unit.
self.read(it, 3)
//Read value.
self.read(it, 2)

You can use Renesas or GXDLMSDirector to read the data and find out object types and correct logical names.

BR,
Mikko

technoshell

5 years 10 months ago

Thank You Sir,

Thank You Sir,

I will try it out.

Regards
Ajit

technoshell

5 years 10 months ago

Dear Sir

Dear Sir

As advised by you I changed the code to read Frequency. I checked the logical name from GXDLMSDirector. I am attachng the screen shot of what I got from the meter.

Could you please guide me if this is correct and how to get the Frequency value and unit?

Regards
Ajit

def readAll(self, outputFile):
try:
read = False
self.initializeConnection()
it = GXDLMSRegister("1.0.14.7.0.255")
#Read scaler and unit.
self.read(it, 3)
#Read value.
self.read(it, 2)

# if outputFile and os.path.exists(outputFile):
# try:
# c = GXDLMSObjectCollection.load(outputFile)
# self.client.objects.extend(c)
# if self.client.objects:
# read = True
# except Exception:
# read = False
# if not read:
# self.getAssociationView()
# self.readScalerAndUnits()
# self.getProfileGenericColumns()
# self.getReadOut()
# self.getProfileGenerics()
# if outputFile:
# self.client.objects.save(outputFile)
except (KeyboardInterrupt, SystemExit):
#Don't send anything if user is closing the app.
self.media = None
raise
finally:
self.close()

Image
Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Please, don't add pics like this. They are compressed and others can't read them.
You can get the value like this from the register object:

print(it.value)

BR,
Mikko

technoshell

5 years 10 months ago

Dear Sir

Dear Sir

Very Sorry for the image upload.
Thanks a lot for your time and response.
It worked well.

Best Regards
Ajit

technoshell

5 years 10 months ago

Only one thing. Disconnect

Only one thing. Disconnect Request executes successfully but the program does not terminate. One has to force terminate it. What is the best way to terminate the program?

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

The program should close automatically. Are you receiving reply from the meter for the disconnect request? I believe that app is waiting for a reply from the meter. Can you check this?

BR,
Mikko

technoshell

5 years 10 months ago

Dear Sir,

Dear Sir,
Yes I am receiving the reply from Disconnect Request.
I debugged it to find that the function self.media.close() is hanging. So I just added a time.sleep(2) before it and it worked well.
Thank you so much for your time and help.

Regards
Ajit

  • 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