dgibson / python-smadata2 Goto Github PK
View Code? Open in Web Editor NEWPython code for communicating with SMA photovoltaic inverters within built in Bluetooth
License: GNU General Public License v2.0
Python code for communicating with SMA photovoltaic inverters within built in Bluetooth
License: GNU General Public License v2.0
When exploring, I seem to get some data back
Connected 08:71:90:C1:E8:0E -> 00:80:25:24:C8:B4
SMA2 00:80:25:24:C8:B4 >>
Rx< 0000: 7E 1F 00 61 B4 C8 24 25-80 00 00 00 00 00 00 00
Rx< 0010: 02 00 00 04 70 00 02 00-00 00 00 01 00 00 00
Rx< 00:80:25:24:C8:B4 -> 00:00:00:00:00:00 TYPE 02
Rx< HELLO!
However, when trying to commit to db, I encounter a hello
error:
ERROR contacting inverter: Unexpected HELLO bytearray(b'\x00\x04p\x00\x02\x00\x00\x00\x00\x01\x00\x00\x00')
Any pointers?
Hi David,
I read some of the other issues (/comments) and I understand this was a personal project and you have no time or interest to update the documentation.
May I just ask what SMA inverter have you used this project for?
I am going to spend some time understanding your code but just want to know that least in theory it might work with the inverter I am using (SB-4000TL).
Thanks
Hi,
I came across this project while looking for a fully Python-based SMA inverter tool, that would be easier to maintain & modify than the various C language sbfspot projects. It looks like a well structured code base - thanks for your efforts!
I have spent some hours understanding and commenting, but there's one area that puzzles me still. Can you explain the decorator function below, and how it works with the various tx & rx functions & the @waiter decorator? What is the purpose of creating the various _waitcond attributes and the waitvar ?
def waiter(fn):
""" Adds wait conditions to itself, used with connection.wait() to wait for packets
:param fn: like rx_raw, rx_outer, rx_ppp from the connection class
:return: waitfn()
"""
def waitfn(self, *args):
fn(self, *args)
if hasattr(self, '__waitcond_' + fn.__name__):
wc = getattr(self, '__waitcond_' + fn.__name__)
if wc is None:
self.waitvar = args
else:
self.waitvar = wc(*args)
return waitfn
Thanks, Andy
I get this error when downloading. The connection and status are working.
./sma2mon download
standalone-inverter-0000 (SN: xyz)
Traceback (most recent call last):
File "./sma2mon", line 6, in
smadata2.sma2mon.main()
File "/home/pi/python-smadata2-master/smadata2/sma2mon.py", line 166, in main
args.func(config, args)
File "/home/pi/python-smadata2-master/smadata2/sma2mon.py", line 89, in download
data = smadata2.download.download_inverter(ic, db)
File "/home/pi/python-smadata2-master/smadata2/download.py", line 24, in download_inverter
lasttime = db.get_last_historic(ic.serial)
AttributeError: 'Connection' object has no attribute 'serial'
just found this repo, Can you add some notes on which versions of python, platform it runs on? basic setup and config as I'm not the best at picking up someone elses code.
I'm hoping to get a connection over bluetooth to my SMA SB-3000TL-20.
but mostly thanks for publishing this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.