Auslesen, entschlüsseln und parsen von Smart Meter Telegrammen

Overview

Netz-NÖ SmartMeter-P1-Reader

https://www.netz-noe.at/Download-(1)/Smart-Meter/218_9_SmartMeter_Kundenschnittstelle_lektoriert_14.aspx

Dieses Skript entschlüsselt Telegramme (DLMS) von der P1 Schnittstelle eines Sagemcom T210-D. Die Telegramme werden anschließend geparst und folgende Werte an einen MQTT-Broker gesendent:

  • kWh_in: Bezogene Energie in kWh (Gesamtwert)
  • kWh_out: Eingespeiste Energie in kWh (Gesamtwert)
  • pwr_in: Aktueller Verbrauch in Watt
  • pwr_out: Aktuelle Einspeisung in Watt

Installation:

  • Python libraries installieren (pip install -r requirements.txt)
  • Konfigurationsparameter im .env-File eintragen. Der KEY ist der Entschlüsselungskey, welcher von Netz-NÖ beantragt werden muss.
  • Falls das Skript nicht als root ausgeführt wird: Anlegen der Datei "/var/log/decrypter.log" (Setzen der Rechte auf die Datei nicht vergessen).

Beispiel-Konfiguration:

PORT='/dev/ttyUSB0'
BAUD=2400
KEY=XXXXXXXXXXXXXXXXXXXXXXX
LOGLEVEL=WARNING
MQTT_USER=mqttuser
MQTT_PASS=mqttpassword
MQTT_HOST='192.168.420.666'
MQTT_PORT=1883
MQTT_TOPIC='/haus/smartmeter/vals'

Run as a Service

  • Folgende Datei anlegen: /etc/systemd/system/smart.service
  • Die Parameter "ExecStart", "User" und "Group" anpassen nicht vergessen!
[Unit]
Description=Smart Meter Decrypter
Documentation=https://github.com/langi0815/Netz_NOE_SmartMeter_P1_Reader
After=networking.service
[Service]
Type=simple
User=pi
Group=pi
TimeoutStartSec=0
Restart=on-failure
RestartSec=30s
ExecStart=/usr/bin/python3 /home/pi/scripts/decrypter.py
[Install]
WantedBy=multi-user.target

Danach folgende Befehle ausführen:

  • sudo systemctl enable smart
  • sudo systemctl start smart

Mit folgendem Befehl kann überprüft werden, ob der Service ordnungsgemäß läuft:

  • sudo systemctl status smart

Falls es Probleme gibt:

  • sudo journalctl -u smart (nach unten scrollen nicht vergessen)

Verwendete Hardware:

  • BELTI USB-zu-MBUS-Slave-Modul (von Amazon)
  • RJ12 Kabel
  • Raspberry Pi

Für die Aufbereitung der Daten wird Hassio + Mossquito-Broker empfohlen

Beispielconfig der Sensoren (Hassio):

 - platform: mqtt
    state_topic: /home/smartmeter/vals
    name: SmartMeter_kWh_in
    value_template: "{{value_json.kWh_in}}"
    unit_of_measurement: "kWh"
    last_reset_topic: '/home/smartmeter/vals'
    last_reset_value_template: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: measurement
  - platform: mqtt
    state_topic: /home/smartmeter/vals
    name: SmartMeter_kWh_out
    value_template: "{{value_json.kWh_out}}"
    unit_of_measurement: "kWh"
    last_reset_topic: '/home/smartmeter/vals'
    last_reset_value_template: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: measurement
  - platform: mqtt
    state_topic: /home/smartmeter/vals
    name: SmartMeter_power_in
    value_template: "{{value_json.pwr_in}}"
    unit_of_measurement: "W"
    last_reset_topic: '/home/smartmeter/vals'
    last_reset_value_template: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: measurement
  - platform: mqtt
    state_topic: /home/smartmeter/vals
    name: SmartMeter_power_out
    value_template: "{{value_json.pwr_out}}"
    unit_of_measurement: "W"
    last_reset_topic: '/home/smartmeter/vals'
    last_reset_value_template: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: measurement
A python library created to make life easier for Telegram API Developers.

opentele A python library created to make life easier for Telegram API Developers. Read the documentation Features Convert Telegram Desktop tdata sess

103 Jan 02, 2023
A complete Python application to automatize the process of uploading files to Amazon S3

Upload files or folders (even with subfolders) to Amazon S3 in a totally automatized way taking advantage of: Amazon S3 Multipart Upload: The uploaded

Pol Alzina 1 Nov 20, 2021
Coinbase Listing Sniper

Coinbase Listing Sniper Script that listens to the @CoinbaseAssets twitter to find information about new Coinbase listings, and automatically buys 100

4 Oct 26, 2022
A CLI tool to transfer, sync, and backup playlists on music streaming services

unitunes A command-line interface tool to manage playlists across music streaming services. Introduction unitunes manages playlists across streaming s

Victor Tao 50 Jan 07, 2023
A bot for Large Fry Larrys

GroupMe Bot Driver This driver is written entirely in Python, and with easy configuration in mind. Using this driver, you'll be able to monitor multip

1 Oct 25, 2021
An async-ready Python wrapper around FerrisChat's API.

FerrisWheel An async-ready Python wrapper around FerrisChat's API. Installation Instructions Linux: $ python3.9 -m pip install -U ferriswheel Python 3

FerrisChat 8 Feb 08, 2022
A discord bot consuming Notion API to add, retrieve data to Notion databases.

Notion-DiscordBot A discord bot consuming Notion API to add and retrieve data from Notion databases. Instructions to use the bot: Pre-Requisites: a)In

Servatom 57 Dec 29, 2022
Purpose To make a cloudflare challenge pass successfully, Can be use cf_clearance bypassed by cloudflare

Purpose To make a cloudflare challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with the cf_clearance, make sure you use the same IP and UA as when you got it.

vvanglro 129 Jan 09, 2023
TwitchAccountMaker - Twitch Account Maker with python

Twitch Account Creator A Twitch Account Creator, Requires Capmonster.cloud Verif

vanis / 1800 0 Jan 20, 2022
Who are we? We are the Hunters of all Torrent in this world.🗡️.Fork from SlamDevs

MIRROR HUNTER This Mirror Bot is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. Repo la

Anime Republic 130 May 28, 2022
Auto Moderation is a powerfull moderation bot

Auto Moderation.py Auto Moderation a powerful Moderation Discord Bot 🎭 Futures Moderation Auto Moderation 🚀 Installation git clone https://github.co

G∙MAX 2 Apr 02, 2022
This solution helps you deploy Data Lake Infrastructure on AWS using CDK Pipelines.

CDK Pipelines for Data Lake Infrastructure Deployment This solution helps you deploy data lake infrastructure on AWS using CDK Pipelines. This is base

AWS Samples 66 Nov 23, 2022
My beancount practice as a template

my-beancount-template 个人 Beancount 方案的模板仓库 相关博客 复式记账指北(一):What and Why? 复式记账指北(二):做账方法论 复式记账指北(三):如何打造不半途而废的记账方案 配置 详细配置请参考博客三。必须修改的配置有: Bot功能:data/be

KAAAsS 29 Nov 29, 2022
Editing a Tinder bot created by @frederikme

tinder_bot_edit Editing a Tinder bot created by @frederikme Table of Contents Basic Swipe Bot Basic Swipe Bot Download the code as a zip or clone the

Alex Carter 1 Nov 23, 2021
Discord RPC for Notion written in Python

Discord RPC for Notion This is a program that allows you to add your Notion workspace activities to your Discord profile. This project is currently un

Thuliumitation 1 Feb 10, 2022
Disctopia-c2 - Windows Backdoor that is controlled through Discord

Disctopia Disctopia Command and Control What is Disctopia? Disctopia is an open

Dimitris Kalopisis 218 Dec 26, 2022
Python script to decode the EU Covid-19 vaccine certificate

vacdec Python script to decode the EU Covid-19 vaccine certificate This script takes an image with a QR code of a vaccine certificate as the parameter

Hanno Böck 244 Nov 30, 2022
Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat

chat-broadcast Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat Setup Librerías Necesitas Python 3 con la librería

Seguimos 2 Jan 09, 2022
Simple Reddit bot that replies to comments containing a certain word.

reddit-replier-bot Small comment reply bot based on PRAW. This script will scan the comments of a subreddit as they come in and look for a trigger wor

Kefendy 0 Jun 04, 2022
[Fullversion]Web3 Pancakeswap Sniper bot written in python3.

🚀 Pancakeswap BSC Sniper Bot 🚀 Web3 Pancakeswap Sniper && Take Profit/StopLose bot written in python3, Please note the license conditions! The secon

21 Dec 11, 2022