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

Add Support for outlets from GreenSun #194

Open
Flausi opened this issue Jul 7, 2023 · 10 comments
Open

Add Support for outlets from GreenSun #194

Flausi opened this issue Jul 7, 2023 · 10 comments

Comments

@Flausi
Copy link

Flausi commented Jul 7, 2023

Hello, I have an outlet from GreenSun (purchased through Amazon) which can be controlled and read via the app Vesync. Is it possible to control this socket also via pyvesync? Many thanks

@webdjoe
Copy link
Owner

webdjoe commented Sep 4, 2023

You would need to send me packet captures. The process is involved but possible since vesync has used methods to prevent capturing packets. Happy to send you some details if you are interested.

@rumpeltux
Copy link

rumpeltux commented Oct 19, 2023

Here are a few logs I took:
greensun-whogplug.txt

Looks like this is using the bypassV2 API that is already being used in some of the bulb handling code.

@mramsch
Copy link

mramsch commented Oct 26, 2023

You would need to send me packet captures. The process is involved but possible since vesync has used methods to prevent capturing packets. Happy to send you some details if you are interested.

Hi, I've a Greensun power outlet, too:
Greensun Smart Socket, Model: P02, Firmware: 1.0.00
"type": "wifi-switch",
"connectionType": "wifi+BTOnboarding"
"deviceType": "WYZYOGMINIPLUG",
"configModule": "ZY_WFBO_OTL_WYZYOGMINIPLUG_UN"

No idea, if this might be helpful, but by chance I found what should be the firmware file:
http://testonline-fw.vesync.cn/ZY_WFBO_OTL_WYZYOGMINIPLUG_UN/v1.0.00/WYZYOGMINIPLUG_UN_ota_v1.0.00.rel.bin
It would be really great if you could add support for this model in PyVeSync!

If you need more capture data, I'm happy to provide it. Only need your instructions how to do it (and some time 😊).

Thanks, Martin

@rumpeltux
Copy link

Hey Martin, you don’t have a copy of that file by any chance? I’m only getting a access denied error when trying to access it.

@mramsch
Copy link

mramsch commented Oct 26, 2023

Hey Martin, you don’t have a copy of that file by any chance? I’m only getting a access denied error when trying to access it.

The link was wrong domain, sorry. Stupid copy&paste error … I've edited my message above and with http://testonline-fw.vesync.cn/ZY_WFBO_OTL_WYZYOGMINIPLUG_UN/v1.0.00/WYZYOGMINIPLUG_UN_ota_v1.0.00.rel.bin the download should work.

@justinswabey
Copy link

Just subing to this thread as I have the same issue and would love to see a solution. Also happy to help with any data, but you'll need to walk me through what you need...

@MartinThoma
Copy link

MartinThoma commented Nov 5, 2023

Same for me :-) I'm an experienced Python developer, but it's been a while since I did anything with networks. I guess when you want packages to be captured that means using wireshark?

Edit: I think I figured it out in principle:

  1. Create wlan access point via hostapd
  2. Create a bridge via bridge-utils
  3. Use wireshark

Let's see when I find the time to actually give it a shot xD

@MartinThoma
Copy link

I can see to which domains it connects (or my smartphone):

analysis.vesync.com
long.vesync.com
operationapi.vesync.com
smartapi.vesync.com
store.vesync.com

But I don't see the specific requests as the calls are decrypted (although I'm in the middle, intercepting all traffic).

@MartinThoma
Copy link

#192 (comment)

The only way to capture is to install the vesync APK on an Android Emulator (like Android Studio) using a generic android OS version. Then using frida as shown in Sections 4,5 in Ultimate Guide. After SSL pinning is disabled, capture packets with SSL proxy with charles or some other software that installs a root certificate.

Check out this for setting frida up. I never used genymotion, only Android Studio which requires a generic android OS to root the device.

@rumpeltux
Copy link

btw I strongly suspect that these are devices similar to other smartplugs discussed in https://www.elektroda.pl/rtvforum/forum390.html. So if opening the device is an option, then you can flash OpenBeken and use the device via this tasmota-like interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants