faanskit / ha-esolar

Custom Integration of SAJ eSOLAR
https://github.com/faanskit/ha-checkwatt
GNU General Public License v3.0
6 stars 4 forks source link

Battery charging and discharging #3

Closed Woempia closed 1 year ago

Woempia commented 1 year ago

It would be great to be able to charge and discharge the battery and control it through home assistant (with an automation for example). Is this something you would consider looking into?

faanskit commented 1 year ago

For sure it can be considered, but two constraints:

  1. I don't own a battery system
  2. I am limited to what can be done in the SAJ portal

If you can confirm that charge/discharge can be controlled in the SAJ portal we can start looking into it.

It would entail on your side: A. Confirming the above B. Capturing portal communication when performing actions (Chrome dev mode) C. Doing guided trials (I send you files, you need python) D. Worst case: sharing your username/password

So, please send some screenshot how to charge / discharge in the portal.

Br, Marcus

Woempia commented 1 year ago

Hi, thank you so much for your reply A) there is a distinction here between de esolar end user portal and the o&m portal. For the former it currently seems it may not (yet) be accessible there, for the latter it is.

I am currently discussing with SAJ and my installer to get clarity

BCD all fine in case A is clear

Woempia commented 1 year ago

It appears that a new app had been launched: Esaj Home

-There is an option 'outage guard' in the app, which I believe allows you to force charge the battery

It may be more time efficiënt to progress with the new esaj home app? Would you be open to look at this as well ?

Also see below email from SAJ service team:

"Hello:

Please download esaj home app. It's the newest app for end user and available in app store now.

Click the botton right logo>click remote configuration>click bluetooth to connect your inverter. You will see a working mode setting there, choose time of use mode and set specific charge/discharge period. "

Screenshot_20221223_125058_eSAJ Home

faanskit commented 1 year ago

Hi,

I see one major problem, one potential problem and one annoyance.

  1. MAJOR PROBLEM The comment from SAJ mentions Bluetooth. This invalidates the possibility to use the cloud services. I will not have the possibility/competence to create such a solution.

  2. POTENTIAL PROBLEM The SAJ eSolar APP uses a secret encryption for most of the GET requests. Unless Saj share the secret (seed), or someone reverse engineer the app and find the secret key (seed) we have a problem. I've asked Saj for the secret key, without success.

  3. ANNOYANCE The reverse engineer the app is quite combersome compared to the portal. One need to use a Man-in-the-middle attack to succeed. Newer Androiod phones and IPhones does not a allow to use own keys to enable tools like MITM Proxy. So, unless the new app also work on an old iphone/ipad, this will be extremely hard.

/Marcus

Woempia commented 1 year ago

1) within the app there are 3 ways to connect to the inverter (bluetooth, wifi and cloud). SAJ only mentions bluetooth, for the other methods i get the message when I try it that i do not have the right permissions. I am already checking with SAJ to see which type of account is needed to get the permissions

Screenshot_20221223_175415_eSAJ Home

2) let me know if there is anything I can do. Not sure why you are referencing the esolar app here vs the esaj home app

3) I did not register you were taking the data from the portal vs from the app. The portal does not seem to have the option of 'outage guard'

I'll update on 1 when I hear back from SAJ, I'll also ask about 3

faanskit commented 1 year ago

Wrt. 2, see my findings on esolar app parameter encryption here: https://github.com/djansen1987/SAJeSolar/issues/27

If the new app use same encryption we're stuck.

The current integration use the web portal api.

RobbieDemaegdt commented 1 year ago

Just some FYI information, if somewhere in the app (only tested on the old app) they ask for a password, try this: saj_admin. There is also an app for installers, it's called eSolar O&M, if you click on local connection the ask for a password, it's the saj_admin. you have little bit more permissions. Have found this on a video on youtube with 10 views :p

faanskit commented 1 year ago

I'll update on 1 when I hear back from SAJ, I'll also ask about 3

Will be closed due to inactivity and no clear way to implement it. Feel free to complement with new information and we can re-open the request.