tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
879 stars 207 forks source link

New Device: Yinmik YK-S03 Pool Water Monitoring #942

Open rgb2017 opened 1 year ago

rgb2017 commented 1 year ago

Add New Device for Pool Water Monitoring

Device normal info

Device info (please complete the following information, which can be found in log):

{
  "active_time": 1690842043,
  "biz_type": 0,
  "category": "szjcy",
  "create_time": 1690842043,
  "icon": "smart/icon/bay164497620449560Pe/da2eba523a531957e6e80143882211d3.jpg",
  "id": "ebd902b46a15dd22c3uvrj",
  "ip": "***",
  "lat": "***",
  "local_key": "***",
  "lon": "***",
  "model": "YK-S03",
  "name": "YK-S03",
  "node_id": "e0798dfffeb818f6",
  "online": true,
  "owner_id": "163996618",
  "product_id": "d9mzkhoq",
  "product_name": "YK-S03",
  "status": [
    {
      "code": "tds_in",
      "value": 0
    },
    {
      "code": "temp_current",
      "value": 341
    },
    {
      "code": "battery_percentage",
      "value": 91
    },
    {
      "code": "ph",
      "value": 73
    },
    {
      "code": "conductivity_value",
      "value": 6060
    },
    {
      "code": "orp_value",
      "value": 143
    },
    {
      "code": "cl_value",
      "value": 0
    },
    {
      "code": "ph_buffer",
      "value": "EUStandard"
    },
    {
      "code": "backlight",
      "value": false
    },
    {
      "code": "backlight_value",
      "value": 1
    },
    {
      "code": "phmaxlimit",
      "value": 0
    },
    {
      "code": "phminlimit",
      "value": 0
    },
    {
      "code": "ecmaxlimit",
      "value": 20000
    },
    {
      "code": "ecminlimit",
      "value": 0
    },
    {
      "code": "orpmaxlimit",
      "value": 999
    },
    {
      "code": "orpminlimit",
      "value": 0
    },
    {
      "code": "clmaxlimit",
      "value": 40
    },
    {
      "code": "clminlimit",
      "value": 0
    },
    {
      "code": "phcal",
      "value": 170
    },
    {
      "code": "eccal",
      "value": 170
    },
    {
      "code": "orpcal",
      "value": 170
    },
    {
      "code": "salttds_value",
      "value": 3060
    }
  ],
  "sub": true,
  "time_zone": "-07:00",
  "uid": "***",
  "update_time": 1690848375,
  "uuid": "e0798dfffeb818f6"
},

Device specifications (please complete the following information, which can be found in log):

2023-07-31 21:41:15.154 DEBUG (SyncWorker_7) [tuya_iot] Request: method = GET, url = https://openapi.tuyaus.com/v1.0/devices/ebd902b46a15dd22c3uvrj/specifications, params = None, body = None, t = 1690864875154 2023-07-31 21:41:15.193 DEBUG (Thread-15 (_thread_main)) [tuya_iot] _on_log: Received CONNACK (0, 0) 2023-07-31 21:41:15.194 DEBUG (Thread-15 (_thread_main)) [tuya_iot] connect flags->{'session present': 0}, rc->0 2023-07-31 21:41:15.195 DEBUG (Thread-15 (_thread_main)) [tuya_iot] _on_log: Sending SUBSCRIBE (d0, m1) [(b'cloud/token/in/6d638592b4f8fb0d288f27183ab89096', 0)] 2023-07-31 21:41:15.242 DEBUG (SyncWorker_7) [tuya_iot] Response: { "result": { "category": "szjcy", "functions": [ { "code": "ph_buffer", "type": "Enum", "values": "{\"range\":[\"AsiaStandard\",\"EUStandard\"]}" }, { "code": "backlight", "type": "Boolean", "values": "{}" }, { "code": "backlight_value", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":16777216,\"scale\":0,\"step\":1}" }, { "code": "phmaxlimit", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":140,\"scale\":1,\"step\":1}" }, { "code": "phminlimit", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":140,\"scale\":1,\"step\":1}" }, { "code": "ecmaxlimit", "type": "Integer", "values": "{\"unit\":\"uS/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "ecminlimit", "type": "Integer", "values": "{\"unit\":\"uS/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "orpmaxlimit", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "orpminlimit", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "clmaxlimit", "type": "Integer", "values": "{\"unit\":\"mg/L\",\"min\":0,\"max\":40,\"scale\":1,\"step\":1}" }, { "code": "clminlimit", "type": "Integer", "values": "{\"unit\":\"mg/L\",\"min\":0,\"max\":40,\"scale\":1,\"step\":1}" }, { "code": "phcal", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":1400,\"scale\":2,\"step\":1}" }, { "code": "eccal", "type": "Integer", "values": "{\"unit\":\"us/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "orpcal", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" } ], "status": [ { "code": "tds_in", "type": "Integer", "values": "{\"unit\":\"ppm\",\"min\":0,\"max\":10000,\"scale\":0,\"step\":1}" }, { "code": "temp_current", "type": "Integer", "values": "{\"unit\":\"℃\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}" }, { "code": "battery_percentage", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "ph", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":140,\"scale\":1,\"step\":1}" }, { "code": "conductivity_value", "type": "Integer", "values": "{\"unit\":\"uS/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "orp_value", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "cl_value", "type": "Integer", "values": "{\"unit\":\"mg/L\",\"min\":-1,\"max\":40,\"scale\":1,\"step\":1}" }, { "code": "ph_buffer", "type": "Enum", "values": "{\"range\":[\"AsiaStandard\",\"EUStandard\"]}" }, { "code": "backlight", "type": "Boolean", "values": "{}" }, { "code": "backlight_value", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":16777216,\"scale\":0,\"step\":1}" }, { "code": "phmaxlimit", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":140,\"scale\":1,\"step\":1}" }, { "code": "phminlimit", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":140,\"scale\":1,\"step\":1}" }, { "code": "ecmaxlimit", "type": "Integer", "values": "{\"unit\":\"uS/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "ecminlimit", "type": "Integer", "values": "{\"unit\":\"uS/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "orpmaxlimit", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "orpminlimit", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "clmaxlimit", "type": "Integer", "values": "{\"unit\":\"mg/L\",\"min\":0,\"max\":40,\"scale\":1,\"step\":1}" }, { "code": "clminlimit", "type": "Integer", "values": "{\"unit\":\"mg/L\",\"min\":0,\"max\":40,\"scale\":1,\"step\":1}" }, { "code": "phcal", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":1400,\"scale\":2,\"step\":1}" }, { "code": "eccal", "type": "Integer", "values": "{\"unit\":\"us/cm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" }, { "code": "orpcal", "type": "Integer", "values": "{\"unit\":\"mV\",\"min\":-1200,\"max\":1200,\"scale\":0,\"step\":1}" }, { "code": "salttds_value", "type": "Integer", "values": "{\"unit\":\"ppm\",\"min\":0,\"max\":20000,\"scale\":0,\"step\":1}" } ] }, "success": true, "t": 1690864874387, "tid": "a5809ecd302511ee8c70fe98ebe72f12" }

peskyAdmin commented 6 months ago
cryogenx commented 5 months ago

just got one of there would love to have it in HA

sikysikov commented 5 months ago

You can do that using Local Tuya...

cryogenx commented 5 months ago

You can do that using Local Tuya...

Could you elaborate? I tried Tuya Local and while it did recognize it i couldn't get it to bring it in to HA

sikysikov commented 5 months ago

See solution here: https://community.home-assistant.io/t/pool-monitoring-device-yieryi-ble-yl01-zigbee-ph-orp-free-chlorine-salinity-etc/659545/18?u=sikita

lauer commented 5 months ago

I have added it with the same config as the BLE-YL01, and it works OK. However, it seems the Salinity and TDL is the same value.

Also, I don't know if it really on purpose, but it set to only fetch value every 10min. I guess that is also fine for a battery devise. But it seems in the logs, that it sending the same values multiple times within same secounds.