Giter VIP home page Giter VIP logo

kaifa's Introduction

Kaifa MA309 Smart Meter Logger

Overview

This script was made to read out the new Smart Meter "Kaifa MA309" used by Austrian power grid operators, here tested with TINETZ and EVN.

Specification of the interface: https://www.tinetz.at/fileadmin/user_upload/Kundenservice/pdf/Beschreibung_Kundenschnittstelle_Smart_Meter_TINETZ.pdf

Discussion about this script: https://www.photovoltaikforum.com/thread/157476-stromz%C3%A4hler-kaifa-ma309-welches-mbus-usb-kabel/?pageNo=2#post2350873

Useful description of TiNetz frames: https://www.gurux.fi/node/18232

This script was only tested with the above meter and the mentioned suppliers.

Required Hardware

Picture of wiring

  1. RJ12 6P6C Plug

    e.g. https://www.amazon.de/6P6C-Stecker-6-polige-Schraubklemmen-Adapterstecker-CCTV-Adapterstecker/dp/B07KFGS3BF

    Note: you have to cut off the plastic shell of the RJ12 plug to fit it into the socket of the MA309.

  2. MBUS Slave module like this:

    https://www.amazon.de/JOYKK-USB-zu-MBUS-Slave-Modul-Master-Slave-Kommunikation-Debugging-Bus%C3%BCberwachung/dp/B07PDH2ZBV

Config

Create a file meter.json to configure your serial connection parameters and your AES key.

A template file meter_template.json can be recycled for this.

{
  "loglevel": "logging.INFO",
  "logfile": "/var/log/kaifareader/kaifa.log",
  "port": "/dev/ttyUSB0",
  "baudrate": 2400,
  "parity": "serial.PARITY_NONE",
  "stopbits": "serial.STOPBITS_ONE",
  "bytesize": "serial.EIGHTBITS",
  "key_hex_string": "",
  "interval": 15,
  "supplier": "TINETZ",
  "export_format": "SOLARVIEW",
  "export_file_abspath": "/var/run/kaifareader/kaifa.txt",
  "export_mqtt_server": "mymqtt.examplebroker.com",
  "export_mqtt_port": 1883,
  "export_mqtt_user": "mymqttuser",
  "export_mqtt_password": "supersecretmqttpass",
  "export_mqtt_basetopic": "kaifareader"
}

The AES key format is "hex string", e.g. a4f2d...

Please provide your electricity supplier by the field "supplier". Because each supplier uses its own security standard, the telegrams differ. This script was tested with suppliers:

  • TINETZ
  • EVN

Export

Solarview

Currently, the export to a file readable by Solarview (http://solarview.info/) is supported.

  • The config key export_format has to be set to SOLARVIEW
  • The config key export_file_abspath has to be set to the absolute file path

MQTT

  • The config key export_format has to be set to MQTT
  • The config keys export_mqtt_server, export_mqtt_port, export_mqtt_user, export_mqtt_password and export_mqtt_basetopic have to be set.

Installation

Systemd automatic service

This installs and automatically starts a systemd service.

Install the debian package

sudo dpkg -i kaifareader_...deb

If there are problems on missing packages, execute afterwards:

sudo apt -f install

Start

Automatically, if service is installed and running

Startup done, automatically.

Status of the service:

sudo systemctl status kaifareader

Start manually (e.g. after manually stopped)

sudo systemctl start kaifareader

Manually

Foreground

python3 kaifa.py

Background

nohup python3 kaifa.py &

Stop

If service is installed and running

sudo systemctl stop kaifareader

Foreground

Press CTRL+C

Background

Possible by killing the process

kaifa's People

Contributors

tirolerstefan avatar boredomwontgetus avatar kitzler-walli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.