Ziyatoe / DTUProController

Hoymiles DTU-Pro controller for zero export
5 stars 0 forks source link

Zero Export with DTUProControll on Home Assistant #1

Closed dpsmarty1811 closed 1 year ago

dpsmarty1811 commented 1 year ago

Hello, I would like to display the Zero Export from Home Assistant with the DTU Pro and the Chint DTSU666 via serial Modbus. I have already managed to release and connect the Chint DTSU666 via serial Modbus, but have not yet succeeded in controlling the DTU Pro to Zero Export. Do you have an idea how I can do that with your script? or another way?

Unfortunately I'm a total beginner in yaml and python. Therefore I ask for understanding for this question.

Thank you for your efforts

Ziyatoe commented 1 year ago

hi, I did not really understand your question really, all you need is written in readme. you need an old pc or a raspberry pi, connected to wifi and running mqtt and nodered. you have to connect the pc,dtupro and dtsu666 wia rs485, choose the modbus adresses like described in readme and run the python script: python dtupro_ctrl.py https://github.com/Ziyatoe/DTUProController/blob/main/dtupro_ctrl.py 1 1 this script looks at the dtsu and sends the needed commands to dtu-pro to get "real" zeroexport. be sure the hoymiles MI series can be limited only to 10%, HM series to 2% if you take the flows.json https://github.com/Ziyatoe/DTUProController/blob/main/flows.json into your nodered, you see everything in a gui

Am Di., 14. März 2023 um 21:27 Uhr schrieb dpsmarty1811 < @.***>:

Hello, I would like to display the Zero Export from Home Assistant with the DTU Pro and the Chint DTSU666 via serial Modbus. I have already managed to release and connect the Chint DTSU666 via serial Modbus, but have not yet succeeded in controlling the DTU Pro to Zero Export. Do you have an idea how I can do that with your script? or another way?

Unfortunately I'm a total beginner in yaml and python. Therefore I ask for understanding for this question.

Thank you for your efforts

— Reply to this email directly, view it on GitHub https://github.com/Ziyatoe/DTUProController/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ2X6WIZ7GEX2MYSQQ55MJTW4C2CRANCNFSM6AAAAAAV2Z6VEA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dpsmarty1811 commented 1 year ago

Hi thanks for the quick reply, sorry for being so stupid but I'm an absolute newbie in this area. Have no yaml ,pyhton or json knowledge.

I have an old Intel Nuc running Home Assistant. I have integrated the ModBus via a USB to RS485 interface and thus read out my Chint DTSU 666.

I understand how your script works, but unfortunately I don't know how to use it or I need help on how to get it to work.

I installed Nodered in Home Assistant and pyhtonscript, but have already tried everything to get your script to work, but without success.

I'm probably acting very stupid, but I'd still be very grateful if you could help me somehow to get your script running.

Thank you for your work and sorry for my absolute helplessness

Best regards from Germany

Ziyatoe commented 1 year ago

no worry,

dpsmarty1811 commented 1 year ago

Hey, thank you for the reply,

-I have adjusted the addresses of the DTU Pro and the DTSU.

"Could you run the python script? what is your run command for the Script? and what is the output of the script while running?"

That's my problem, I can't get it to run I do not know how ?

I now think the problem is that I'm trying to run it under HomeAssistant?

but unfortunately i wouldn't know how with my limited knowledge about the whole thing.

I think I'll let it be and do the zero export again via the Hoymiles Cloud, even if it's bad.

But thank you very much for your help and your great work.

All the best from Germany

dpsmarty1811 commented 1 year ago

Hey sorry that I'm annoying again, but it didn't let me rest.

I kept trying. Now I found out how to start the script. But get an error message.

dtupro_ctrl.py> line 423: global InvIdPowr ^ SyntaxError: global statement outside function

Since, as I said, I have no idea about Python, do you have a tip?

Ziyatoe commented 1 year ago

you had to first reopen this issue, because your last statement "I think I'll let it be ..." I closed it
I mean, its difficult to help you, if you have no idea how to use python...

dpsmarty1811 commented 1 year ago

Yes, I know, sorry, but somehow I have the hope that I can get it.

I have an Intel Nuc running Home Assistant. In Home Assistant I tried to start your script under pyscript. As far as I understand it is Python 3

I tried to start it from Home Assistant and in the logs I see the following error " ERROR (MainThread) [custom_components.pyscript.file.dtupro_ctrl] Exception in </config/pyscript/dtupro_ctrl.py> line 423: global InvIdPowr ^ SyntaxError: global statement outside function

Yes I am absolutely helpless, sorry

Ziyatoe commented 1 year ago

I can not help you with home assistant, no idea what its doing,,.. I asked you the version of python, you should give me an exact version nr, python 3 is not a version number!!

you can not run the script without arguments!!!! if you have python installed on your pc, you have to start the script in a terminal window like this: python dtupro_ctrl.py 1 1 (or maybe its python3 instead of python) and send me the output