Git Product home page Git Product logo

goodwe-sec1000-info's Introduction

goodwe-sec1000-info

This repository contains the executable python module goodwe_sec1000_info and the script goodwe_sec1000_info_test.py.

The module goodwe_sec1000_info allows to obtain the data of the inverters power and the mains power from the GoodWe SEC1000 Smart Energy Controller device. In particular, the data is obtained from the EzLogger device inside the SEC1000.

Usage

In the module goodwe_sec1000_info, inside the __main function, set the variables host and port to the address and port of your GoodWe SEC1000 device. Usually the port is 1234, unless you are accessing through some gateway with port forwarding.

Then, the module can be executed directly to obtain the SEC1000 data in JSON format. For example, the output may be:

{
    "v1": 241.0,
    "v2": 240.4,
    "v3": 240.9,
    "i1": 4.8100000000000005,
    "i2": 3.9,
    "i3": 5.08,
    "p1": 0.293,
    "p2": -0.117,
    "p3": -0.532,
    "meters_power": -0.355,
    "inverters_power": 3.386
}

Where

  • v1, v2, and v3 are voltage data in volts.
  • i1, i2, and i3 are current data in amperes.
  • p1, p2, and p3 are power data in kilowatts.
  • meters_power is the power being consumed from the mains in kilowatts.
  • inverters_power is the power being generated by the inverters in kilowatts.

SEC1000 application protocol

The information about the application protocol used to query the SEC1000 data is not public. The only way of querying the data provided by the GoodWe company is to use its proprietary ProMate application.

Using Wireshark, we analyzed the packets exchanged between the ProMate application and the SEC1000 device and saw that a simple binary protocol is used. The script sec1000_info_test.py can be executed to print an analysis of the fields of the data received. An example of the output of this script is the following:

Total number of bytes received: 56

Bytes:
b"\x04REVO\x001\x01\x01\x0b\x00\x00\tj\x00\x00\td\x00\x00\ti\x00\x00\x01\xe0\x00\x00\x01\x86\x00\x00\x01\xfc\x00\x00\x01'\xff\xff\xff\x8e\xff\xff\xfd\xec\xff\xff\xfe\xa1\x00\x00\r:\x0fB"

Fields:
045245564F00     Header: \x04REV0\x00
31               Data lenght: 49
01010B           Unknown (request code?)
0000096A         Voltage 1 (0.1V units): 2410
00000964         Voltage 2 (0.1V units): 2404
00000969         Voltage 3 (0.1V units): 2409
000001E0         Current 1 (0.01A units): 480
00000186         Current 2 (0.01A units): 390
000001FC         Current 3 (0.01A units): 508
00000127         Power 1 (1W units): 295
FFFFFF8E         Power 2 (1W units): -114
FFFFFDEC         Power 3 (1W units): -532
FFFFFEA1         Meter power (1W units): -351
00000D3A         Inverters power (1W units): 3386
0F42             Data checksum, calculated = F42

SEC1000 problems

We found two problems when querying the data of the SEC1000. These also happen with the ProMate application, so it is something related to the SEC1000 and not to the way we are querying the data. These problems are:

  • Sometimes the SEC1000 response is not correct. The expected response size (i.e., the size field in the response message from the SEC1000) should be 49, but sometimes is 6. To solve this we retry the query until we obtain a correct response.

  • Sometimes the "inverters power" field has unexpectedly a value of 0. We have checked that the SEC1000 updates the "inverters power" value in intervals of approximately 30 seconds, but sometimes it sets this value to 0. This seems to be some problem within the SEC1000, since if the "inverters power" is 0, we would also expect the "meter power" (i.e., the power from the mains power grid) to increase accordingly, but this does not happen. To solve this we use a cache file to store a queue of some given size of the previous received values of "inverters power", then if we receive a "inverters power" of 0 we return the last non-zero value from the cache, or a 0 if there are no non-zero values in the cache.

License

This code is available as open source under the terms of the MIT License.

goodwe-sec1000-info's People

Contributors

tombolano avatar

Stargazers

 avatar

Watchers

 avatar

goodwe-sec1000-info's Issues

L1/L2/L3 current and L1/L2/L3 power values including meter power are always zero

Hey :)

I have a small problem with reading the values of my SEC1000S, L1/L2/L3 current and power values are always zero:

python3 goodwe_sec1000_info_test.py

Total number of bytes received: 56

Bytes:
b'\x04REVO\x001\x01\x01\x0b\x00\x00\x08\xf9\x00\x00\x08\xf5\x00\x00\t\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x12\x02?'

Fields:
045245564F00 Header: \x04REV0\x00
31 Data lenght: 49
01010B Unknown (request code?)
000008F9 Voltage 1 (0.1V units): 2297
000008F5 Voltage 2 (0.1V units): 2293
00000912 Voltage 3 (0.1V units): 2322
00000000 Current 1 (0.01A units): 0
00000000 Current 2 (0.01A units): 0
00000000 Current 3 (0.01A units): 0
00000000 Power 1 (1W units): 0
00000000 Power 2 (1W units): 0
00000000 Power 3 (1W units): 0
00000000 Meter power (1W units): 0
00000712 Inverters power (1W units): 1810
023F Data checksum, calculated = 23F

L1/L2/L3 voltage values and the inverters power values are displayed correctly though.

Any ideas regarding this issue?

Thank you for your help!

Strange values for P1/P2/p3

Hi,

current setup:

  • SEC1000S with 200A (pri) / 5A (sec) current trackers
  • CT ratio is set to 40 (200A / 5A = 40)
  • 2 x GoodWe ET Plus+ Hybrid GW 8 K-ET inverters
  • No battery / BMS

I'm experiencing some strange values for P1/P2/P3. If I understand this correctly:

  • positive values for P1/P2/P3 mean power is delivered to mains (sell)
  • negative values for P1/P2/P3 mean power is consumed from mains (buy)

So I've constantly queried the SEC1000s for the corresponding values (one query per minute), and I found something strange. During the night, when all inverters are off ("waiting mode"), I always have negative values for P1 and P2 (power is consumed from mains) but positive values for P3 (power is delivered to mains):

{ "v1": 224.60000000000002, "v2": 224.60000000000002, "v3": 224.70000000000002, "i1": 2.82, "i2": 3.5300000000000002, "i3": 3.83, "p1": -0.308, "p2": -0.34400000000000003, "p3": 0.497, "meters_power": -0.155, "inverters_power": 0.001 }

Or with the test script:

`
Total number of bytes received: 56

Bytes:
b'\x04REVO\x001\x01\x01\x0b\x00\x00\x08\xbe\x00\x00\x08\xc9\x00\x00\x08\xd2\x00\x00\x00\xfb\x00\x00\x01B\x00\x00\x01i\xff\xff\xff(\xff\xff\xfe\xf2\x00\x00\x01\xc7\xff\xff\xff\xe1\x00\x00\x00\x03\x0f\xe2'

Fields:
045245564F00 Header: \x04REV0\x00
31 Data lenght: 49
01010B Unknown (request code?)
000008BE Voltage 1 (0.1V units): 2238
000008C9 Voltage 2 (0.1V units): 2249
000008D2 Voltage 3 (0.1V units): 2258
000000FB Current 1 (0.01A units): 251
00000142 Current 2 (0.01A units): 322
00000169 Current 3 (0.01A units): 361
FFFFFF28 Power 1 (1W units): -216
FFFFFEF2 Power 2 (1W units): -270
000001C7 Power 3 (1W units): 455
FFFFFFE1 Meter power (1W units): -31
00000003 Inverters power (1W units): 3
0FE2 Data checksum, calculated = FE2
`

The absolute values of P1/P2/P3 seem to be correct though. I've also checked the direction of the three CTs and all of them or correctly placed. Any ideas what is going on here?

Thank you :)

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.