GithubHelp home page GithubHelp logo

t-home's People

Contributors

evanrich avatar jhagberg avatar td22057 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

t-home's Issues

Import Error

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

Thank you

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.

Not enough reply bytes for request in sma.Link.acVoltage

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.

error: unpack_from requires a buffer of at least 12 bytes

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?

Suggested start to python3 conversion

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!

error: unpack_from requires a buffer of at least 12 bytes

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>

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.