Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTSD422-D3 - incorrect values returned #152

Closed
kbialek opened this issue Feb 20, 2024 · 21 comments · Fixed by #163
Closed

DTSD422-D3 - incorrect values returned #152

kbialek opened this issue Feb 20, 2024 · 21 comments · Fixed by #163

Comments

@kbialek
Copy link
Owner

kbialek commented Feb 20, 2024

          Hi i have DTSD422-D3 i can read data, but for example current CT1 when energy is with - value there is still + how to mengae this?

and on all Total Positive Energy CT1 CT2 etc is not correct value, any ideas why?
PL:
Udało się zrobić odczyt z tego licznika, ale nie wiem dlaczego wartości prądu jak są z minusem to dalej pokazuje jak z plusem, tj nie pojawia się minus, oraz pod rejestrami od total positive energy są jakieś głupoty

Originally posted by @mrlordziemniak in #41 (comment)

@kbialek
Copy link
Owner Author

kbialek commented Feb 20, 2024

@mrlordziemniak

  1. DTSD422-D3 meter support has been contributed to the project. I do not own such a meter and I cannot test it.
  2. You didn't fill in the bug report form and did not provide detailed problem description and the debug logs. This information is crucial for problem analysis.

@mrlordziemniak
Copy link

I fixed all, and now it is working like charm :)

@kbialek
Copy link
Owner Author

kbialek commented Mar 15, 2024

@mrlordziemniak What was the problem? Did you have to patch the code? Is there anything you can contribute back to the project?

@Scorpion1211svk
Copy link

Scorpion1211svk commented Apr 7, 2024

Hi kbialek, at first, thanks for your work. I'm able to read the data from my Solarman smart meter DTSD422-D3, but I don't know what exactly are the total energy data. I'm comparing these numbers with data from Solarman API, but the data from API are absolutely different. So what stands for Total Positive Energy or Total Positive Energy2, I mean it is daily, weekly, or all time?

BTW: total active power and total active power 2 are correct, it's the same as from the API

@mrlordziemniak
Copy link

in k

Hi kbialek, at first, thanks for your work. I'm able to read the data from my Solarman smart meter DTSD422-D3, but I don't know what exactly are the total energy data. I'm comparing these numbers with data from Solarman API, but the data from API are absolutely different. So what stands for Total Positive Energy or Total Positive Energy2, I mean it is daily, weekly, or all time?

BTW: total active power and total active power 2 are correct, it's the same as from the API

because there is wrong modbus adress, look here https://github.com/mrlordziemniak/dtsd422_esphome/blob/main/dtsd422_esphome.yaml i have correct and working modbus adress for dtsd422-d3 but im using rs432 and esphome for this :)

@Scorpion1211svk
Copy link

is there a way how to fix the [deye-inverter-mqtt] code?
To be honest I have no idea what is rs432 or esphome, I'm very new to such stuff, I was quite happy to get it running at all

@mrlordziemniak
Copy link

check this modbus adress https://github.com/mrlordziemniak/dtsd422_esphome/blob/main/dtsd422_modbus_register.md correct with this one from kbialek, there is problem onyl with S_WORD because solarman using strange sign interpretation, there is - when in first adddress is 8000H

@kbialek
Copy link
Owner Author

kbialek commented Apr 7, 2024

@Scorpion1211svk fyi, DTSD422 integration has been provided by the community. I do not own such a device, and thus cannot verify if the integration works correctly. However, with the input provided by @mrlordziemniak I'm now able to double check the setup.

So what stands for Total Positive Energy or Total Positive Energy2, I mean it is daily, weekly, or all time?

I don't know that. Please check in the meter manual.

there is problem onyl with S_WORD because solarman using strange sign interpretation, there is - when in first adddress is 8000H

This is called Signed Magnitude representation and deye-inverter-mqtt is currently using it for a couple of registers in this meter integration, namely:

  • ct1/power_factor
  • ct2/power_factor
  • ct3/power_factor
  • ct4/power_factor
  • ct5/power_factor
  • ct6/power_factor
  • total/power_factor
  • total/power_factor2

@mrlordziemniak In your esphome config, you apply lambda transformations to handle the sign properly. You do this for ActivePower 1-3, but not for ActivePower 4-6. Is there a reason for that? What about current readings, aren't they also signed, to represent energy import/export?

@mrlordziemniak
Copy link

Because from 1-3 there is active power with plus or minus, on 4-6 with my setup of ct clamp there is always plus sign so I read only data value without sign :) same with current 1-3 with sign and 4-5 always positive, I read data from sign register and from value register then I use lambda to compare sign, I don't know how do this in different simple way, I mean read double register compare with lambda and get correct reading because S_DWORD doesn't work for me :/

@kbialek
Copy link
Owner Author

kbialek commented Apr 7, 2024

Thanks for the info. So you made it working with your setup 👍 Good to know that. Yeah, I think that esphome modbus component does not support signed magnitude representation, so your approach with the lambda is a valid workaround to the problem.

@mrlordziemniak
Copy link

I can provide full modbus register for all data for that meter, I have xls from my friend :)

@kbialek
Copy link
Owner Author

kbialek commented Apr 7, 2024

That would be great

@Scorpion1211svk
Copy link

When do you expect to update the code? Just asking, ;)

@kbialek
Copy link
Owner Author

kbialek commented Apr 9, 2024

When do you expect to update the code? Just asking, ;)

I'm waiting for the xls promised by @mrlordziemniak 🙂

@mrlordziemniak
Copy link

When do you expect to update the code? Just asking, ;)

I'm waiting for the xls promised by @mrlordziemniak 🙂

How can i send you that file?

@kbialek
Copy link
Owner Author

kbialek commented Apr 9, 2024

When do you expect to update the code? Just asking, ;)

I'm waiting for the xls promised by @mrlordziemniak 🙂

How can i send you that file?

Options:

  1. Attach it here
  2. Add a link here in a comment
  3. Send me a private message at elektroda.pl, my username there is krzysiek.b

@kbialek kbialek linked a pull request Apr 10, 2024 that will close this issue
@kbialek
Copy link
Owner Author

kbialek commented Apr 10, 2024

Beta build is ready for testing ghcr.io/kbialek/deye-inverter-mqtt:2024.04.1-beta-2

Update list of MQTT topics is available here https://github.com/kbialek/deye-inverter-mqtt/blob/release/2024.04.1/docs/metric_group_igen_dtsd422.md

@Scorpion1211svk
Copy link

Scorpion1211svk commented Apr 11, 2024

Hi, at first, thanks for update.
Total energy numbers are different to previous, but still not accurate, it's not about measurement W or kW or units, it doesn't match.
image
image

@kbialek
Copy link
Owner Author

kbialek commented Apr 11, 2024

Two things:

  1. I think the total metrics were read wrongly. I fixed that in a new beta build ghcr.io/kbialek/deye-inverter-mqtt:2024.04.1-beta-3. Test it.
  2. The total metrics are very likely cumulative, and are not reset automatically at midnight. The "solarman" metric in the table above are pretty small, so I assume, they are showing daily production and are calculated by the solarman app. To be confirmed.

@Scorpion1211svk
Copy link

Thank you very, very much, it works perfectly now.
2. yes, total metrics were cumulative, but now the numbers are the same as from Solarman API or App

@kbialek
Copy link
Owner Author

kbialek commented Apr 14, 2024

Thank you very, very much, it works perfectly now.

Sounds great! In return I kindly encourage you to support my work and to buy me a coffee 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants