Giter Site home page Giter Site logo

deyeinverter's Introduction

DeyeInverter

Small utility to read data from DEYE Inverters through the Solarman Datalogger. Works with S/N 17*

Tests indicate that the full ModBus is available through the TCP connection. Probably this can lead to modifying Inverter Configuration via TCP calls.

Thanks to @fjcarretero https://github.com/fjcarretero for his incredible support on understanding the data from and to the datalogger. Thanks to @xtheone https://github.com/XtheOne for his original V4 reader that was an inspiration (and I borrowed some code).

Configuration

Edit the config.cfg and enter the following data:

[DeyeInverter]
inverter_ip=192.168.X.XXX
inverter_port=8899
inverter_sn=17XXXXXXXX
installed_power=XXXXX #power in Watts e.g. for 4.5kW write 4500
mqtt=1  # set to 1 for MQTT output, 0 for JSON output.
mqtt_server=192.168.X.X
mqtt_port=1883
mqtt_topic=XXXXXXXXXXXX
mqtt_username=
mqtt_passwd=

Run

{"Running Status()":2,
"Total Grid Produciton(kwh)":829.5,
"Total Grid Produciton(kwh)":0.0,
"Daily Energy Bought(kwh)":0.0,
"Daily Energy Sold(kwh)":15.0,
"Total Energy Bought(kwh)":21.900000000000002,
"Total Energy Bought(kwh)":0.0,
"Total Energy Sold(kwh)":1103.4,
"Total Energy Sold(kwh)":0.0,
"Daily Load Consumption(KWH)":1.2000000000000002,
"Total Load Consumption(KWH)":365.3,
"Total Load Consumption(KWH)":0.0,
"DC Temperature(℃)":149.5,
"AC Temperature(℃)":152.1,
"Total Production(KWH)":1517.4,
"Total Production(KWH)":0.0,
"Alert()":0,
"Alert()":0,
"Alert()":0,
"Alert()":0,
"Alert()":0,
"Alert()":0,
"Daily Production(KWH)":16.900000000000002,
"PV1 Voltage(V)":342.20000000000005,
"PV1 Current(A)":7.800000000000001,
"PV2 Voltage(V)":8.5,
"PV2 Current(A)":0.0,
"Grid Voltage L1(V)":241.3,
"Grid Voltage L2(V)":0.0,
"Load Voltage(V)":242.9,
"Current L1(A)":10.51,
"Current L2(A)":0.0,
"Micro-inverter Power(W)":0,
"Gen-connected Status()":0,
"Gen Power(W)":0,
"Internal CT L1 Power(W)":-2325,
"Internal CT L2  Power(W)":0,
"Grid Status()":-2365,
"Total Gird Power(W)":-2365,
"External CT L1 Power(W)":-2365,
"External CT L2 Power(W)":0,
"Inverter L1 Power(W)":2558,
"Inverter L2 Power(W)":0,
"Total Power(W)":2558,
"Load L1 Power(W)":193,
"Load L2 Power(W)":0,
"Total Load Power(W)":193,
"Battery Temperature(℃)":125.0,
"Battery Voltage(V)":10.14,
"Battery SOC(%)":0,
"PV1 Power(W)":2619,
"PV2 Power(W)":0,
"Battery Status()":0,
"Battery Power(W)":0,
"Battery Current(A)":-0.01,
"Grid-connected Status()":1,
"SmartLoad Enable Status()":16}

Known Issues

The inverter is not fast enough to answer, you can get timeouts if you query it too often.

Contrib

Python is not my strongest suite, feel free to suggest, rewrite or add whatever you feel is necessary.

Home Assistant support

The folder deye_logger contains a Homeassistant add-on. Reference the README.md file in that folder more information.

deyeinverter's People

Contributors

agtconf avatar jlopez77 avatar pbeyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deyeinverter's Issues

[feature request] Modifying inverter configs

Hi, thank you for your work, I was trying to figure if there is a way to modify inverter configs/parameters via TCP calls, I tried to read through your code to see if I can help out, but I don't think i can without any leads or maybe how to start somewhere.

Thanks

PHP port

Hello does anyone have this ported to PHP please?

Help installing

Hi,
i placed your code on a Raspberry (Buster) and adapted the configfile 👍 [DeyeInverter]

inverter_ip=192.168.1.170
inverter_port=8899
inverter_sn=221111xxxx
installed_power=600
mqtt=1
mqtt_server=192.168.1.150
mqtt_port=1883
mqtt_topic=deye
mqtt_username=
mqtt_passwd=

But my seriesnumber begins with 22
When i start the script i get the following :

pi@RASPYPI3:/opt/DeyeInverter $ python3 InverterData.py
Traceback (most recent call last):
File "InverterData.py", line 19, in
os.chdir(os.path.dirname(sys.argv[0]))
FileNotFoundError: [Errno 2] No such file or directory: ''

Can you help me to get the script running.

Afterwards changing the script to get the right register values is possible for me but i need help to start the communication and get register contents

Best regards

help needed

Hi @jlopez77 , i would like to try and read my inverter's data using your program. I however have no idea where to start, what to install and where to install. Could you please help me setting it up.

Error unicodedecodeError

Hi! I'am very happy to look for this version of program, bacause I have omniksol inverter with wifi module with serial 17xxxxx.
Well, when I have tryed I have this error....

Traceback (most recent call last):
File "C:\Users\user\Desktop\HttpClient Omniksol\DeyeInverter-main\InverterData.py", line 113, in
parameters=json.loads(txtfile.read())
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1035: character maps to

I tryed to put:

with open("./DYRealTime.txt", errors="ignore")

but after I have another error....

please, may you help me ?

best regards

Andrea

UnicodeDecodeError:

This is a great project - would love to get it going... Having trouble towards the end though...

C:\Projects\deye-inverter>py InverterData.py
Traceback (most recent call last):
File "InverterData.py", line 109, in
parameters=json.loads(txtfile.read())
File "C:\Users\henni\AppData\Local\Programs\Python\Python37\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1035: character maps to

If line 108 is changed to:

with open("./DYRealTime.txt", "rb") as txtfile:

Then the following error is produced:

Traceback (most recent call last):
File "InverterData.py", line 106, in
response=twosComplement_hex(str(''.join(hex(ord(chr(x)))[2:].zfill(2) for x in bytearray(data))+' '+re.sub('[^\x20-\x7f]', '', ''))[p1:p2])
File "InverterData.py", line 13, in twosComplement_hex
val = int(hexval, bits)
ValueError: invalid literal for int() with base 16: ''

Not issue, ask

Hi, I will integrate inverters for my friend to HA, he has two inverters in paralel mode, is possible use your code for two or more inverters?
Thank you very much

install error

The instruction seem to be unclear on how to install or run this addon. I copied the file to my addon directory in home assistant and then modified the config file. when i run the run.sh command from terminal in HA I get a mqtt topic error which i don't know what to set it as. Can you maybe provide clear instructions on how to install it and set it up. thanks a mil.

Deye with Serial Number 39xx

Hey,

very nice project. I have a Deye inverter with a datalogger s/n 39xxxxxxxx.
The project itself works, but it seems the registers do not fit to the description and values.
Are you interestet into some work to update this?

If I want to update it, would it be the best to update the file DYRealTime.txt?

Feature request

Anybody has a method of using this data to pvoutput.org ?
It would be nice to have all the data stored there.

Regards,
Adrian

No issue - a question

Where do I run this python script?

I.e. on a raspi in the same network or on the deye itself?

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.