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. TOU Updating Using Python

TOU updating using python

By kevin jose minj , 10 April, 2023
Forums
General discussion

Can anyone please explain how to update TOU in dlms meters using python code?

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, You can use script table…

Hi,

You can use script table and add actions that you want to execute. Try to read the script table so you can get an understanding what to do. You can use activity calendar to invoke scripts of the script table when you want to.

BR,
Mikko

kevin jose minj

3 years 1 month ago

Hi Mikko, This is the code I…

Hi Mikko,

This is the code I written in python
writeTOD = datetime.now()
attributeIndex=5
dayProfileAction = GXDLMSDayProfileAction()
dayProfileAction.startTime = GXTime(writeTOD)
dayProfile = GXDLMSDayProfile()
dayProfile.dayId = writeTOD.day
dayProfile.daySchedules = []
dayProfile.daySchedules.insert(0,dayProfileAction)
activityCalendar = GXDLMSActivityCalendar('0.0.13.0.1.255')
activityCalendar.dayProfileTablePassive = []
activityCalendar.dayProfileTablePassive.insert(0,dayProfile)
self.write(activityCalendar, attributeIndex)
activityCalandar = GXDLMSActivityCalendar('0.0.13.0.0.255')
activityCalandar.time= GXDateTime(datetime.now())
self.write(activityCalandar,10)

Its working fine ,But how I check the TOU is updated in meter?

Is the code missing anything?

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, Usually you are writing…

Hi,

Usually you are writing for the passive table and then you activate it.
So change index #5 (Active Day Profile Table) to index #10 (Passive Day Profile Table)

Then write it and read the activityCalandar attribute index #10 and check that the new data is there.

Then call activatePassiveCalendar to activate the day profile table.
activityCalandar.activatePassiveCalendar(self.client)

If you read the passive table it's not empty and your passive table has been moved to active table.

BR,
Mikko

kevin jose minj

3 years 1 month ago

Its returning null value I…

Its returning null value

I read through GXDLMSDirector only time is showing script and selector is missing.With which script and selector I should update here?

Image
Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, You have added a script…

Hi,

You have added a script to the day profile that doesn't exists. You need to select the script that you want to execute here. You get the list of all scripts when you add a new action.

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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin