gurux_dlms library is a high-performance Python component that helps you to read you DLMS/COSEM compatible electricity, gas or water meters. We have try to make component so easy to use that you do not need understand protocol at all.
Each meter has own server address. Server address is divided to Logical address and Physical address.Usually you can use value 1 for meter address. You can count server address from serial number of the meter.You can use GetServerAddress method for that.
Dlms Meter Serial Number
helloI have EMH meters I should add 256 to last four digit from serial numberfor example I have serial number: 4024244so my formula should be like this ? : SN%10000000+256And what should be in a field "Physical" (now is 1) and "logical" (now is 0 )
GuruxDlmsSample -h [Meter IP Address] -p [Meter Port No] -c 16 -s 1 -r SN -h host name or IP address. -p port number or name (Example: 1000). -S serial port. -i IEC is a start protocol. -a Authentication (None, Low, High). -P Password for authentication. -c Client address. (Default: 16) -s Server address. (Default: 1) -n Server address as serial number. -r [sn, sn] Short name or Logican Name (default) referencing is used. -w WRAPPER profile is used. HDLC is default. -t [Error, Warning, Info, Verbose] Trace messages. -g "0.0.1.0.0.255:1; 0.0.1.0.0.255:2" Get selected object(s) with given attribute index.Example:Read LG device using TCP/IP connection.GuruxDlmsSample -r SN -c 16 -s 1 -h [Meter IP Address] -p [Meter Port No]Read LG device using serial port connection.GuruxDlmsSample -r SN -c 16 -s 1 -sp COM1 -iRead Indian device using serial port connection.GuruxDlmsSample -S COM1 -c 16 -s 1 -a Low -P [password]
I have a power meter unit which model is LZQJ-DLMS-E-1.25, I need use labVIEW to communicate with this power meter by using serial protocol. Unfortunately, this power meter doesn't support ModBUS, it is using DLMS protocol which send a HDLC format of HEX command to the power meter to get certain value.
IEC 61107 or currently IEC 62056-21, was an international standard for a computer protocol to read utility meters. It is designed to operate over any media, including the Internet. A meter sends ASCII (in modes A..D) or HDLC (mode E) data to a nearby hand-held unit (HHU) using a serial port. The physical media are usually either modulated light, sent with an LED and received with a photodiode, or a pair of wires, usually modulated by a 20mA current loop. The protocol is usually half-duplex.
The general protocol consists of a "sign on" sequence, in which a handheld unit identifies itself to the metering unit. During sign-on, the handheld unit addresses a particular meter by number. The meter and hand-held unit negotiate various parameters such as the maximum frame length during transmission and reception, whether multiple frames can be sent without acknowledging individual frames (windowing), the fastest communication rate that they can both manage (only in case of mode E switching to HDLC) etc.
You can give command line parameters for the app. You can give example meter ip address and port number and input xml file or folder if you want to execute several messages. Connection to the meter is closed after each file is executed. If you want to ask several objecs, you can add them to the one file.You can read data from Gurux example server using HDLC framing and Logican name referencing like this:Gurux.DLMS.XmlClient -h localhost -p 4061 -x "Path to the file to execute."Parameters are:
Use: sensor53 dM to output the received data in the console. M = the number of the meter in the definition line. During the output of the data in the console, the data in the WEB UI are not updated. To return write: sensor53 d0
You can monitor the serial activity at a GPIO with a connected LED. This function is useful for debugging purposes and also to see data is coming in during normal operation. Usage: Enter the command sensor53 lx to activate this function (Lowercase L for LED). x is the number of the GPIO where the LED is connected. For example you can use sensor53 l2 for the onboard LED on a Wemos D1-mini or sensor53 l13 on a Sonoff Basic. sensor53 l255 turns the function off. This is the default value. With sensor53 mx you can choose which serial meter (x) will be monitored. Set sensor53 m0 will monitor all serial meters. This is the default value. To start the monitoring at boot-time, simply add the necessary entries in the boot-section (>B) of the script:
You can dump to your PC the raw data coming in if you use the module's hardware serial ports (1 and 3) as GPIOs of the script, using Serial to TCP Bridge. Compile your firmware with USE_TCP_BRIDGE, disable the script and configure in module parameters TCP Tx and TCP Rx. After module reboot, start the server with command TCPStart 8888. Connect to this port from your PC to see or dump the data, in Linux it's as easy as cat rawdump.txt. To revert to SML you need to set back both GPIO ports to None, enable the script and restart.
The script was derived from the DZG DWS76 (SML) device below and extended by the delivered energy. The lines for meter_id, unknown and meter_number were reduced to one line for meter_id because all values were identical.
The Q3D is a three-phase model energy meter, which was sold in a number of different configurations. This is a legacy device, however still available new in some shops. The most popular model seems to be the two-direction model for solar power metering. The D0 port is read-only with a fixed time interval of two seconds. The communication settings are unusual: 7 data bits, even parity, one stop bit, 9600 baud (9600 7E1).
The meter's manufacturer's datasheet neatly explains the serial message format used, so you can easily adapt the code below to your EasyMeter Q1D, e.g. if you have a two-way counter variant like the EasyMeter Q1DA1026.
For Tasmota versions that are built with a TasmotaSerial.cpp of version 3.5.0 (and probably all higher versions, too), no modification of the TasmotaSerial.cpp source code (as suggested in other entries of this documentation) is necessary to set the serial parameters to 7E1: By configuring the meter type as OBIS ("o") in line 5 of the above code, you implicitly tell Tasmota to set the serial parameters to 7E1 (probably the same applies to all other meters in this documentation where a modification of TasmotaSerial.cpp has previously been recommended).
This heat meter needs a wakeup sequence with 2400 Baud 8N1, wheras communication is done by 2400 Baud 8E1. The script will therefore only rund starting with Tasmota 12.2 where switching parity is implemented. For compiling, add the following to your user_config_override.h to increase serial communication buffer size and enable MQTT and Web publishing:
The Itron electrical meter is a German end-user meter installed by EnBW. You can read values using an IR Sensor. The following script shows the meter number and the consuption and the generation of a Photovoltaik generator.
I have done something similar using a Nano with simple photoresistor to pick up when the red LED pulses on my home electric meter. The nano relays this pulse by 434/433Mhz transmitter to another Arduino that has an LCD crystal display. Im measuring the time between each pulse and calculating a rate of energy consumption in kWh. Simple maths when you know that the meter pulse rate is 1 imp = 1 Wh. The code is simply an analogRead and triggers a serial transmission when a certain threshold is reached, i.e. > 500 - indicating the red light on the meter has flashed. You could always log the pulses at an SD card every 1 minute or 30 mins etc.
The AMSHAN integration reads DLMS/COSEM messages from serial port, TCP/IP or MQTT topics, and provides sensors for all elements of the messages. The integration supports all Norwegian meters currently available (Aidon, Kamstrup and Kaifa), and also support Swedish DLMS/COSEM (binary format) meters of the same brands. Work to support the ASCII based format used for some readers in Sweden is in progress.
NOTE: If the Balance is not added to the meter after recharge, press the received token number on the meter and press the blue inter button. Then, the recharged Balance of your prepaid meter will be added. 2ff7e9595c
Comments