suaveolent / ha-hoymiles-wifi

Home Assistant custom component for Hoymiles DTUs and the HMS-XXXXW-2T microinverters
MIT License
125 stars 9 forks source link

Can't find all my Inverters. #51

Open ange1us opened 1 month ago

ange1us commented 1 month ago

Hello, First, I would like to thank you for providing us with such a great integration.

I have 3 inverters: HM-1500 and DTU Pro. When I add the Hoymiles integration and input the IP address, it shows only 1 DTU and 2 inverters.

I tried deleting and re-adding the integration, but it still shows only 2 inverters. I also tried restarting Home Assistant, but the issue persists. Could you please provide some guidance on how to resolve this? Here are the models and versions of my inverters:

found

My Home Assistant version is 2024.7.4. Thank you.

suaveolent commented 1 month ago

Sometimes the underlying DTU does not report back all inverters. I have not yet figured out why.

Can you output the response you get from the get-real-data-new from the underlying library to see if it reports back all inverters? Please make sure to hide the serial numbers.

https://github.com/suaveolent/hoymiles-wifi

ange1us commented 1 month ago

I captured the "get-real-data-new" response as you suggested, and it looks like this. If I understand correctly, I can see 1 DTU, 2 inverters, and 1 meter. Is that right? It seems that only 2 inverters are being detected as well.

realData

suaveolent commented 1 month ago

Thanks, that is exactly what I feared. The third inverter does not appear. (However, I can add support for that Meter you have :)) I assume the inverters also appear if you directly connect to the DTU via the S-Miles-Installer App?

Are you able to capture the traffic between your phone and the inverter via Wireshark ? (You might need access to a debug port on you switch).

ange1us commented 1 month ago

Thank you very much! It would be great if you could add support for the meter as well.

Regarding the S-Miles Installer app, I can't access it. I can only use the S-Miles End User app. However, in the S-Miles End User app, I can see all three inverters.

As for capturing traffic with Wireshark, I'm not sure if I can do it because my switch is not a managed switch. I'll try to see if I can figure it out tomorrow. Thanks again!

suaveolent commented 1 month ago

Got it. Can you give me the first 4 digits of your Meter Serial Number and the model you have?

Alright, let me know if you need any help with Wireshark. It would really help me identitfy the issue why sometimes not all inverters show up.

ange1us commented 1 month ago

I'm not sure if I did it correctly. I tried using WireShark to capture traffic while accessing the S-Miles EndUser app on my phone. I also went into the device list and selected each device. It seems that it didn't detect the IP of the DTU or any of the inverters, but it did detect my phone's IP (192.168.1.88), and the results are shown here. I don't know which part I should be looking at or if it found anything.

Screenshot 2024-08-02 021314

As for my smart meter, it’s a Hoymiles DDSU666. I'm unsure which serial number is correct because in the S-Miles EndUser app, the meter's S/N is shown as 10C0xxxxx055, while in the get-data-real command, the S/N is shown as 1841xxxxxxx413.

Similarly, the inverters show different S/Ns in S-Miles EndUser app and in the get-data-real command. However, in Home Assistant, the S/Ns match with what is shown in S-Miles EndUser app.

suaveolent commented 1 month ago

Thanks, that serial number from the get-real-datacommand is exatly what I need. I do some internal conversion to display the same serial as the Hoymiles App.

As for the Wireshark, unfortunately, it is gonna be a lot trickier. We are looking for communication on port 10081 (Filter: tcp.port == 10081). I'm not sure, however, if you need to connect to the DTU directly in order for the Hoymiles app do communicate directly with the DTU instead of retrieving the Data via the Cloud. Note: The integration is also communicating via port 10081, so make sure that it is not running while trying to identify the traffic.

ange1us commented 1 month ago

I tried following your suggestions, but the port 10081 didn't show up. Here's what I did:

  1. Turned off Home Assistant.

  2. Connected my PC via Ethernet and captured packets using Wireshark. My phone was connected to home Wi-Fi, and I accessed the S-Miles EndUser app and clicked on the various inverters. When I applied the filter tcp.port == 10081, nothing showed up.

  3. Connected my PC via Ethernet and captured packets using Wireshark while my phone connected directly to the DTU via Wi-Fi. The S-Miles EndUser app couldn't display anything and showed "Service is not available," but I could access the network config. In the network config, it only offered a Wi-Fi configuration page for the DTU to connect to the router, with no other options. I checked Wireshark again with the tcp.port 10081 filter, but nothing was found.

  4. Repeated steps 2 and 3, but instead of using Ethernet on the PC, I used Wi-Fi. Then again, nothing was found.

  5. Connected my PC directly to the DTU via Wi-Fi, while the phone was connected either to the home Wi-Fi or directly to the DTU's Wi-Fi. The port 10081 still didn't appear.

I suspect, as you mentioned, that the S-Miles EndUser app might only retrieve data from the cloud, unlike the S-Miles Installer app, which can access data locally. Another possibility is that since I performed these tests at night, the inverters might have been shut down, maybe preventing Wireshark from capturing any data. I'll try again during the day.

Meanwhile, I'll also reach out to my solar installer to see if I can get an account for the S-Miles Installer app.

EDIT I tried again during the day when there was sunlight. I repeated everything, but still couldn't find port 10081. I'll have to wait and see if my solar provider can give me access to the S-Miles Installer app.

ange1us commented 1 month ago

I've asked my solar provider, and unfortunately, they cannot provide me access to the S-Miles Installer app.

suaveolent commented 1 week ago

That's unfortunate. As long as the get-real-data-new does not report all the inverters, there is nothing I can do in the meantime. I will keep the issue open to track it.

suaveolent commented 2 days ago

@ange1us I have just added support for meters. Can you try updating to main branch to see if it works?

You also have to "Reconfigure" your intergration once for the meter to get detected. Click on the three dots next to your config entry and select "Reconfigure".

ange1us commented 1 day ago

@ange1us I have just added support for meters. Can you try updating to main branch to see if it works?

You also have to "Reconfigure" your intergration once for the meter to get detected. Click on the three dots next to your config entry and select "Reconfigure".

Thank you very much for the update. I am now able to see the smart meter; however, some values are still displaying as 'unknown,' as shown in the attached image. I'm not quite sure why this is happening. I appreciate your help.

1726281167840

suaveolent commented 1 day ago

Thanks, I will investigate today and push a new update.

I noticed also some typos and wrong value conversions which I will fix today

suaveolent commented 1 day ago

@ange1us , I just pushed a new version of v0.2.5-dev. Can you reinstall that version and check again?

ange1us commented 1 day ago

I have installed the new version, and all the values are now appearing correctly. Thank you very much :)

Screenshot 2024-09-14 201355

suaveolent commented 1 day ago

I have installed the new version, and all the values are now appearing correctly. Thank you very much :)

Screenshot 2024-09-14 201355

Great! Thanks for letting me know!