tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

Request support for Yieryi YY-W9909 pH meter

Open dhuddle opened this issue 3 years ago • 21 comments

Log Message

This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:45
Integration: Tuya Local (documentation, issues)
First occurred: 11:54:51 AM (2 occurrences)
Last logged: 11:54:51 AM

Device matches None with quality of 0%. DPS: {"updated_at": 1679252090.9036033, "8": 250, "102": 1500, "107": 2, "110": 4, "113": 2, "116": 998, "119": 0}
Report this to https://github.com/make-all/tuya-local/issues/

Information about DPS mappings

{
  "result": {
    "category": "dgnbj",
    "functions": [],
    "status": [
      {
        "code": "temp_current",
        "dp_id": 8,
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-100,\"max\":1100,\"scale\":1,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1679249987145,
  "tid": "a12fd7dfc68211edb979b682f9637fbb"
}

From Debug output:

Current Temperature: 8
CF: 136
CF高报警值: 137
CF底报警值: 138
湿度值: 139
湿度高报警值: 140
湿度低报警值: 141
传感器列表: 101
pH value: 102
Warning pH value higher than set: 103
Warning pH value lower than set: 104
High temperature alarm value: 105
Low temperature alarm value: 106
TDS value: 107
Warning TDS value higher than set: 108
Warning TDS value lower than set: 109
EC value: 110
EC high alarm value: 111
EC low alarm value: 112
Salinity value: 113
High salinty alarm value: 114
Low salinity alarm value: 115
Proportion value: 116
Proportion high alarm value: 117
Proportion low alarm value: 118
ORP value: 119
ORP高报警值: 120
ORP低报警值: 121

Product ID

Product ID: 5ok0wq7drlqyo2hb Name: YY-9909 Model: YY-9909

Information about how the device functions

Product link: here

This is a multifunction PH meter. It measure PH, electrical conductivity, total dissolved solids, salt, SG, temp used commonly for aquariums, swimming pools, and hydroponics. It has alarm function, as well as calibration. I cannot find the manual online atm, but I have an English one in hand and can scan if needed.

Thank you!

dhuddle avatar Mar 19 '23 18:03 dhuddle

I might need some ranges for any values that need to be set, and scales if any of the values are scaled (besides the temperature which is documented).

make-all avatar Mar 20 '23 00:03 make-all

For example, ph value: dp 102, value is 1500. Its quite a few years since my high school chemistry classes, but I think the range for pH is 0-14? So is that 1.500? Or maybe the scale factor is 200, and it is 7.5?

make-all avatar Mar 20 '23 00:03 make-all

Ph value of 15 seems to be reported when the probe is not connected. But it should be 0-14. I do not hae the probe connected currently, and I get 15.

I found this elsewhere on github with more info on the values of min/max for the device:


"data": {
"endpoint": "https://openapi.tuyaus.com",
"auth_type": 0,
"country_code": "1",
"app_type": "tuyaSmart",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"devices": [
{
"model": "YY-9909",
"category": "dgnbj",
"product_id": "5ok0wq7drlqyo2hb",
"product_name": "YY-9909",
"online": true,
"sub": false,
"function": {
"ph_warn_max": {
"type": "Integer",
"value": {
"unit": "",
"min": 0,
"max": 1500,
"scale": 2,
"step": 1
}
},
"ph_warn_min": {
"type": "Integer",
"value": {
"unit": "",
"min": 0,
"max": 1500,
"scale": 2,
"step": 1
}
},
"temp_warn_max": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": -100,
"max": 1100,
"scale": 1,
"step": 1
}
},
"temp_warn_min": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": -100,
"max": 1100,
"scale": 1,
"step": 1
}
},
"tds_warn_max": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"tds_warn_min": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"ec_warn_max": {
"type": "Integer",
"value": {
"unit": "us",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"ec_warn_min": {
"type": "Integer",
"value": {
"unit": "us",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"salinity_warn_max": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"salinity_warn_min": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"pro_warn_max": {
"type": "Integer",
"value": {
"unit": "S.G",
"min": 500,
"max": 2000,
"scale": 3,
"step": 1
}
},
"pro_warn_min": {
"type": "Integer",
"value": {
"unit": "S.G",
"min": 500,
"max": 2000,
"scale": 3,
"step": 1
}
},
"orp_warn_max": {
"type": "Integer",
"value": {
"unit": "mV",
"min": -2000,
"max": 2000,
"scale": 0,
"step": 1
}
},
"orp_warn_min": {
"type": "Integer",
"value": {
"unit": "mV",
"min": -2000,
"max": 2000,
"scale": 0,
"step": 1
}
},
"cf_warn_max": {
"type": "Integer",
"value": {
"unit": "CF",
"min": 0,
"max": 199999,
"scale": 2,
"step": 1
}
},
"cf_warn_min": {
"type": "Integer",
"value": {
"unit": "CF",
"min": 1,
"max": 199999,
"scale": 2,
"step": 1
}
},
"rh_warn_max": {
"type": "Integer",
"value": {
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
},
"rh_warn_min": {
"type": "Integer",
"value": {
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
}
},
"status_range": {
"temp_current": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": -100,
"max": 1100,
"scale": 1,
"step": 1
}
},
"sensor_list": {
"type": "Raw",
"value": {}
},
"ph_current": {
"type": "Integer",
"value": {
"unit": "",
"min": 0,
"max": 1500,
"scale": 2,
"step": 1
}
},
"ph_warn_max": {
"type": "Integer",
"value": {
"unit": "",
"min": 0,
"max": 1500,
"scale": 2,
"step": 1
}
},
"ph_warn_min": {
"type": "Integer",
"value": {
"unit": "",
"min": 0,
"max": 1500,
"scale": 2,
"step": 1
}
},
"temp_warn_max": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": -100,
"max": 1100,
"scale": 1,
"step": 1
}
},
"temp_warn_min": {
"type": "Integer",
"value": {
"unit": "\u2103",
"min": -100,
"max": 1100,
"scale": 1,
"step": 1
}
},
"tds_current": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"tds_warn_max": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"tds_warn_min": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"ec_current": {
"type": "Integer",
"value": {
"unit": "us",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"ec_warn_max": {
"type": "Integer",
"value": {
"unit": "us",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"ec_warn_min": {
"type": "Integer",
"value": {
"unit": "us",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"salinity_current": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"salinity_warn_max": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"salinity_warn_min": {
"type": "Integer",
"value": {
"unit": "ppm",
"min": 0,
"max": 199999,
"scale": 0,
"step": 1
}
},
"pro_current": {
"type": "Integer",
"value": {
"unit": "S.G",
"min": 500,
"max": 2000,
"scale": 3,
"step": 1
}
},
"pro_warn_max": {
"type": "Integer",
"value": {
"unit": "S.G",
"min": 500,
"max": 2000,
"scale": 3,
"step": 1
}
},
"pro_warn_min": {
"type": "Integer",
"value": {
"unit": "S.G",
"min": 500,
"max": 2000,
"scale": 3,
"step": 1
}
},
"orp_current": {
"type": "Integer",
"value": {
"unit": "mV",
"min": -2000,
"max": 2000,
"scale": 0,
"step": 1
}
},
"orp_warn_max": {
"type": "Integer",
"value": {
"unit": "mV",
"min": -2000,
"max": 2000,
"scale": 0,
"step": 1
}
},
"orp_warn_min": {
"type": "Integer",
"value": {
"unit": "mV",
"min": -2000,
"max": 2000,
"scale": 0,
"step": 1
}
},
"cf_current": {
"type": "Integer",
"value": {
"unit": "CF",
"min": 0,
"max": 199999,
"scale": 2,
"step": 1
}
},
"cf_warn_max": {
"type": "Integer",
"value": {
"unit": "CF",
"min": 0,
"max": 199999,
"scale": 2,
"step": 1
}
},
"cf_warn_min": {
"type": "Integer",
"value": {
"unit": "CF",
"min": 1,
"max": 199999,
"scale": 2,
"step": 1
}
},
"rh_current": {
"type": "Integer",
"value": {
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
},
"rh_warn_max": {
"type": "Integer",
"value": {
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
},
"rh_warn_min": {
"type": "Integer",
"value": {
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}
}
},
"status": {
"temp_current": 240,
"sensor_list": "AQEBAQEBAA==",
"ph_current": 864,
"ph_warn_max": 0,
"ph_warn_min": 0,
"temp_warn_max": 315,
"temp_warn_min": -100,
"tds_current": 266,
"tds_warn_max": 0,
"tds_warn_min": 0,
"ec_current": 532,
"ec_warn_max": 0,
"ec_warn_min": 0,
"salinity_current": 310,
"salinity_warn_max": 0,
"salinity_warn_min": 0,
"pro_current": 984,
"pro_warn_max": 500,
"pro_warn_min": 500,
"orp_current": 0,
"orp_warn_max": -2000,
"orp_warn_min": -2000
}

dhuddle avatar Mar 20 '23 01:03 dhuddle

#562 appears to be almost the same, but missing dp 107.

Current Temperature: 8 pH value: 102 EC value: 110 Salinity value: 113 Proportion value: 116 ORP value: 119

make-all avatar Mar 22 '23 09:03 make-all

My fault, 107 is TDS too on my device, missed that between the whole chinese characters ;-)

Cyrelion avatar Mar 22 '23 10:03 Cyrelion

So far, so good: image This was properly auto detected!

image

update: image

I hooked up both external temp probe and the ph meter (I'm guessing the prior temp reading was internal?) and the data looks viable.

For the record, this is updating every 15 seconds.

Thank you again - I think you can take this as "confirmed". This is very exciting - a ~$60 local home assistant integrated pH/temp/ec etc meter is unprecedented.

dhuddle avatar Mar 26 '23 02:03 dhuddle

Switched to main to test and worked great. Thanks a lot!

Cyrelion avatar Mar 26 '23 10:03 Cyrelion

Do you know when you will release this? I’ve updated and now it’s not working anymore (yeah it’s unreleased I know).

Cyrelion avatar Apr 01 '23 15:04 Cyrelion

I'm waiting for a release too, i have a PH/ORP who seems to be a clone of YY-w9909 (w2839)

psailleko avatar Apr 02 '23 17:04 psailleko

I just bought the YY-w9909. How to integrate it into HA? THANKS

Tony0727 avatar Apr 08 '23 20:04 Tony0727

Here's the basic process:

  1. add the device to your Tuya account via the Smart Life app.
  2. install this integration (read the documentation)
  3. get a Tuya IOT developer account and get the device ID and local key (here's a video
  4. add your device via this integration with those 2 pieces of info

dhuddle avatar Apr 08 '23 21:04 dhuddle

Thank you, the integration is done but I only have the temperature and not the rest. should I do anything else afterwards?

Tony0727 avatar Apr 09 '23 08:04 Tony0727

  "model": "YY-9909",
  "device_id": "*************",
  "dps_strings": [
    "8 (value: 196)",
    "102 (value: 826)",
    "107 (value: 4610)",
    "110 (value: 9220)",
    "113 (value: 5380)",
    "116 (value: 1004)",
    "119 (value: 0)"

Tony0727 avatar Apr 09 '23 09:04 Tony0727

01

Tony0727 avatar Apr 09 '23 09:04 Tony0727

Do you have an idea for the other measurements?

Tony0727 avatar Apr 09 '23 09:04 Tony0727

It is all there, I have a test program that detects the config file and outputs the entities based on log info, and based on your "dps_strings" above, it gives the following:

yieryi_ph_meter matched 100%
  sensor_ph:
   sensor: 8.26
  sensor_temperature:
    sensor: 19.6
  sensor_total_disolved_solids:
    sensor: 4610
  sensor_electrical_conductivity:
    sensor: 9220
  sensor_salinity:
    sensor: 5380
  sensor_specific_gravity:
    sensor: 1.004
  sensor_oxidation_reduction_potential:
    sensor: 0

On Sun, 9 Apr 2023 at 18:09, Tony0727 @.***> wrote:

Do you have an idea for the other measurements?

— Reply to this email directly, view it on GitHub https://github.com/make-all/tuya-local/issues/555#issuecomment-1501082128, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJNY67MFPWYXY3PJ7BYUALXAJ4ERANCNFSM6AAAAAAWAIYCTU . You are receiving this because you modified the open/close state.Message ID: @.***>

make-all avatar Apr 09 '23 13:04 make-all

Thank you, I succeeded the integration.but I do not have the values ​​X10 or X100. ,it's normal?

Tony0727 avatar Apr 09 '23 21:04 Tony0727

image

Tony0727 avatar Apr 09 '23 21:04 Tony0727

i have the same problem

can get current props values with tuya endponit /v2.0/cloud/thing/$device/shadow/properties but have problem with gettinng logs with endpoint /v2.0/cloud/thing/$device/report-logs

Specifitation v1.0/iot-03/devices/$device/specification include only temperature information^

{
  "result": {
    "category": "dgnbj",
    "status": [
      {
        "code": "temp_current",
        "name": "当前温度",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-100,\"max\":1100,\"scale\":1,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1698586018969,
  "tid": "d6489c01765e11ee8665fe445e07f2df"
}

politsin avatar Oct 29 '23 13:10 politsin

2023-10-29_16-29-12 Can see all data at iot.tuya.com/cloud/device/detail and filter only EC value, but cant't do it with api

{
  "result": {
    "properties": [
      {
        "code": "temp_current",
        "custom_name": "",
        "dp_id": 8,
        "time": 1698586314907,
        "value": 188
      },
      {
        "code": "sensor_list",
        "custom_name": "",
        "dp_id": 101,
        "time": 1698586314803,
        "value": "AQEBAQEBAA=="
      },
      {
        "code": "ph_current",
        "custom_name": "",
        "dp_id": 102,
        "time": 1698586314935,
        "value": 907
      },
      {
        "code": "ph_warn_max",
        "custom_name": "",
        "dp_id": 103,
        "time": 1678613718900,
        "value": 1052
      },
      {
        "code": "ph_warn_min",
        "custom_name": "",
        "dp_id": 104,
        "time": 1678613718900,
        "value": 558
      },
      {
        "code": "temp_warn_max",
        "custom_name": "",
        "dp_id": 105,
        "time": 1678613718900,
        "value": 322
      },
      {
        "code": "temp_warn_min",
        "custom_name": "",
        "dp_id": 106,
        "time": 1678613718900,
        "value": -100
      },
      {
        "code": "tds_current",
        "custom_name": "",
        "dp_id": 107,
        "time": 1698586314938,
        "value": 1992
      },
      {
        "code": "tds_warn_max",
        "custom_name": "",
        "dp_id": 108,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "tds_warn_min",
        "custom_name": "",
        "dp_id": 109,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "ec_current",
        "custom_name": "",
        "dp_id": 110,
        "time": 1698586314951,
        "value": 3984
      },
      {
        "code": "ec_warn_max",
        "custom_name": "",
        "dp_id": 111,
        "time": 1678613718900,
        "value": 3807
      },
      {
        "code": "ec_warn_min",
        "custom_name": "",
        "dp_id": 112,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "salinity_current",
        "custom_name": "",
        "dp_id": 113,
        "time": 1698586314978,
        "value": 2324
      },
      {
        "code": "salinity_warn_max",
        "custom_name": "",
        "dp_id": 114,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "salinity_warn_min",
        "custom_name": "",
        "dp_id": 115,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "pro_current",
        "custom_name": "",
        "dp_id": 116,
        "time": 1698586314980,
        "value": 1001
      },
      {
        "code": "pro_warn_max",
        "custom_name": "",
        "dp_id": 117,
        "time": 1678613718900,
        "value": 500
      },
      {
        "code": "pro_warn_min",
        "custom_name": "",
        "dp_id": 118,
        "time": 1678613718900,
        "value": 500
      },
      {
        "code": "orp_current",
        "custom_name": "",
        "dp_id": 119,
        "time": 1698586315009,
        "value": 0
      },
      {
        "code": "orp_warn_max",
        "custom_name": "",
        "dp_id": 120,
        "time": 1678613718900,
        "value": -2000
      },
      {
        "code": "orp_warn_min",
        "custom_name": "",
        "dp_id": 121,
        "time": 1678613718900,
        "value": -2000
      },
      {
        "code": "cf_current",
        "custom_name": "",
        "dp_id": 136,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "cf_warn_max",
        "custom_name": "",
        "dp_id": 137,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "cf_warn_min",
        "custom_name": "",
        "dp_id": 138,
        "time": 1678613718900,
        "value": 1
      },
      {
        "code": "rh_current",
        "custom_name": "",
        "dp_id": 139,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "rh_warn_max",
        "custom_name": "",
        "dp_id": 140,
        "time": 1678613718900,
        "value": 0
      },
      {
        "code": "rh_warn_min",
        "custom_name": "",
        "dp_id": 141,
        "time": 1678613718900,
        "value": 0
      }
    ]
  },
  "success": true,
  "t": 1698586324432,
  "tid": "8c5ba7e6765f11ee9e03520921e69726"
}

politsin avatar Oct 29 '23 13:10 politsin