xyphro / Sun2000MeterTransposer

Enable other Smartmeters to connect to Huawei Sun2000 and look like DTSU-666
5 stars 0 forks source link

Sun2000MeterTransposer

-> Enable other Smartmeters like SDM630 to connect to Huawei Sun2000 and look like DTSU-666.

This was my solution to address the fact, that DTSU-666 and its variants availability was "null".

It works rock solid since several months without a single interruption.

The project is based on RP2040 Raspberry pi Zero module. It will work on the Wifi variant too, but there is no network access enabled.

Note: I did not document the HW very well (yet), but want to share it still with the community. Build it at your own risk. The pinning of the 2 UART channels can be seen in s2kserver.py module (or schematic).

Warning: This project works with high voltage AC supply. You risk killing yourself, your family and friends, your pets. Take care and only work with line voltages when you are experienced in how much pain it causes to touch 230V :-)

Folder structure

Adjustments to other meters

Copy file sdm630.py and rename it to your meter name. Adjust it, such that the equivalent registers of your meter are read out and written to s2k module registers. Within file s2kserver.py:

Sourcecode orientation

main.py purpose is only to start s2kserver.py. s2kserver instantiates 2 threads to server requests from Sun2000 inverter and poll SDM630 meter continously.

Credits

Credits go to:

Compatibility

Tested with sun2000 3 phase 10kW inverters and proven working with spc147 and 148 firmware versions. As of now there is no newer one available.

Updates

21st December 2022:

Github user Radek made a module to support CHINT DTSU666 electricity meter (dtsu666.py). Thanks a lot for sharing it!

To make use of it adjust the settings within the user configurable settings in the file s2kserver.py.

Note that Chint DTSU666 usually uses those UART settings unless you configured it manually differently:

METER_UART_BAUDRATE = 9600
METER_UART_BITS     = 8
METER_UART_PARITY   = None
METER_UART_STOPBITS = 2

[1] https://github.com/pycom/pycom-modbus/tree/master/uModbus

[2] https://github.com/elfabriceu/DTSU666-Modbus