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

ChangeURL from region to uni0 #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmangin-fr
Copy link

Hi, can you please test this change on your end?

@rmangin-fr
Copy link
Author

@reyntjensw can you please review?

@ghost
Copy link

ghost commented Jan 26, 2024

@rmangin-fr was this tested?

@rmangin-fr
Copy link
Author

@cloudsisters-admin NOOO Unfortunately, I do not know how to simulate dev environment.

@reyntjensw
Copy link
Owner

@rmangin-fr the change needs to be tested first.

Unfortunately, I have no api access so I cannot test it, but Homey has a great reference to test. (https://apps.developer.homey.app/the-basics/getting-started)

What you need to do is to clone it to your local machine and execute homey app run, this will run the local code and you will be able to test your changes.

@rmangin-fr
Copy link
Author

@rmangin-fr the change needs to be tested first.

Unfortunately, I have no api access so I cannot test it, but Homey has a great reference to test. (https://apps.developer.homey.app/the-basics/getting-started)

What you need to do is to clone it to your local machine and execute homey app run, this will run the local code and you will be able to test your changes.

will do it :) a bit blocked by the environment. but will succeed! But I think I'm more interested into helping to develop the Modbus TCP version that will use the local network of the inverter (better to avoid internet in & out to read a local data).

@reyntjensw
Copy link
Owner

@rmangin-fr the change needs to be tested first.
Unfortunately, I have no api access so I cannot test it, but Homey has a great reference to test. (https://apps.developer.homey.app/the-basics/getting-started)
What you need to do is to clone it to your local machine and execute homey app run, this will run the local code and you will be able to test your changes.

will do it :) a bit blocked by the environment. but will succeed! But I think I'm more interested into helping to develop the Modbus TCP version that will use the local network of the inverter (better to avoid internet in & out to read a local data).

I'm afraid the Modbus communication is far from stable, like I mentioned on the forum, I'm not sure if I will release it because of the pile of support tickets that will pop up.

@dragosj
Copy link

dragosj commented Jan 30, 2024

There is an integration that is working in Home Assistant with two connection types (serial or network) which is local and not through cloud.
With it, you can even receive data at 10 sec.
Currently this is what I'm using in a mixed Homey/HA environment but I want to migrate all to Homey so maybe it will help you with your app.

https://github.com/wlcrs/huawei_solar

Regards,
Dragos

@5g11
Copy link

5g11 commented Feb 28, 2024

I'm afraid the Modbus communication is far from stable, like I mentioned on the forum, I'm not sure if I will release it because of the pile of support tickets that will pop up.

Is there a way to test this?

@reyntjensw
Copy link
Owner

@dragosj @5g11 we cannot use the HA integration because it is written in Python and not in NodeJS.
Converting this requires time that I do not have.

Like mentioned multiple times, we need another dev to pick this up.
I don't have time to work on it and support this.

@rmangin-fr
Copy link
Author

rmangin-fr commented Feb 28, 2024 via email

@5g11
Copy link

5g11 commented Feb 28, 2024

Just a question about registration. Would it make sense to do this? "https://uni004eu5.fusionsolar.huawei.com"?
The old region04eu5 still has the registration in the inverter

https://homey.app/en-us/app/org.modbus/Modbus/
This allows the inverter to be found immediately. Can't we use that?

We can test Mobus here: https://community.homey.app/t/app-pro-solaredge-growatt-tcp-modbus/45487/829

@rmangin-fr
Copy link
Author

Hi interested people :)

Just to let you know that I should be able to test and probably maybe also debug the changes next week as I will be 'in the same wifi network than my Homey'.
I took some docker trainings and I am following a cloud journey training with TypeScript courses so I hope that I would be able to check the connection works with modified URLs and maybe I will also try to provide a way to integrate at least the Kiosk URL.

With that, I would also like to upgrade some components versions to more recent stage.

Many thanks for not having yet validated my PR so that people are annoyed from December :)

BTW, I will test other ModusTCP solar applications to see if I'm able to understand the protocol from there.
In my situation, I would really appreciate if my Homey is able to send an alert to the Solar provider to let them know the device is again offline and they have to plan an intervention asap. As well, Modbus seems really a better solution to get accurate, recent and valid figures from the device in the local network than from an old image Huawei has recorded in their server.

Reminding latency:

  • Modbus: 1s
  • this app / huawei solar web access: 5 minutes
  • Kiosk URL: 30 minutes

Taking actions with the Kiosk URL in Home Assistant can lead to elevation of the electricity bill just because of 5 minutes of sun badly placed in 1 hour! Definitively, I hate the third option that I am forced to use in HA from December.

Best Regards
Rémi
TBC

@rmangin-fr
Copy link
Author

Just a question about registration. Would it make sense to do this? "https://uni004eu5.fusionsolar.huawei.com"? The old region04eu5 still has the registration in the inverter

https://homey.app/en-us/app/org.modbus/Modbus/ This allows the inverter to be found immediately. Can't we use that?

We can test Mobus here: https://community.homey.app/t/app-pro-solaredge-growatt-tcp-modbus/45487/829

Hey, good question :) this is the content of the PR :)
Enjoy, I will test it next week!

Better news before SUMMER sun hopefully :)

@rmangin-fr
Copy link
Author

Sorry it did not work, I'm stuck with understanding the coding with rear call that does not find the token.
I saw in the developer console the they now use the V4 api and they assign their cookies to an higher domain including * at the beginning.

But from the logs I have added for sure the rear=undefined. I suppose the solution is not far but when I compare the cookies I got in my browser and those that the app is retaining, I'm afraid the session is not completely saved in the app so that next call can work. As well, path is not the same in the set-cookies instructions that in the jar repository.

I've also checked my Sun2000 has no 6607 opened port. So the modbus option cannot be used without installer action to open ports. I will try to check the Home Assistant code so as to check how they make the loading of the URL since I observed the Kiosk url is again delaying webpage content to subsequent browser calls.

Tomorrow the installer guy comes to check the installation, I will ask them to enable the local connectivity since it seems not so hard to enable.

No real progress yet.

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 this pull request may close these issues.

None yet

4 participants