codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.04k stars 332 forks source link

Philips Avent Baby Monitor uses Tuya #628

Open thekoma opened 1 year ago

thekoma commented 1 year ago

Discussed in https://github.com/codetheweb/tuyapi/discussions/627

Originally posted by **thekoma** May 8, 2023 Hi! I'm Triyng to get a baby monitor work on local network or at least try to integrate it with the home domotics. The Camera uses a custom [App ](https://play.google.com/store/apps/details?id=com.philips.ph.babymonitorplus&hl=it&gl=US). After a little of nmap: ``` ❯ nmap 192.168.x.y Starting Nmap 7.91 ( https://nmap.org ) at 2023-05-08 22:02 CEST Nmap scan report for 192.168.x.y Host is up (0.0098s latency). Not shown: 997 closed ports PORT STATE SERVICE 554/tcp open rtsp 6000/tcp open X11 6668/tcp open irc ``` And a little of [Frida](https://github.com/frida/frida) some [mitm proxy](https://github.com/mitmproxy/mitmproxy) and a lot of insults (I had to use an old android phone because the APK is arm64 only and no emulation works). I've discovered that this damn thing uses Tuya API endpoint. ``` POST https://a1.tuyaeu.com/api.json HTTP/2.0 user-agent: TY-UA=APP/Android/1.0.5/SDK/3.34.5 content-type: application/x-www-form-urlencoded content-length: 718 accept-encoding: gzip ``` ``` appVersion: 1.0.5 appRnVersion: 5.52 sign: channel: oem deviceId: platform: ONEPLUS A6003 sid: requestId: lang: it_IT a: tuya.m.app.version.upgrade clientId: osSystem: 13 os: Android timeZoneId: Europe/Rome ttid: sdk_tuya_international@ et: 3 v: 3.0 deviceCoreVersion: 3.34.5 sdkVersion: 3.34.5 time: 1683573576 postData: ``` Is there any way to use the tuyapi (or any client or existing component of this ecosystem) to control this device? Thank you Koma
msillano commented 1 year ago

The problem is general: some manufacturers prefer to use their own apps instead of smartLife. But in doing so the user loses the ability to integrate with other devices.

Is there a general solution/workaround to use these devices with tuyAPI? Best regards. m.s.

t3hk0d3 commented 7 months ago

+1

I've spent some time trying to debug this device too, mostly thru reverse-engineering Android app. Got surprised that Phillips is actually using Tuya IoT cloud for baby stuff.

msillano commented 7 months ago

I consider this positive. It shows the diffusion of Tuya solutions, their reliability, and the validity of investing in this ecosystem. My goal (with TuyaDAEMON) is to maximize interoperability and user freedom. This is why I am interested in strategies to use tuyAPI in cases like this, with custom versions of the Tuya cloud (unfortunately with decidedly poorer performance). Another example is my air conditioner. It's a shame that these manufacturers don't realize the potential (including trading) that Tuya integration offers to their products.