athombv / com.tuya

Tuya app for Homey
https://homey.app/a/com.tuya
18 stars 12 forks source link

[Device request]: Geurdiffuser WiFi AliExpress #81

Open eelco2k opened 4 months ago

eelco2k commented 4 months ago

Device information

Tuya-Slimme-Luchtbevochtiger-Met-Colorgul-Led-Light-Wifi-Aroma-Diffuser-Timer-Draadloos-Bedieningswerk-Met-Alexa-Google

https://nl.aliexpress.com/item/1005006835176477.html

Device specification

  {
  "device": {
    "active_time": 1655515313,
    "biz_type": 18,
    "category": "xxj",
    "create_time": 1652300521,
    "icon": "smart/icon/bay1617000958068T7OQ/bd2f9a7d4f8dbe7073e5b2336399fb3f.png",
    "id": "bf7580368edaafe873jixf",
    "ip": "",
    "lat": "",
    "local_key": "1e753124c32a12a2",
    "lon": "",
    "model": "YYC2",
    "name": "Geurdiffuser",
    "online": true,
    "owner_id": "",
    "product_id": "6ibwwtzc8bbcpre3",
    "product_name": "Diffuser",
    "sub": false,
    "time_zone": "",
    "uid": "eu1651494398162kX5IY",
    "update_time": 1721431589,
    "uuid": "7cdf22f055c6d97f"
  },
  "specifications": { "category": "xxj" }
}
bobvandevijver commented 3 months ago

Thank you for your request. Unfortunately, based on the specification you've submitted it seems to be an undocumented device which does not expose any properties we can access, which makes it impossible to support with Homey.

eelco2k commented 3 months ago

😔 in an early version of another tuya cloud package it did function. I believe it then identified as a led strip with a switch (on/off). No timer functions (it has 2 buttons, one for changing the led color, and one for timer and start/stop)

eelco2k commented 3 months ago

I have my device in tuya iot cloud (https://eu.platform.tuya.com/cloud/device/) as a device connected: here are the details:

Device Information Product Name Diffuser Device ID bf7580368edaafe873jixf Product Category xxj Device Status Online Activated At 2022-06-18 03:21:53

I did some actions in the Tuya iOS app to get some device logging:


Time | Device Event | DP ID | Event Details | Source | Source Details
-- | -- | -- | -- | -- | --
2024-08-07 16:31:29 | Report | Countdown | 6 Hours | device itself |  
2024-08-07 16:31:29 | Publish | Countdown | 6 Hours | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:30:22 | Report | Countdown | 3 Hours | device itself
2024-08-07 16:30:22 | Publish | Countdown | 3 Hours | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:31 | Report | Spray | ON | device itself |  
2024-08-07 16:22:31 | Publish | Spray | ON | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:30 | Report | Geur Diffuser | OFF | device itself |  
2024-08-07 16:22:30 | Report | Countdown | 1 Hour | device itself |  
2024-08-07 16:22:30 | Report | Spray | OFF | device itself |  
2024-08-07 16:22:29 | Publish | Spray | OFF | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:28 | Report | Mode | small | device itself |  
2024-08-07 16:22:28 | Publish | Mode | small | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:27 | Report | Countdown | Cancel | device itself |  
2024-08-07 16:22:26 | Publish | Countdown | Cancel | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:19 | Report | Mode | intermittent | device itself |  
-- | -- | -- | -- | -- | --
2024-08-07 16:22:19 | Publish | Mode | intermittent | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:19 | Report | Mode | large | device itself |  
2024-08-07 16:22:18 | Publish | Mode | large | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:17 | Report | Mode | small | device itself |  
2024-08-07 16:22:17 | Publish | Mode | small | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:14 | Report | Mode | intermittent | device itself |  
2024-08-07 16:22:13 | Publish | Mode | intermittent | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:11 | Report | Mode | large | device itself |  
2024-08-07 16:22:11 | Publish | Mode | large | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:22:06 | Report | Spray | ON | device itself |  
-- | -- | -- | -- | -- | --
2024-08-07 16:22:06 | Publish | Spray | ON | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 16:21:37 | Report | Geur Diffuser | ON | device itself |  
2024-08-07 16:21:36 | Publish | Geur Diffuser | ON | app client | appName:Smart Life,ios-packageName:com.tuya.smartlife,android-packageName:com.tuya.smartlife,model:iPhone,os_system:18.0,app_version:5.16.0. App uid: eu1651494398162kX5IY
2024-08-07 15:59:31 | Device semaphore | Device semaphore | signal intensity:-71\|\|Remaining memory:35800\|\|UTC:1723039171\|\|DST:1723042771 | device itself

Not sure if that would help.

eelco2k commented 3 months ago

Scherm­afbeelding 2024-08-07 om 16 33 02

eelco2k commented 3 months ago

Scherm­afbeelding 2024-08-07 om 16 34 27 Scherm­afbeelding 2024-08-07 om 16 34 36 Scherm­afbeelding 2024-08-07 om 16 34 42 Scherm­afbeelding 2024-08-07 om 16 34 47 Scherm­afbeelding 2024-08-07 om 16 34 58 Scherm­afbeelding 2024-08
![Scherm­afbeelding 2024-08-07 om 16 35 12](https://github.com/user-attachments/assets/4374afff-36ff-4f13-b6cb-8ae0a67b3159)
-07 om 16 35 03

eelco2k commented 3 months ago

i think when i change to DP instruction i get more info:


Code | Type | Values
-- | -- | --
switch_spray | Boolean | "{true,false}"
mode | Enum | {   "range": [     "large",     "middle",     "small"   ] }
countdown_set | Enum | {   "range": [     "1h",     "3h",     "6h",     "cancel"   ] }
switch_led | Boolean | "{true,false}"
work_mode | Enum | {   "range": [     "colour",     "colourful1"   ] }
colour_data | String | {   "maxlen": 255 }
fault | Bitmap | {   "label": [     "lack_water"   ],   "maxlen": 1 }
eelco2k commented 3 months ago

some value examples of colour_data:

colour_data ff000201676464 (red) ff8000001e6464 (yellow) fff30000396464 (green) 0dff0000746464 (dark green) 00ffc400a66464 (blue) 0056ff00db6464 (purple) ae00ff01186464 (pink/purple)

6464 looks a hex 2 Unicode --> 摤 or a d / dd first 6 characters RGB data and maybe the next 4 characters alpha channel / tint ...?

bobvandevijver commented 3 months ago

It doesn't have any fields in the specification, so that isn't a great sign. We will have to investigate whether we can do anything with this device type, so I am reopening this probably won't be added anytime soon.

eelco2k commented 3 months ago

In the cloud portal under debugging device I can send the commands successfully via the tuya cloud developer GUI.

eelco2k commented 3 months ago

Furthermore it looks like some devices just don’t send capabilities in json debug response. in my case I can still view them via tuya developer portal. As it looks like the same “json/data” structure as some other devices that do have the capabilities in their json debug response.

eelco2k commented 3 months ago

and to make it fully complete... in Chrome webdeveloper toolbar -> network -> requests when sending an "Device Debugging" DP Instruction:

with correct HTTP HEADERS etc. off course (Sign, Sign_method: HMAC-SHA256, Signversion: 2.0 etc. etc.) but i presume these are already handled by the login of the app.

https://openapi.tuyaeu.com/v1.0/devices/bf7580368edaafe873jixf/commands (OPTIONS) https://openapi.tuyaeu.com/v1.0/devices/bf7580368edaafe873jixf/commands (POST)

{
"commands":[
    {"code":"switch_spray","value":true},
    {"code":"mode","value":"middle"},
    {"code":"countdown_set","value":"1h"},
    {"code":"switch_led","value":true},
    {"code":"work_mode","value":"colour"}
]
}

i updated not all the settings, but just to give you an example...

bobvandevijver commented 3 months ago

@eelco2k Can you please try to add the device as other device once again and see what happens when you try to control it using the manual code cards? Should look something like this:

image

There are four of these cards, can you check until you find one that shows a list?

eelco2k commented 3 months ago

I tried all four: function not support ( Code 2003 ) (list stays empty)

Error code | Error message | Description | Solution 2003 | function not support | The function is not supported. | Based on the Request Parameters in the API documentation, set a valid instruction.

bobvandevijver commented 3 months ago

Thanks for the confirmation, we will have to look into this a bit more (and hopefully find a device samples that behaves equally). If we need more information we will let you know!