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. Node
  3. GXDLMSData

GXDLMSData

By alnardn , 2 October, 2023
Forums
Gurux.DLMS

Hello! Is it possible to manipulate relay blocker using dlms library for python? For example, I need to turn on relay blocker, how can I make it through code?

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, I believe that you need…

Hi,

I believe that you need disconnect control to do it.
Because I don't know what meter you are using, you need to read the association view and check if GXDLMSDisconnectControl is included.

Then you can use remoteDisconnect and remoteReconnect methods to close the valve.

BR,
Mikko

alnardn

2 years 11 months ago

Thanks for your answer! I…

Thanks for your answer! I checked these methods in GXDLMSDisconnectContol.py, what is parameter named client? This parameter has method "method" and i don't undestand for what object parameter relates.

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, You can use it like this…

Hi,

You can use it like this:

d = GXDLMSDisconnectControl("YOUR_OBIS_CODE")
#Or find disconnect control from the self.client.objects if you have read the association view.

#Disconnect
self.readDataBlock(d.remoteDisconnect(self.client), reply)
#Reconnect
self.readDataBlock(d.remoteReconnect(self.client), reply)

BR,
Mikko

alnardn

2 years 11 months ago

Self.client - from what…

Self.client - from what class we take it? And this client is GXDLMSClient?

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, Use GXDLMSReader.py and…

Hi,

Use GXDLMSReader.py and the client is GXDLMSClient.

BR,
Mikko

alnardn

2 years 11 months ago

Thank you! I tried to call…

Thank you! I tried to call remoteReconnect like you recommended, but it failed with error that this method takes only two arguments. I read one more time script GXDLMSDisconnectControl.py and used it as "rele.remoteReconnect(client)". Anyway connection was not established. There is my code:
client = GXDLMSClient(clientAddress=48)
settings = GXSettings()
settings.getParameters(['', '-S', 'COM15', '-c', '48', '-s', '1'])
reader = GXDLMSReader(settings.client, settings.media, settings.trace, settings.invocationCounter)
settings.media.open()
reader.initializeConnection()
rele = GXDLMSDisconnectControl("0.0.96.3.10.255")
rele.remoteReconnect(client)
print(rele.controlState)
# prints DISCONNECTED
Where did i make mistake?

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, You need to change at…

Hi,

You need to change at least this:

rele.remoteReconnect(client)
to

self.readDataBlock(rele.remoteReconnect(settings.client), reply)

remoteReconnect only generates the bytes. It doesn't send them to the meter.

BR,
Mikko

alnardn

2 years 11 months ago

And how to change mode of…

It worked, but remoteReconnect changes relay state to "ready for reconnection", is there a way to exactly turn on rele?

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, You need to change…

Hi,

You need to change control_mode to 2 or 4.. Then the relay is connected directly without manual intervention.

BR,

Mikko

alnardn

2 years 11 months ago

How can I change the mode? I…

How can I change the mode? I saw another topic on forum https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSDisconnectControl and read comments below. I didn't understand what is lector.write(rele,4), for example.

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi, You can change it like…

Hi,

You can change it like this:

rele = GXDLMSDisconnectControl("0.0.96.3.10.255")
rele.controlMode = ControlMode.MODE_2
self.write(rele, 4)

BR,
Mikko

alnardn

2 years 11 months ago

Thank you for fast responce…

Thank you for fast responce. Method write from GXDLMSReader or GXDLMSClient?

alnardn

2 years 11 months ago

Thank you very much for help…

Thank you very much for help. Finally I figured it out.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin