Skip to content

ru-asdx/mercury-em

Repository files navigation

mercury-em

Receiving information from Mercury energymeters (RS485 over TCP/IP)

Official documentation on protocols used in Mercury energymeters:

Installation

Use venv

$ git clone https://github.com/ru-asdx/mercury-em
$ cd mercury-em
$ python3.9 -m venv .env
$ source .env/bin/activate

Install dependencies

$ pip install -r requirements.txt

Use it

$ ./mercury-em.py --proto m206 --serial 12345678 --host 192.168.1.100 --port 50 --format json
$ ./mercury-em.py --proto m236 --serial 12345678 --host 192.168.1.100 --port 50 --user admin --pass 222222 --format json

Usage

$ ./mercury-em.py -h

Mercury energy meter data receiver

optional arguments:
   --proto [{m206,m236}]             Used protocol (M206/M236)
   --serial [SERIAL]                 Serial number of energymeter
   --host [HOST]                     RS485-TCP/IP converter ip-address
   --port [PORT]                     RS485-TCP/IP converter port
   --user [{user,admin}]             Access level (User/Admin) (only for m236 protocol)
   --pass [PASSWD]                   Access password (only for m236 protocol)
   --format [{text,json}]            Output format