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

Solarman DDZY422-D2 #187

Open
bobybob69 opened this issue Oct 1, 2024 · 117 comments
Open

Solarman DDZY422-D2 #187

bobybob69 opened this issue Oct 1, 2024 · 117 comments

Comments

@bobybob69
Copy link

Describe the bug
A clear and concise description of what the bug is.

I try to install my Solarman DDZY422-D2 Smart Meter using the integration ha-solarman.
When setting everything up, I got an error message "Échec de la configuration, nouvel essai: [SERIALNUMBER] Querying IP-ADRESS:PORT failed: [0, 0]."

Attach the debug log
As a file or using the 'code' formatting.

To Reproduce
Steps to reproduce the behavior:

From the setting, add an integration
set your IP address
Port
Serial number
select solarman_dtsd422-d3.yaml
apply setting
Wait for the confirmation and notice the error message "Échec de la configuration, nouvel essai: [SERIALNUMBER] Querying IP-ADRESS:PORT failed: [0, 0]."

Expected behavior
A clear and concise description of what you expected to happen.

I don't know if it's the right configuration path as it's the D3 on the choice list

Screenshots
If applicable, add screenshots to help explain your problem.

error solarman integration DDZY422-D2

Metadata:
Version: 24.09.27

Additional context
Add any other context about the problem here.

I don't know if it's a bug report or if it's a request feature to add the configuration .yaml for the D2 smart meter (I thought D2 / D3 where the same.. ?)

@bobybob69 bobybob69 added the bug Something isn't working label Oct 1, 2024
@bobybob69
Copy link
Author

about the log details, If you could explain how to extract them it would be helpful and I would be able to past the code here. thanks ! :)

@davidrapan
Copy link
Owner

Hi @bobybob69, like this:
solarman_enable_debug

@bobybob69
Copy link
Author

bobybob69 commented Oct 2, 2024

Hi @davidrapan

Thanks for looking at the thread

it was running on my screenshot but I didn't understand the file was downloading when clicking on stop 😅

please found bellow the log file

home-assistant_solarman_2024-10-02T19-02-14.489Z.log.zip

Let me know if you get everything

thanks for looking at it ! and let me know if you need anything else to help

@davidrapan
Copy link
Owner

davidrapan commented Oct 2, 2024

Extracted flow from the log file:

2024-10-02 21:00:41.664 DEBUG (MainThread) [custom_components.solarman.api] [????????????] Scheduling 2 query requests. #0
2024-10-02 21:00:41.664 DEBUG (MainThread) [custom_components.solarman.api] [????????????] Querying 0001 - 0041 | 0x0001 - 0x0029 # 041 ...
2024-10-02 21:00:41.664 INFO (MainThread) [custom_components.solarman.api] [????????????] Connecting to 17.0.0.81:8899
2024-10-02 21:00:41.672 DEBUG (MainThread) [custom_components.solarman.api] [????????????] SENT: a5 17 00 10 45 02 00 9e 8e ee 9b 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 03 00 01 00 29 d5 d4 fc 15
2024-10-02 21:00:43.683 DEBUG (MainThread) [custom_components.solarman.api] [????????????] RECD: a5 10 00 10 15 02 4a 9e 8e ee 9b 02 01 8d 8b 48 00 fc 15 00 00 ce 0c b5 66 05 00 a4 15
2024-10-02 21:00:43.684 DEBUG (MainThread) [custom_components.solarman.api] [????????????] Querying 0001 - 0041 | 0x0001 - 0x0029 # 041 failed. [V5FrameError: V5 frame does not contain a valid Modbus RTU frame]

Hi @githubDante, Exception with code 05 (0x05) | Acknowledge. Does it says anything useful? The profile is made for D3 version so it can be just about incompatibility but I'm curious what are your thoughts?

@githubDante
Copy link

Hi @davidrapan,

Incompatible profile 100% - wrong start address or quantity

@davidrapan
Copy link
Owner

Thanks @githubDante,

So you will have to try probe registers using built-in service for reading and create new profile for your device @bobybob69

@davidrapan davidrapan removed the bug Something isn't working label Oct 3, 2024
@bobybob69
Copy link
Author

Hi @davidrapan and @githubDante thanks for looking at the log.

Well, I'm not familiar with that.
What could I do to help implement that easily ?

After comparing D2 and D3 it seems like it's just difference of power distribution (simple-phase or triple-phase)
D2 is a simple phase, the type of install I've at home.

Let me know I would be more than happy to help learn and implement that with one of you guys

Thanks for helping

@bobybob69
Copy link
Author

Let me know if there is anything I could do to help integrate the D2 guys

Thanks !

@davidrapan
Copy link
Owner

It's quite simple. You just have to copy for example inverter_definitions/solarman_dtsd422-d3.yaml into inverter_definitions/custom/solarman_ddzy422-d2.yaml

  • Add device using this new custom profile
  • Remove all sensors which are causing issues
  • Use bult-in services for reading (Developer Tools > ACTIONS > Solarman reading services 0x3 and 0x4)

And you will have to find those register which shows matching values in the Solarman App.

Sadly without documentation there is no other way than trial and error.

@bobybob69
Copy link
Author

hi @davidrapan , thanks for the tips !

I try to do the copy / paste yaml parts. But the integration mark an error (see bellow) , I attach also the log.

Since the integration failed, there is nothing more for me to do using the Developper ACTION parts .. ?

action developer tool

Any tips that I could try to implement the D2 ?

Thanks !

integration error

home-assistant_solarman_2024-10-12T18-50-02.280Z.log

@davidrapan
Copy link
Owner

davidrapan commented Oct 12, 2024

It's not relevant during this process and you can ignore it. Using ACTIONS will still work.

@bobybob69
Copy link
Author

Bellow are the log after adding the proper modbus register but I still have an issue..

Any thought @davidrapan ?

home-assistant_solarman_2024-10-12T19-24-08.095Z.log

@davidrapan
Copy link
Owner

davidrapan commented Oct 12, 2024

According to the log requests to your Smart Meter still contains invalid addresses.

@bobybob69
Copy link
Author

Humm... progress but still some errors.. any thoughts @davidrapan from where I can found these modbus register ? any macOS tools I can use to read theses address using the IP ? I sent an email to see if they have theses for me as there is nothing on the user guide unfortunately

I found these on the net , what do you think ?

solarmlan_DDZY422.yaml.txt

@davidrapan
Copy link
Owner

davidrapan commented Oct 12, 2024

Yeah it's not publicly available information and not sure if solarman will be willing to provide the docs.

from where I can found these modbus register ? any macOS tools I can use to read theses address using the IP ?

I told you using the ACTIONS through this integration. That is the best tool you can get.

I found these on the net , what do you think ?

I don't have the device so I can't really tell. But take it slowly. Just start even with single sensor defined in the file with registers you verified that works using said ACTIONS. 😉

@githubDante
Copy link

githubDante commented Oct 12, 2024

Found this through google
solarmlan_DDZY422.yaml.txt

Edit: oops, looks like @bobybob69 found it too, sorry

@bobybob69
Copy link
Author

bobybob69 commented Oct 13, 2024

Hey @davidrapan @githubDante
I think I understand how the actions from HA is working.
However, how can I use it even if the Smart Meter isn't list ?
Would it be better to use YAML config instead of UI ? And so what would be the next step ?

If I understand, There is an action I use to read values , but how can I read values from a devices that's not listed of even setup ? From what I understand from your previous message

Capture d’écran 2024-10-13 à 12 21 12 1

Bellow is what I'm seeing from the actions section when I choose reading value code 4 :

Capture d’écran 2024-10-13 à 12 17 42

Here's my config for the smart meter :

Capture d’écran 2024-10-13 à 12 17 26

I'm not familiar with the modbus things so sorry if I'm asking basic questions :)

Any tips would be helpful :)

Thanks guys !

@davidrapan
Copy link
Owner

If I understand, There is an action I use to read values , but how can I read values from a devices that's not listed of even setup ?

I told you that you have to setup the device first. And ignore when it shows errors. Then try read different registers and find those which works...

@bobybob69
Copy link
Author

I'm sorry if I don't understand but I just want to make I understand what you say @davidrapan

  • first I need to found a way to have the meter not showing any error for the first setup (it doesn't matter if for sensor from the smart meter there is error right)
  • then for the sensor that will have errors, I need to investigate using the action menus from HA right ?
  • then , when troubleshooting everything, it should works properly

Did my thinking is on the right way ? If no please let me know

Thanks for your help I will owe you a coffee at the end 😜

@davidrapan
Copy link
Owner

davidrapan commented Oct 13, 2024

first I need to found a way to have the meter not showing any error for the first setup (it doesn't matter if for sensor from the smart meter there is error right)

I'm saying again. it does not matter if it shows errors. IGNORE THEM! Just add it so you can use the ACTIONS. Thats all.

@bobybob69
Copy link
Author

hey guys @davidrapan @githubDante , I just get an answer from solarman, does this helps ?

Single Phase meter DDZY422-D2 parameters_1728884136958_yiy4p.pdf

@bobybob69
Copy link
Author

first I need to found a way to have the meter not showing any error for the first setup (it doesn't matter if for sensor from the smart meter there is error right)

I'm saying again. it does not matter if it shows errors. IGNORE THEM! Just add it so you can use the ACTIONS. Thats all.

To be faire @davidrapan , I should miss something.. I'm sorry. When you say "if it show error ignore them" what do you mean ?

Here's the status of the meter actually

Capture d’écran 2024-10-14 à 18 12 13

How can I ignore this error ? Even in this state, iit doesn't appear on the action menu .. :(

@davidrapan
Copy link
Owner

What I mean is that even you see error ACTIONS will still work so you just can leave it as it is.

@bobybob69
Copy link
Author

Well @davidrapan , don't ask me how, I change few line on the code (helped by ChatGPT) and now the smart meter is added

Capture d’écran 2024-10-14 à 18 40 25

now when I'm in the action menu what would be the best to troubleshoot each register ? I think I'm not using the correct syntax for the register .. ?

Capture d’écran 2024-10-14 à 18 39 24

what about this screenshot, I'm on the right way ?

thanks for helping

@davidrapan
Copy link
Owner

what about this screenshot, I'm on the right way ?

Yes you are. That means that you just can't read register number 1 so you need to continue with 2... and so on. But to be 100% sure I would also try reading using Modbus Function Code 3 (it has separate service for that).

@bobybob69
Copy link
Author

hi @davidrapan , hope you're well !
I spend almost a day to review register during my days off 😅

all of them failed with the same error : Échec de l'exécution de l'action solarman.read_holding_registers. V5 frame does not contain a valid Modbus RTU frame

I don't understand at all what could be the issue.

Any thought / Tips ? I was looking for an app that could read modbus from the solarman smart meter, but I don't found anything else.

Perhaps there is something wrong on the config no ?

Here's the code I try to set and that made the smart meter being available on HA without error as shared previously

If @githubDante you also have thoughts to help don't hesitate to share :)

Thanks guys for your support

Solarman Smart Meter DDZY422-D2

default:
slave_id: 3
update_interval: 15
digits: 6
timeout: 30

requests:

  • start: 0x0001
    end: 0x0001
    mb_functioncode: 0x03

parameters:

  • group: Voltage
    items:

    • name: Voltage (V)
      class: voltage
      uom: V
      scale: 0.1
      registers: [0x0001]
  • group: Current
    items:

    • name: Current (A)
      class: current
      state_class: measurement
      uom: A
      scale: 0.01
      registers: [0x0002]
  • group: Frequency
    items:

    • name: Frequency
      class: frequency
      state_class: measurement
      uom: Hz
      scale: 0.01
      registers: [0x0003]
  • group: Active Energy
    items:

    • name: Positive Active Total Energy (kWh)
      class: energy
      state_class: total_increasing
      uom: kWh
      scale: 0.01
      registers: [0x0004]
  • group: Power Factor
    items:

    • name: Power Factor
      class: power_factor
      state_class: measurement
      scale: 0.01
      registers: [0x0005]

@davidrapan
Copy link
Owner

There are two ACTIONS for reading:

  • Modbus function code 3
  • Modbus function code 4

Did you also tried with the other one?

@bobybob69
Copy link
Author

Hey @davidrapan , yes I try with both methods.
Still having same error message.

How can I be sure the meter is reachable from HA after I set it up ?

The IP if a fixed one so I'm 100% sure this is the good one.

What I'm less sure is the YAML for the config.
It let me add the smart meter , but the only entities I've is "connection" and it appear "disconnected"
I don't know if it's 100% sure but I've a doubt..

What's your thought ?

Thanks and have a great day

image

@davidrapan
Copy link
Owner

Show me all Total * sensors in HA.

@Picard2002
Copy link

Image
Image
Image
Image
Image

@davidrapan
Copy link
Owner

davidrapan commented Jan 28, 2025

You have Total Load Consumption and Total Energy Import/Export are 0 kWh.

Total * are displayed as Unknown currently when they are 0 kWh as a fail safe against number cycle through 0 during inverter reboots, etc.

@Picard2002
Copy link

But the solarman app is telling me that I have an import from the grid of 385W and a production of 0kw/h, perhaps I should restart the inverter to try to obtain this data?

@davidrapan
Copy link
Owner

Show me.

@davidrapan
Copy link
Owner

davidrapan commented Jan 28, 2025

It's proly bs but what if this device needs different values in Frame Type and/or Sensor Type, @githubDante?

@Picard2002
Copy link

In my ignorance, I believe that this inverter model should have a specific .yaml file for it. I find it incomprehensible that some values ​​are 0 and some are unknown. I have requested specific information about this model from zcscompany.com, which is who the installation company has redirected me to, but they have not clarified anything for me.

@davidrapan
Copy link
Owner

@Picard2002, I wasn't talking about your inverter but solarman meter. 😉

@Picard2002
Copy link

Could it be a firmware version issue? I've seen other users commenting on this in the Joubert integration version number:LSW3_15_270A_1.68System extended version:V1.1.00.10

@githubDante
Copy link

It's proly bs but what if this device needs different values in Frame Type and/or Sensor Type, @githubDante?

I don't think so, the encapsulation of the RTU packet is for the datalogger, not the device to which is connected.

@davidrapan
Copy link
Owner

Yeah, I thought so... and it's true that the device was talking... maybe server mode could reveal something useful.

@Picard2002
Copy link

/Is it possible that the stick logger is the one that sends the solar production data and the electricity import/export data is the solarman ddzy-422-d2 meter?

@Picard2002
Copy link

Is it possible that the stick logger is the one that sends the solar production data and the electricity import/export data is the solarman ddzy-422-d2 meter?

@davidrapan
Copy link
Owner

No.

@Picard2002
Copy link

I don't know if it can be useful, I found this somewhere on sofar

The verification allow the error to be existedduring the transmission between Master and Slave. Sometimes because of the electrical noise and other interruptions, a set of data may change during the transmission from one device to another. The CRC verification ensure that Master or Slave not to respond to the incorrect data that has changed during the transmission. This verification improvesthe security and efficiency of whole system.We are using 16-bit circulation Redundary Check(CRC16),CRC occupies two bytes,containsone 16-bit Binary value.CRC value calculated by transmitting device,then attach to the data frame, the receiving device recalculate the CRC value . Comparedwith the received CRC value, if two valuesare not equal, an error arises.Set all bytes to “1”for a 16-bit register,Then operatedby 8 bit bytesin frame and current value of register continuity, only 8 data bits per byte participate in generation CRC value.start bits; stop bits and other possible parity bits will not affect CRC value generation.During the CRC value generation, each 8-bit byte XOR with the content in register,then shift the result to low-bit, high-bit supplement with “0”,the last significant bit(LSB) remove and test. If the LSB is “1”, the register XOR with a present fixed value, if the LSB shows”0”, not do any treatment. Repeat the above process until perform 8 times shift operation. The next 8-bit bytes XOR with current value of register, also perform another 8 shift XOR operation as above -mentioned, the final value we get is the CRC value.The Process of generating a CRC valueStep1: Preset all bytes to “1”For 16-bit register, defined as CRC register(0FFFFH)Step2: XOR the first 8-bit byte in data frame with the low byte in CRC registerStep3: Shift the CRC register one bit to the right,high-bit supplement with “0”, the LSB remove and testStep4: If the LSB is “0”, repeat step3(Next Shift), if the LSB is “1”, the register XOR with a preset fixed value,(0A001H)Step 5:Repeat step 3 &4, until perform 8 times shift operation.Step 6: Repeat from step2 to 5 to deal with next 8-bit byte, until end of all bytes processing complete.Step 7: Finally,the value of CRC register is the value of CRC 2.Instructions2.1Broadcast data frame information (address 0x88)Broadcast data with no response2.1.1.Auto Timing(Slave Address)0x88(Function Code)0x02Register Address(Hi)0x50

@githubDante
Copy link

The CRC is incorporated in the RTU frame and is checked/verified for every response from the the datalooger. It's part of the MODBUS protocol. Frames with invalid CRC are not processed at all.

@Picard2002
Copy link

I don't know what to do anymore, or what else I can contribute. I do a lot of tests, I read documents, but I don't know how I could integrate Sofar 5ktlm-g3. Perhaps, and so as not to bother you any more, I could try to install an Ianmetter meter to have energy import and export data and use the data from this integration to obtain production data.

@davidrapan
Copy link
Owner

But I have your device (Sofar 5ktlm-g3) confirmed working from others (including all the necessary sensors).

@Picard2002
Copy link

Could it be a problem with the USB device firmware? Although I can't find any update files, I am seeing messages where users are commenting on the firmware version of their devices
P.S: I'm very sorry for the inconvenience and my insistence, but this is getting to me, since solarman doesn't respond to support tickets

@davidrapan
Copy link
Owner

USB? What setup are you running?

@Picard2002
Copy link

sofar_g3hyd.yaml, but lsw3 not work crc error, and wifikit crc error

@davidrapan
Copy link
Owner

So why you are talking about USB? You are really confusing.

@Picard2002
Copy link

Picard2002 commented Feb 1, 2025

In my case, I have two devices linked to my inverter, on one hand a solarman ddzy422-d2 smart meter, which I have not been able to integrate as it gives me an unknown v5 exception, on the other hand I have a lsw3 usb stick logger connected to the inverter, as I have not been able to integrate the ddzy422-d2, I am trying to obtain data through the usb stick logger with which I have been able to obtain some data, but not those of energy import/export with the sofar_g3hyd.yaml configuration, I am very sorry for the confusion and the inconvenience.

Image

@davidrapan
Copy link
Owner

I have a lsw3 usb stick logger connected to the inverter

Okay, let's totally forget that you have USB variant as it's highly irrelevant.

FW of the stick logger (proly) won't affect anything about modbus. On the other hand you could try update INVERTER FW.

@Picard2002
Copy link

Picard2002 commented Feb 2, 2025

Inverter firmware updated to the latest version (the only one available on the sofar website for this model) I receive data, but I still have the same problem without import/export data, just to contribute something I am searching the web for "sofar solar modbus registers" and several different documents appear in which the addresses (I don't know if I should call them that) are different for these sensors.
Again I apologize and be patient with me, by the way there could be some translation errors which have previously generated confusion

Image
Image

Image

@davidrapan
Copy link
Owner

Try them then. 😉

@Picard2002
Copy link

They don't work either, perhaps it would be good to know if other users of this same inverter (5ktlm-g3), manage to obtain this energy import/export data, because if the solarman smart app shows them, something is missing, or there is a fault in my inverter or installation. I also think that I should open a specific thread for this inverter, since I have been commenting on the solarman ddzy422-d2 thread, since I installed the integration.

@davidrapan
Copy link
Owner

davidrapan commented Feb 4, 2025

Start new thread and include all data you have available (all registers you tried w/ what result, etc). 😉

@davidrapan
Copy link
Owner

Continuation regarding Sofar 5KTLM-G3 in #388

@Ziksax
Copy link

Ziksax commented Feb 14, 2025

Hello everyone,

Has anyone found a solution for the DDZY422-D2 ?

I spend time looking for a correct configuration but I still have the same error..

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

No branches or pull requests

8 participants