lufton / esphome-inv-8851

Inverter 8851 protocol ESPHome integration
16 stars 3 forks source link

Extra 4 bytes in protocol #24

Closed lufton closed 2 months ago

lufton commented 2 months ago

Investigating issue with empty values for @cristianoggi in https://github.com/lufton/esphome-inv-8851/issues/19 I found out that some invertors has different packet length 158 vs 154 for state and 104 vs 100 for config. I need to investigate deeper and create a way to handle this mismatch. Looks like those 4 bytes are all zeros at the end of data section. Will continue discussion in this thread. Here is state packet example:

88510003000094008833910B00000000010000000000000000000000000000000000100008200000000000000000000000000F099200881352013201490148000706070184000000F7000F096A008813000000000000DB0A0C0000000000650A95005401F9100000080000001E1E1B201C190000000000000000000000000000000000000000000000000000000000000000000000000000000000006D5E

and config packet example:

8851000302005E000080EFC49411FC08881300000000D007B80BD007500A8C0AA4061C0CB80B34089808500A60099808040BF00A8C0AFC08640058023200000000003CFB32003CEC32F67C158813F40124130400464B50434650680B3C0078001E00325F1400E14F
cristianoggi commented 2 months ago

Ok. My inverter is 220v / 50hz

lufton commented 2 months ago

Could you also upload some photos, for people, how might have the same revision of inverter?

cristianoggi commented 2 months ago

The photos of the inverter?

lufton commented 2 months ago

Yes

cristianoggi commented 2 months ago

IMG_6150 IMG_6304

cristianoggi commented 2 months ago

I'm waiting for your update. Anyway thank you for your availability.

lufton commented 2 months ago

@cristianoggi, I have integrated my changes into repository. It should help with reading stats of inverter in your case. Not sure if changing of paramters will work though. Try using regular dtu-wbs1-v001-24v-example.yaml this time, not dtu-wbs1-v001-24v-example-local.yaml.

cristianoggi commented 2 months ago

Ok @lufton. As soon as I can I'll flash it using the example.yaml and I'll let you know. For now thank you.

cristianoggi commented 2 months ago

@lufton It works great! So far I've looked at it and it makes everything visualize! I'll finish testing it and update you. Great job!

lufton commented 2 months ago

Great! Like I said, configuring is probably not going to work right away. But I'm working on it.

cristianoggi commented 2 months ago

@lufton Yes indeed the configuration does not work. It does not change the parameters. Could you add the PV details? Thanks.

lufton commented 2 months ago

Just uncomment pv package line: https://github.com/lufton/esphome-inv-8851/blob/044e6a2707213970f2fb3776e96eeca4ffd6463d/dtu-wbs1-v001-24v-example.yaml#L21

cristianoggi commented 2 months ago

@lufton I'm flashing the configuration with the addition of the pv.yaml package but I get this error from the core.yaml package line 26

screenshot_20240831_085440

lufton commented 2 months ago

Sorry, that was my fault. I forgot to change 1 paramter in core.yaml. I have updated repo, try again.

cristianoggi commented 2 months ago

The error remained.... screenshot_20240831_094023

lufton commented 2 months ago

Please try again using correct file: https://github.com/lufton/esphome-inv-8851/blob/main/dtu-wbs1-v001-24v-example.yaml

cristianoggi commented 2 months ago

@lufton All ok. Thanks.

lufton commented 2 months ago

So, had you successfully receive data from inverter? Could you please check if changing parameters works (e.g. Backlight)?

cristianoggi commented 2 months ago

@lufton I received the data correctly. I tried to change the backlight status but it doesn't work.... It doesn't change.

lufton commented 2 months ago

@cristianoggi okay, I will investigate further and fix this ASAP.

lufton commented 2 months ago

@cristianoggi I think we where able to fix the issue with settings not being applied. Thanks to @leodesigner and his update in a library. Please try re-flash DTU using the same configuration you used last time. It should redownload new library file and fix the issue.

cristianoggi commented 2 months ago

Okay. As soon as I can I'll flash it and update you. Do I always use dtu-wbs1-v001-24v-example.yaml?

lufton commented 2 months ago

Yes

cristianoggi commented 2 months ago

Has the repository been updated? I flashed the DTU in Esphome but nothing changed.

lufton commented 2 months ago

Check flashing log. It should show dependency library leodesigner/PowMr_4500_regmap v1.0.3. If version is lower than 1.0.3 then clean build files from menu and try flashing again. IMG_4823

cristianoggi commented 2 months ago

Executed as described and this time everything works! It even changes in writing...everything I set from the application, also changes on the inverter. Thanks for everything!

lufton commented 2 months ago

You are welcome! Please be careful messing with inverter parameters as this can damage you inverter or battery!

cristianoggi commented 2 months ago

Yes I know. I just did the tests to see if it worked. Thank you.

cristianoggi commented 2 months ago

@lufton Hi. Everything works. However, sometimes the entities are not available for a very short time. Is this normal? Or is there something that can be done? Thanks.

lufton commented 2 months ago

How often that happens? This could be connection issue. Check you wifi signal strength. Also check the logs.

cristianoggi commented 2 months ago

It happens from time to time. What should I see in the logs?

lufton commented 2 months ago

Well, probably something that WiFi connection lost or connection to Home Assistant lost.

cristianoggi commented 2 months ago

The DTU device disconnects. I noticed this because the WIFI LED goes off. Could the problem be with the WIFI network or the DTU device?

INFO ESPHome 2024.8.3 INFO Reading configuration /config/esphome/dtu-wbs1-v001-24v-example.yaml... INFO Updating https://github.com/lufton/esphome-inv-8851@main INFO Updating https://github.com/lufton/esphome-inv-8851.git@main INFO Starting log output from 192.168.1.5 using esphome API INFO Successfully connected to dtu-wbs1-v001 @ 192.168.1.5 in 0.041s WARNING Can't connect to ESPHome API for dtu-wbs1-v001 @ 192.168.1.5: Handshake timed out after 30.0s (TimeoutAPIError) INFO Trying to connect to dtu-wbs1-v001 @ 192.168.1.5 in the background WARNING dtu-wbs1-v001 @ 192.168.1.5: Connection error occurred: dtu-wbs1-v001 @ 192.168.1.5: Connection lost

lufton commented 2 months ago

This is most likely problems with WiFi signal strength.

cristianoggi commented 2 months ago

Yes indeed I moved the DTU device closer to the router. I think and hope I have solved it. Thanks.