webdjoe / pyvesync

pyvesync is a python library to manage Etekcity & Levoit smart devices
MIT License
170 stars 83 forks source link

PyVesync fails to recognise smart plug #192

Open timluther opened 1 year ago

timluther commented 1 year ago

Hi, I'm trying to connect to a smart plug in both home assistant and in my own python test scripts but so far, no joy.

On initialising the library in debug mode, I get the following messages:

2023-06-17 10:06:12,736 - DEBUG - New device list initialized 2023-06-17 10:06:12,736 - DEBUG - Unknown device named OfficePCs model WHOGPLUG 2023-06-17 10:06:12,736 - DEBUG - Error - 'VeSync' object has no attribute 'unknown' 2023-06-17 10:06:12,736 - DEBUG - WHOGPLUG device not added 2023-06-17 10:06:12,736 - DEBUG - Start updating the device details one by one

So, it looks like it's failing to find my plug, which is a 'WI-FI Smart Plug, WHDZ03' (available here: https://www.amazon.co.uk/Socket-Monitor-Function-SmartLife-Control/dp/B09CYMF1CP).

Do you support this device and is there anything I can do to get it working?

jhbruhn commented 1 year ago

I am in the same situation with this plug, which also gets discovered as "WHOGPLUG". https://www.amazon.de/dp/B0BNN4TH2Q/ref=redir_mobile_desktop?_encoding=UTF8&psc=1&ref=ppx_pop_mob_b_asin_title#aw-udpv3-customer-reviews_feature_div

In theory I could add the support, but I don't have access to a rooted android phone and thus am not able to reverse engineer them :(

webdjoe commented 1 year ago

Without packet captures, I can't add support.

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.

chaosfreak93 commented 1 year ago

Hey, My Smart Plug gets also discovered as "WHOGPLUG". Any News about it?