-> 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 :-)
- hw: contains schematic / PCB in Eagle format.
- src: Micropython sourcecode - can be directly uploaded to RP2040 module using e.g. Thony IDE
- DinRainHousing: STL files for the 3D printed Dinrail housing
- photos: Some pictures of the actual build as inspiration
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:
- You might need to change the UART settings like baudrate, parity in s2kserver during instatiation of uModBusSerial module.
- change
from sdm630 import *
to your module name
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 go to:
- uModbus [1] project. I changed the file slightly and included all dependencies within the src folder. Main modifications were done for speed/latency purposes
- DTSU666-Modbus [2] project: This project was of major support for the idea and to get register details.
- GitHub user salakrzy
- Kai for testing it in endless debug sessions remotely whilr I was still busy ibstalling my solar installation and could not test myself
- Radek for making and providing his Chint DTSU666 module
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.
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