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 · 70 comments
Open

Solarman DDZY422-D2 #187

bobybob69 opened this issue Oct 1, 2024 · 70 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

davidrapan commented Nov 2, 2024

I'm using File Editor module
then I go to customer component > solarman > inverter_definitions > I create a file I named solarman_DDZY422-D2.yaml and I copy paste the code you sent.
Then I save and I restart entirely my HA instance..

You did it correctly!

Enable debug log and upload the file.

@davidrapan
Copy link
Owner

I can't see in the doc to which memory area are the registers mapped so maybe it's worth the shot to try 0x04.

Try to replace that default section with:

default:
  update_interval: 5
  code: 0x04
  digits: 3

@bobybob69
Copy link
Author

hi @davidrapan ,
I tried to adjust the default section as you mentioned but nothing changed
Please found bellow the logs.

So if I understand, we are just looking for the correct memory right ? and for you, all the rest of the config is ok 👍

home-assistant_solarman_2024-11-03T20-38-21.631Z.log

@davidrapan
Copy link
Owner

Yeah well if it's not even working with this minimal yaml file (which is was made using xlsx file you provided)...

I'm afraid that there is something else going on which is outside of our reach.

I'm out of ideas... there is proly not much we can do, right @githubDante?

@githubDante
Copy link

Why don't you try with the registers from the XLS file e.g. from 0x105 to 0x107 ? It's a 6 byte Date&Time.

@davidrapan
Copy link
Owner

Okay, try this one:

#
# Solarman Smart Meter DDZY422-D2
#
# Reference: https://github.com/user-attachments/files/17586995/DDZY422-D2.-modbus.HT-YF2018-0929-01._1729757263801_10de75.xlsx
#

default:
  update_interval: 5
  digits: 3

parameters:
  - group: Variable Data 1
    items:
      - name: Date & Time
        platform: datetime
        rule: 8
        registers: [0x0105, 0x0106, 0x0107]

@bobybob69
Copy link
Author

bobybob69 commented Nov 4, 2024

hey guys @githubDante @davidrapan

just tried now, and still same error message ... "Echec de la configuration, nouvel essai: [2616102558] V5FrameError: V5 frame does not contain a valid Modbus RTU frame"

please found bellow the logs (in the meantime It can maybe help for #203 as logs turn all day until it turn off when I restart HomeAssistant during no solar production)

home-assistant_solarman_2024-11-04T20-14-28.300Z.log

you confirm when I made the change from the config file, I restart HA instance and I re-set the meter ?

thanks guys

@davidrapan
Copy link
Owner

Uhm but you don't have that device (2616102558) configured w/ solarman_DDZY422-D2.yaml!

I see it configured with deye_hybrid.yaml!

@bobybob69
Copy link
Author

Hummmm strange I double checked, it's configured with the right profile..

See logs bellow

home-assistant_solarman_2024-11-04T20-28-09.595Z.log

@bobybob69
Copy link
Author

just so you know, I deleted the devices and I re-install it properly .
And the config file with the latest logs I sent only contain what you shared bellow , is it right ?

Okay, try this one:

#
# Solarman Smart Meter DDZY422-D2
#
# Reference: https://github.com/user-attachments/files/17586995/DDZY422-D2.-modbus.HT-YF2018-0929-01._1729757263801_10de75.xlsx
#

default:
  update_interval: 5
  digits: 3

parameters:
  - group: Variable Data 1
    items:
      - name: Date & Time
        platform: datetime
        rule: 8
        registers: [0x0105, 0x0106, 0x0107]

@davidrapan
Copy link
Owner

Yes now it uses correct one. Unfortunately w/ the same result.. 😞

@bobybob69
Copy link
Author

can it be the port that cause issue ? by default 8899 ?
what could be wrong.. it's so frustrating at this level to not be able to integrate it even with the modbus xls 😞

Any troubleshoot I could do locally ?
The errors are because the meter doesn't answer back the data we're looking for right ?
Or it's the modbus that is not correct apparently ?

@githubDante
Copy link

can it be the port that cause issue ? by default 8899 ?
what could be wrong.. it's so frustrating at this level to not be able to integrate it even with the modbus xls

No, it's not the port. The smart meter is responding with an error/exception code, which means that the request is wrong (wrong address/wrong function).

Any troubleshoot I could do locally ?
The errors are because the meter doesn't answer back the data we're looking for right ?
Or it's the modbus that is not correct apparently

The best you can do is to request the proper/full MODBUS documentation for the smart meter from IGEN. Apparently the one in the XLS file is wrong and incomplete.

@bobybob69
Copy link
Author

hi @githubDante , how are you ? I got answer form the support team of solarman, and they confirm the file is the good one.. what can we do to integrate it ? from where the issue can come from ? :/
thanks mate and have a pleasant day

@davidrapan
Copy link
Owner

Did you mentioned what responses are we getting from the meter?

@bobybob69
Copy link
Author

hi @davidrapan , just answer back to their message adding the error message we're facing and I'm waiting for their answer.. will share it with you as soon as I got the answer

@teoJam
Copy link

teoJam commented Dec 3, 2024

Hello,
I have the same device (DDZY422-D2), the zucchetti ZH3ES non-hybrid inverter. I have a solarman logger that HA can read, but I also have the DDZY422-D2 meter, in which I can't get the integration to work.

I am new to Home Assistant, but if you can explain what tests I can do to add my logs as well, if I can be of any help, it is an issue I am interested in solving.

I have done some of the tests you mention here, but for example in Actions I can't find the Solarman action. How come?

Also in configuration I can't find the files I create from file manager.
I have created the file
/homeassistant/custom_components/solarman/inverter_definitions/solarman_DDZY422-D2.yaml
with the values you suggested in it, but in the device menu I do not see the file, so I copied the same values to the custom_parameters.yaml file and configured the device with this file, but of course it still always goes to error.

Despite this when I then review the device configuration it seems to be reading the zcs_blue-ktl-v3.yaml file I started from.

By reading or log I realized that I used to get an error because I was using the external HA url with *.duckdns.org, but then they resolved the moment I started using the local one.

Thank you

@davidrapan
Copy link
Owner

Show me a screenshot where did you put the file.

@teoJam
Copy link

teoJam commented Dec 3, 2024

The solarman integration is:
image
I had to go back through the versions otherwise the solarman logger wouldn't work for me either.
image
image
image

@davidrapan
Copy link
Owner

You are not running this integration.

@teoJam
Copy link

teoJam commented Dec 3, 2024

Sorry, I didn't understand your comment. What should I do to run it?
Is it not the correct integration?

I am reading more of your discussions. I need to perform these steps: #61
?

@bobybob69
Copy link
Author

@teoJam hi mate !

Yes you should perform theses steps #61 and then install the good SOLARMAN integration from @davidrapan

Since I did multiple troubleshoot, I decided to remove the SOLARMAN smart meter and I order 2 HomeWizard single phase meter to mesure house consumption and solar production.

It would be more stable for me and my needs

Hope at some point the integration for the D2 will works and I would be able to put it back for other measurement :)

@davidrapan
Copy link
Owner

davidrapan commented Dec 3, 2024

I need to perform these steps: #61?

I'm not sure if you are having the same "issues" but you certainly need to remove that older one from HACS and then install this one using the big blue button in the readme.

@teoJam
Copy link

teoJam commented Dec 4, 2024

Thank you for the support.
I have a plan b for the meter too because I have a shelly that I could leverage to read the house load instead of the Solarman, but since I have to have the electrician step in and the Solarman anyway I have it I would prefer to make it work.

I downloaded the right version.
Right now I have these errors:
image
image

Right now the configuration is going
Solarman Smart Meter DDZY422-D2
ed il log è il seguente.
home-assistant_solarman_2024-12-04T22-10-46.998Z.log

Right now the logger and inverter are off for two reasons. 1 because they have yet to hook it up to the grid for me, 2 because it would only work when the strings start producing anyway.

why there is a Broadcasting on IPv4Network('172.30.232.0/23')?

Grazie

@davidrapan
Copy link
Owner

davidrapan commented Dec 5, 2024

Yes this is the usual output of every attempt we had so far...

Maybe you could try register scanner from pysolarmanv5

Edit:

Why there is a Broadcasting on IPv4Network('172.30.232.0/23')?

This is device discovery and sends a Solarman-specific packet to which their devices responds. Packets are sent to all IPv4Address.is_private networks available in HA. Docker uses block 172.30.232.0/23 within HA.

Edit2: You can review the implementation here: solarman/discovery.py

@Picard2002
Copy link

It's my same problem, I get the same errors as the colleague bobybob69, in my case I have managed to integrate my sofar 5ktlm g3 inverter by reading the solarman usb stick logger, but I have no export readings to the network or consumption of my home, I am still trying to integrate solarman ddz422-d2, to obtain that export and consumption data, the same error codes as the colleague

@micka-mrs
Copy link

micka-mrs commented Dec 31, 2024

Hello @davidrapan , I'm new to home assistant and I can't integrate my DDZY422-D2 even though my 2 DEYE inverters are OK. Here is the error message I got.
Can anyone help me?
Capture d’écran 2024-12-31 à 12 20 06

@Thiiib
Copy link

Thiiib commented Jan 4, 2025

Hi all

Same here I would like to add my smartmeter solarman DDZY422-D2 but dont know how to build the yaml.

in addition I think we Will have a problem because when we go on the web interface of the smartmeter we reach it but don’t have any data … whereas we have data using solarman app…
IMG_0220

however someone looks to manage it using ESP, hope it helps
https://github.com/mrlordziemniak/dtsd422_esphome

@davidrapan
Copy link
Owner

It looks like these are the same registers as in the excel file, but we were unable to read them using the solarman protocol.

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

7 participants