td22057 / t-home Goto Github PK
View Code? Open in Web Editor NEWHome automation integration
License: BSD 2-Clause "Simplified" License
Home automation integration
License: BSD 2-Clause "Simplified" License
First of all I want to thank you for sharing this code.
But may I also recommend to use a tools such as Pycharm? It helps to find problems before running the code. For example, Reply.py line 94 has self.bytes. But there is no .bytes in that class. Pycharm highlights this as a problem.
Hey,
I'm getting 142 bytes reply for the acVoltage Request. But the decoder expects 6x28 bytes more. Could that be caused by using a different SMA model? (( In other words, is it working for you? ))
To be honest, I can't quite grasp what all the first, last numbers mean. But I did notice that SBFspot has these numbers
case SpotACVoltage:
// SPOT_UAC1, SPOT_UAC2, SPOT_UAC3, SPOT_IAC1, SPOT_IAC2, SPOT_IAC3
command = 0x51000200;
first = 0x00464800;
last = 0x004655FF;
break;
and T-Home has
def acVoltage( self ):
p = Request.Data( command=0x51000200, first=0x00464800, last=0x004652FF )
Notice the 0x004655FF versus 0x004652FF. And also, T-Home expects to see 9 values. SBFspot expects (reading from the comment) 6 values.
I'm trying to test the sma code and read out my inverter but I'm getting the following error. Any clue what is going on?
2018-04-17 18:51:28,188 : ERROR: Report failed to run
Traceback (most recent call last):
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\sma\start.py", line 88, in start
nextReport.func( client, linkArgs, config, log )
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\sma\start.py", line 133, in msgPower
data = report.power( **linkArgs )
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\sma\report.py", line 26, in power
obj = dc.decode( dcBytes )
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\sma\Reply.py", line 39, in decode
offset += d.decodeItem( self, bytes, offset )
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\sma\Reply.py", line 143, in decodeItem
self.struct.unpack( self, bytes, offset )
File "E:\Localhost\bin\WinPython2.7\python-2.7.13.amd64\lib\site-packages\tHome\util\NamedStruct.py", line 45, in unpack
data = self.struct.unpack_from( bytes, offset )
error: unpack_from requires a buffer of at least 12 bytes
Printing self in unpack() from util/NamedStruct.py gives me:
<tHome.util.NamedStruct.NamedStruct instance at 0x0000000004ED0808>
<tHome.util.NamedStruct.NamedStruct instance at 0x000000000585AF48>
Running full.py generates the following error.
python full.py
Traceback (most recent call last):
File "full.py", line 7, in <module>
r = T.sma.report.full( ip="192.168.1.181" )
File "/home/jonas/Documents/SMA/T-Home/python/tHome/sma/report.py", line 93, in full
obj.update( decoder.decode( bytes ) )
File "/home/jonas/Documents/SMA/T-Home/python/tHome/sma/Reply.py", line 39, in decode
offset += d.decodeItem( self, bytes, offset )
File "/home/jonas/Documents/SMA/T-Home/python/tHome/sma/Reply.py", line 143, in decodeItem
self.struct.unpack( self, bytes, offset )
File "/home/jonas/Documents/SMA/T-Home/python/tHome/util/NamedStruct.py", line 45, in unpack
data = self.struct.unpack_from( bytes, offset )
struct.error: unpack_from requires a buffer of at least 12 bytes
Looks like there is something in the acVoltage
And if I comment out
# Reply.U32Item( "acGridVoltage", 28, mult=0.01 ),
# Reply.U32Item( "unknown1", 28, mult=0.01 ),
# Reply.U32Item( "unknown2", 28, mult=0.01 ),
In Link.py acVoltage
It works.
I have a STP 10000TL-10 Could it be that you are running another inverter?
Ted,
Thanks again for putting together this awesome project. I started porting your code to be python3 compliant. I stripped out everything except eagle for my Docker container, so I don't want to submit a PR for just that, but figured if you were interested in python3 porting, you could use this as a start:
evanrich/py-eagle-mqtt@c584f7b
FWIW, I used http://www.pythonconverter.com/ and it works pretty well for converting Python 2 to 3, just copy and paste in (I'm not a python dev so I had to use it). Your eagle code runs with the changes I made in the commit above, hope it helps you. If you'd like I can port the entire project maybe this weekend.
Thanks!
I'm trying to use the T-home/.../sma scripts, but I'm receiving a number of error messages.
The most common messages are import-errors 'ImportError: No module named tHome.sma'.
Could you give me a couple of hints to resolve them?
Thanks
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.