Coder Social home page Coder Social logo

sma-em's Introduction

SMA-EM

a detailed german description could be found here https://www.unifox.at/software/sma-em-daemon/

translated by google https://translate.google.com/translate?sl=de&tl=en&u=https://www.unifox.at/software/sma-em-daemon/

SMA Energymeter / Homemanager measurement

sma-em-measurement.py: Python3 loop display SMA Energymeter measurement values

sma-daemon.py: Python3 daemon writing consume and supply values to /run/shm/em-[serial]-[value]

# HINT #
Sma homemanager version 2.3.4R added 8 Byte of measurement data.
This version trys to detect the measurement values on obis ids, so it should be save if new values were added or removed.

Requirements

python3 sys time configparser (SafeConfigParser) signal

apt install python3-pip

Feature pvdata reqires pymodbus

sudo pip install pymodbus

or

sudo pip3 install pymodbus

sudo pip3 install -U paho-mqtt 

sudo pip3 install -U pymodbus 

Configuration

create a config file in /etc/smaemd/config
Use UTF-8 encoded configfile
Example:

[SMA-EM]
# serials of sma-ems the daemon should take notice
# seperated by space
serials=30028xxxxx
# features could filter serials to, but wouldn't see serials if these serials was not defines in SMA-EM serials
# list of features to load/run
features=simplefswriter sample

[DAEMON]
pidfile=/run/smaemd.pid
# listen on an interface with the given ip
# use 0.0.0.0 for any interface
ipbind=192.168.8.15
# multicast ip and port of sma-datagrams
# defaults
mcastgrp=239.12.255.254
mcastport=9522

# each feature/plugin has its own section
# called FEATURE-[featurename]
# the feature section is required if a feature is listed in [SMA-EM]features

[FEATURE-simplefswriter]
# list serials simplefswriter notice
serials=1900204522
# measurement vars simplefswriter should write to filesystem (only from smas with serial in serials)
values=pconsume psupply qsupply ssupply

[FEATURE-sample]
nothing=here

Routing

maybe you have to add a route (example: on hosts with more than one interface)

sudo ip route add 224.0.0.0/4 dev interfacename

Install / Copy (tested on Raspbian 9.1)

sudo apt install git
sudo apt install python3 cl-py-configparser
sudo mkdir /opt/smaemd/
sudo mkdir /etc/smaemd/
cd /opt/smaemd/
sudo git clone https://github.com/datenschuft/SMA-EM.git .
sudo cp systemd-settings /etc/systemd/system/smaemd.service

Create a /etc/smaemd/config file

sudo cp /opt/smaemd/config.sample /etc/smaemd/config

Edit the /etc/smaemd/config file and customize it to suit your needs (e.g. set SMA energy meter serial number, IP address, enable features)

sudo nano /etc/smaemd/config

Update systemd

sudo systemctl daemon-reload
sudo systemctl enable smaemd.service
sudo systemctl start smaemd.service

feel lucky and read /run/shm/em--

Testing

sma-em-capture-package - trys to capture a SMA-EM or SMA-homemanager Datagram and display hex and ascii package-info and all recogniced measurement values. Cloud be helpful on package/software changes.

sma-em's People

Contributors

datenschuft avatar sellth avatar tommi2day avatar david-m-m avatar berlenz avatar dervomsee avatar michscha avatar mzealey avatar mattg40 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.