Closed Wind06 closed 10 months ago
hi, this script is only for ONE microinverter, you can enhanced it your own. since I have no hoymiles, I'm not continue this project
Thanks for your answer, I will try to update hope that I will not break my inverter 😶 But you had Hoymiles to develop this script right ?
one more question the script can either perform zero injection, or just report data from ddsu666. Is my understanding ok ?
thanks spend a good Sunday.
sure I had a MI1500 + DTUpro + DDSU666 for developping. this script can zeroexport, usage: .py Controller=0/1 [1=controler&datalog] [0=only datalogger], Output=1/0, Limit=10-100 .py 1 1 50 means, inverter will be limited to 50% with output to console
if you get rid off to this damn DTUPro, you can try https://github.com/lumapu/ahoy
Perfect thanks again
well I received the USB/485 today I enter the following command python3 dtupro_ctrl.py 1 1 100 or python3 dtupro_ctrl.py 0 1 100
below is what I got, and idea ?
DTU-Pro RS485/ModbusDTU zero export controller. Version 0.4.0 Limit: 100 OldLimit: 100 MQTT:Connecting to broker 127.0.0.1 MQTT:wait loop MQTT:connected Error connecting DTU sernr at 0x2000
I already build an Ahoy which is working correctly, never tried it for zéro injection yet. Thanks,
edit: this script is only for 2.gen inverter like tested MI1500, if you have 3.gen inverter (all HM s) you have to change all adress in dtudtsuregister.json and base adress in script !!! here are the serialnummerbegin for the 2.gen inverter 0x1020: return MI300 #MI200,MI300 0x1021: return MI300 #MI200,MI300 0x1040: return MI600 0x1041: return MI600 #MI500,MI600,TSUN TSOL-M800 0x1060: return MI1500 0x1061: return MI1500 #MI1000,MI1200, MI1500.
well, it says clearly that you cant connect to the dtu,
in script under CONFIGURATION you have to check the setting ports, in script is for linux:
clientDTU = ModbusSerialClient( method='rtu', port='/dev/ttyUSB0', <<<<<<<<<<< ?????????? baudrate=9600, timeout=8, parity='N', stopbits=1, bytesize=8 ) DTU_DEV_NR = 101 # Hoymiles DTU-Pro Modbus device number
clientDTSU = ModbusSerialClient( method='rtu', port='/dev/ttyUSB0', <<<<<<<<<<<<<<<<<<<??????? baudrate=9600, timeout=8, parity='N', stopbits=1, bytesize=8 ) DTSU_DEV_NR = 22 # Chint DTSU666 grid meter Modbus device number
Hello,
Thanks for your reply, I checked this morning and all seems to be correct
/dev/ttyUSB0 Future Technology Devices International FT232 Serial (UART) IC
Maybe the USB is not PI4 compatible, I will do more testing and will keep ou posted.
Thanks again for your quick answer / help.
do you have 2.gen inverter? compare the serial nr. first
Hi you are right I do have 3.gen inverter HM-1500, So I will have to update data accordingly.
But I guess that my connection problem is not linked not the Serial nulber right ?
I changed the script, now for HM and MI inverters, should work for max. 6 inverters. I can't test it, could you test it?
Hi, sure I will give a try and let you know. Again many thanks for your support
hello, a new test made this morning after a clean install of Raspbian I have no chance because the same issue :-( I noticed that you updated the dtupro_ctrl.py but not the dtudtsuregister.json ?
python3 dtupro_ctrl.py 1 1 100
DTU-Pro RS485/ModbusDTU zero export controller. Version 0.4.5
Limit: 100 OldLimit: 100
MQTT:Connecting to broker 127.0.0.1
MQTT:wait loop
MQTT:connected
Error connecting DTU sernr at 0x2000
Error connecting DTU sernr at 0x2000
^CTraceback (most recent call last):
File "dtupro_ctrl.py", line 639, in
this is the error from first read from dtupro, so I think, you are not connecting the dtupro over rs485, what device number has your dtupro and ddsu666?
Maybe stupide question, but how do you find the device number of DTUpro and ddsu666 ?
so you do not know the device numbers and trying to connect?lol device numbers are in settings, you should also set the dtupro as remote monitor
Well to be able to do what you suggest, I need an installer account for the DTUpro right ? Which is not the case today. Can you confirm ?
very clear, if you can not set the dtupro as "remote monitored", which allows to set rs485 device adress, you can not communicate with it
Ok I contacted hoymiles, and they confirm to me that dtupro is set as « remote monitored » as default Inverter and DTU don’t have ID number but only serial number. can you please explain how you get these IDs this will be more efficient :-)
thanks
oh common! read the manual
As I told you I only have user access not installer So I asked them for information. Hope that they will provide it. As soon as received I will restart testing 😉
Hey good news I finally got that number 202, far from the 101 😄 I will go home and start testing. I keep you posted
Hello, sorry for the late answer, even with the correct device ID of the DTU-pro and the correct Device ID of the DDSU666 no luck for connection.
So I tried to communicante with DTU-Pro and DDSU666 with a Modbus Application:
I have no issue to communicate with DDSU666 But I tried to communicate with the same app with the DTU-Pro and the communication cannot be established 👎 Maybe the remote control has not been set, I will contact them again on Monday, that's very painfull not to have installer account ... grrrrrr
normally, the DTUpro is delivered as "export management" unit, you have to set it as "remote control/modbus"
if you use this as main, you could test the connection with your ddsu:
if name == "main":
setupresult=setup_things()
while not (clientDTSU.connect):
if Output: print("main: Error connecting client DTU or DTSU")
#time.sleep(5)
dtsu =DTSUCtrl()
while True:#todo try
dtsu.getData() #get dtsu666 AC data
if Output: print (boldon,"[main]GridP:", dtsu.GridP," SolarP:",SolarP,boldoff,"do now ZeroExport")
if Output: print("[main]",datetime.now().strftime('%H:%M:%S'),"----------------------------------sleep ",SLEEP)
now = datetime.now()
if now.hour >= 20 or now.hour <= 7: # sleep longer
time.sleep(60*10)
else:
time.sleep(SLEEP)
Thanks again, below is the result, what is strange is that data are empty. by the way for the time being I do have set 0 export on the DTU-pro.
DTU-Pro RS485/ModbusDTU zero export controller. Version 0.4.5 Limit: 100 OldLimit: 100 MQTT:Connecting to broker 127.0.0.1 MQTT:wait loop MQTT:connected grid U_ACL1 0.0 V grid I_ACL1 0.0 A grid P_ACtot nan W grid P_ACL1 nan W grid P_ACL2 nan W grid P_ACL3 nan W error readFromDataRegList grid F_AC 0.0 Hz error readFromDataRegList grid Q_IMP 0.0 kWh error readFromDataRegList grid Q_EXP 0.0 kWh [main]GridP: nan SolarP: 0 do now ZeroExport [main] 10:06:48 ----------------------------------sleep 30
Hello,
Very sorry for the long delay, after 2 weeks discussion with Hoymiles Support I finally get an installer account :-) so I succeed to setup the rs485 port.
I launched the command " python3 dtupro_ctrl.py 0 1 50 " The first Inverter HM800 found, second HM1500 found, for the 3rd I got an error. Attached is the log file generated.
Any help will be appreciated as usual.
Hi Ziyatoe, and idea why I can't access the 3 inverter. I am trying to understand why in the .py file, but I am lost ..
[readMiDataRegs] read DTU-Regs [readMiDataRegs] Error Port: 3 0x11b8 [readMiDataRegs]cant read DTU-Regs
Thanks
hi, I do not check my emails daily, the script was never tested with more than 1 inverter, and this version for you, I couldn't test it, I do not have any hoymiles equipment anymore. so, I have to go through the script with your log and try to figure out what is wrong, sorry, it takes time
Thanks for your help, if you don’t have time no problem. I asked Ahoy team for an enhancement to support zero injection with DDSU666.
I really appreciated all your help
Cheers
Le dim. 3 déc. 2023 à 21:04, Ziyatoe @.***> a écrit :
hi, I do not check my emails daily, the script was never tested with more than 1 inverter, and this version for you, I couldn't test it, I do not have any hoymiles equipment anymore. so, I have to go through the script with your log and try to figure out what is wrong, sorry, it takes time
— Reply to this email directly, view it on GitHub https://github.com/Ziyatoe/DTUProController/issues/3#issuecomment-1837585194, or unsubscribe https://github.com/notifications/unsubscribe-auth/APLBDK4427C2M7CYB2525ZDYHTLMXAVCNFSM6AAAAAA7Q3HOEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGU4DKMJZGQ . You are receiving this because you authored the thread.Message ID: @.***>
ich bin mir sicher, dass ahoy team nichts für ddsu666 entwickeln wird, denn ich war bei der entwicklung der ahoy am anfang dabei. wenn du schon ahoy hast, du kannst ja ddsu666 abfragen (alles im script vorhanden), wie die leistung +/-W ist und dann das ahoy dementsprechend regeln. somit brauchst du keinen dtu
You are right, the guy from Ahoy who answered to me was not very supportive of this option. Yes I do have an Ahoy in place which is working perfectly, and you are right I will investigate the way to implément it.
hi I think, I found the problem, try this V0.4.6
hello,
ooopsss I tried, now it stops reading inverter 1
DTU-Pro RS485/ModbusDTU zero export controller. Version 0.4.6
Limit: 100 OldLimit: 100
MQTT:Connecting to broker 127.0.0.1
MQTT:wait loop
MQTT:connected
DTUSerialNr: 0x10f882246532 Device SN Register List (10F872228412)
MISerialNr : 0x114190556486 Model: Mi2CH Ports: 2 Power/Port: 375
MISerialNr : 0x116180400231 Model: Mi4CH Ports: 4 Power/Port: 375
MISerialNr : 0x116180400245 Model: Mi4CH Ports: 4 Power/Port: 375
Nr of Inv: 3
Inverter 1 of 3 SrNr: 0x114190556486 0x1000 NrOfPorts: 2
[readMiDataRegs] read DTU-Regs
[readMiDataRegs] readed
Traceback (most recent call last):
File "dtupro_ctrl_new.py", line 686, in
its difficult for me to check the script without an hoymiles equipment here, but lets try to fix it. try this version and give me the log
Yes I can imagine, Well with this version the connection is failing immediatly. Maybe if you have time I can grant you an access to my test raspberry. Just let me know and I will provide you my email address, if this option could be valid for you
DTU-Pro RS485/ModbusDTU zero export controller. Version 0.4.6.1
Limit: 100 OldLimit: 100
MQTT:Connecting to broker 127.0.0.1
MQTT:wait loop
MQTT:connected
DTUSerialNr: 0x10f882246532 Traceback (most recent call last):
File "dtupro_ctrl.py", line 663, in
was für ein system hast du, windows? der fehler sagt, dass dein system 'latin-1' unicode nicht encoden kann, eigenartig! ich habe die zeile geaendert, probiere nochmals
My system is a PI4 with raspbian Buster installed. I can try with another environment or setup the unix system differently.
ok, just try it
Attached the log, still and issue reading the 3rd inverter data DTUlog.txt
ok, I hope, I see the problem now, gonna try to fix it
sunday work ;-) try this one and give me the log please check the power from each inverter, if total power is approx. ok
"sunday work", indeed yes and sorry for that, result attached.
Reported data seems to be accurate
[getData]>>>>>>>> this inverter: 0x114190556486 total 86.9 W [getData]>>>>>>>> this inverter: 0x116180400231 total 152.8 W [getData]>>>>>>>> this inverter: 0x116180400245 total 149.0 W
But after sleep---30 when it start again to pool data I get error reading DTU stuff
I confirm that inverters data are read once, and data are accurate. Then when trying to read data again, the following error is displayed.
[main]GridP: 0.0 SolarP: 364.4 do now ZeroExport mainGridP: 0.0 is in doZEROSensivity: 16 [main] 15:41:54 ----------------------------------sleep 30 Inverter 1 of ^[[1m 3 SrNr: 0x114190556486 ^[[0m basis: 0x11e0 0x1190 NrOfPorts: 2 [readMiDataRegs] read DTU-Regs [readMiDataRegs] Error Port: 1 0x11b8 [readMiDataRegs]cant read DTU-Regs [DtuDtsuCtrl]Cant read DTU All Registers!! [readMiDataRegs] read DTU-Regs [readMiDataRegs] Error Port: 0 0x1190 [readMiDataRegs] Error Port: 1 0x11b8 [readMiDataRegs]cant read DTU-Regs .....
ok, getting closer with inverter! I missed one line, now its in, try it, now we should get all inverters/ports in each iteration. the other issue is your dtsu666, it seems to be, that the data registers are not compatible with, what I have in dtudtsuregisters.json under "directory": "grid". you have to check that with your manual.
you can comment the line 709, without dtsu to check only the inverters. and use: python dtupro_ctrl.py 0 1
Hello, I will do testing tomorrow, for inverter only.
For dtsu666 I noticed this already I will check and compare mine with information you have and will do some testing on my side.
many thanks for all your help, we will succeed :-) Good evening.
dtsu666: it can be also the rs485 modbus adress, you have to check it aswell, in code it is DTSU_DEV_NR = 22
Hi, I tested inverter today and all seems to be ok, the loop is working and reported data accurate. Now I will focus on DDSU666 to find out correct registers, the DTSU_DEV_NR is alrady set correctly on my side.
good news! so, you can comment the line 261 for better output view. are you able to check the mqtt data aswell?
Hi, I tested inverter today and all seems to be ok, the loop is working and reported data accurate. Now I will focus on DDSU666 to find out correct registers, the DTSU_DEV_NR is alrady set correctly on my side.
on the market, there are many dtsu666, I was using the orig. CHINT DTSU666
Hi again,
In your description you mention one Microinverter MH/MI1500, I am wondering if it can workwith my config 2 Microinverter MH/MI1500 and 1 Microinverter MH/MI800 ?
Or some code modification is required.
Thanks again