Closed sirinveen closed 11 months ago
Here the complete DDF I receive value but for chlorine I'm not sure ist correct:
ONLY WORK WITH THE LAST BETA VERSION OF deCONZ 2.23.0-beta
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE200_v1jqz5cy",
"modelid": "TS0601",
"vendor": "Tuya",
"product": "Zigbee Chlorine Meter PH ORP EC TDS Salinity Temp CL",
"sleeper": false,
"status": "Gold",
"path": "/devices/_TZE200_TS0601_v1jqz5cy_v7.json",
"subdevices": [
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0514"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86394,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 2,
"eval": "Item.val = (10 * Attr.val);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_PH_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0512"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "pH"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 10,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_CHLORINE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x041a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"default": 0
},
{
"name": "cap/measured_value/min",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mg/L"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"parse": {
"dpid": 102,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_ORP_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mV"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"parse": {
"dpid": 101,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_EC_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x043a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "μS/cm"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"parse": {
"dpid": 11,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_TDS_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042B"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 1,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_SALT_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x040D"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 117,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
}
]
}
Hi @manup
Result of Chlorine = 6721026 (raw number) normally CL must be a range of 0.0 - 4.0 mg/L
Expression in DDF: Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);
And used with a subdivides chlorine_sensor.json not sure if it's used?!?
Tag "cap/measured_value/dimension" don't exist with the last version 2.23.0-beta
{
"schema": "subdevice1.schema.json",
"type": "$TYPE_CHLORINE_SENSOR",
"name": "ZHAChlorine",
"restapi": "/sensors",
"order": 20,
"uuid": ["$address.ext", "0x01", "0x041A"],
"items": [
"config/on",
"config/reachable",
"state/measured_value",
"cap/measured_value/min",
"cap/measured_value/max",
"cap/measured_value/unit",
"cap/measured_value/dimension",
"state/lastupdated"
]
}
API deCONZ result:
{
"config": {
"battery": 100,
"on": true,
"reachable": true
},
"etag": "64fd79b6ef86579b29dce3fc7198041a",
"lastannounced": null,
"lastseen": "2023-09-08T15:18Z",
"manufacturername": "_TZE200_v1jqz5cy",
"modelid": "TS0601",
"name": "Thermostat",
"state": {
"lastupdated": "2023-09-08T15:16:53.173",
"measured_value": 6721026
},
"swversion": "1.0.1",
"type": "$TYPE_CHLORINE_SENSOR",
"uniqueid": "e0:79:8d:ff:fe:b8:b8:ef-01-041a"
}
Whoa, congratulations, huge and complete integration.
Don't forget to add the new json file.
All of thoses sensors are usefull ? on my side I don't see what is ec, orp and tds ...
"type": "$TYPE_CHLORINE_SENSOR",
This is not normal, with the json file in devices\generic\subdevices\, you need to have "ZHAChlorine" instead
Expression in DDF: Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);
This is a workaround because deconz is not able to manage raw value, or display them in debug, it's possible the value is coded on 4 bytes and not 3, so can try with
Item.val = (ZclFrame.at(4) << 64) | (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);
If you enable debug flag ZCL, we will be able to see the complete zigbee raw request, and I can decryt it if needed.
Hi @Smanar
"All of thoses sensors are usefull ? on my side I don't see what is ec, orp and tds ..."
Depends your swimming pool. SALT is only useful if your swimming pool use saltwater.
Here a description of the different Sensor:
EC: Electrical Conductivity https://www.aquaread.com/sensors/ec#:~:text=EC%20or%20Electrical%20Conductivity%20of,on%20the%20concentration%20of%20ions. ORP: Oxidation-reduction potential https://atlas-scientific.com/blog/orp-measurement-for-chlorine/ TDS: Total Dissolved Solids https://poolresearch.com/total-dissolved-solids/#:~:text=The%20ideal%20TDS%20level%20for,against%20lowering%20the%20TDS%20level.
""type": "$TYPE_CHLORINE_SENSOR", This is not normal, with the json file in devices\generic\subdevices, you need to have "ZHAChlorine" instead"
I resolve this issue I also must include all new subdevices into constants.json "/usr/share/deCONZ/devices/generic" Now is correct!
{
"schema": "constants1.schema.json",
"manufacturers" : {
"$MF_BOSCH": "Bosch",
"$MF_IKEA": "IKEA of Sweden",
"$MF_LUMI": "LUMI",
"$MF_LUTRON": "Lutron",
"$MF_PHILIPS": "Philips",
"$MF_SAMJIN": "Samjin",
"$MF_SIGNIFY": "Signify Netherlands B.V.",
"$MF_TUYA": "Tuyatec",
"$MF_XIAOMI": "XIAOMI"
},
"device-types": {
"$TYPE_AIR_PURIFIER": "ZHAAirPurifier",
"$TYPE_AIR_QUALITY_SENSOR": "ZHAAirQuality",
"$TYPE_CARBONDIOXIDE_SENSOR": "ZHACarbonDioxide",
"$TYPE_CHLORINE_SENSOR": "ZHAChlorine",
"$TYPE_EC_SENSOR": "ZHAEc",
"$TYPE_FORMALDEHYDE_SENSOR": "ZHAFormaldehyde",
"$TYPE_PARTICULATEMATTER_SENSOR": "ZHAParticulateMatter",
"$TYPE_ALARM_SENSOR": "ZHAAlarm",
"$TYPE_BATTERY_SENSOR": "ZHABattery",
"$TYPE_COLOR_DIMMABLE_LIGHT": "Color dimmable light",
"$TYPE_COLOR_LIGHT": "Color light",
"$TYPE_COLOR_TEMPERATURE_LIGHT": "Color temperature light",
"$TYPE_CONSUMPTION_SENSOR": "ZHAConsumption",
"$TYPE_DIMMABLE_LIGHT": "Dimmable light",
"$TYPE_DIMMABLE_PLUGIN_UNIT": "Dimmable plug-in unit",
"$TYPE_DIMMER_SWITCH": "Dimmer switch",
"$TYPE_DOOR_LOCK_CONTROLLER": "Door lock controller",
"$TYPE_DOOR_LOCK": "Door Lock",
"$TYPE_EXTENDED_COLOR_LIGHT": "Extended color light",
"$TYPE_FIRE_SENSOR": "ZHAFire",
"$TYPE_HUMIDITY_SENSOR": "ZHAHumidity",
"$TYPE_LIGHT_LEVEL_SENSOR": "ZHALightLevel",
"$TYPE_MOISTURE_SENSOR": "ZHAMoisture",
"$TYPE_ON_OFF_LIGHT": "On/Off light",
"$TYPE_ON_OFF_LIGHT_SWITCH": "On/Off light switch",
"$TYPE_ON_OFF_OUTPUT": "On/Off output",
"$TYPE_ON_OFF_PLUGIN_UNIT": "On/Off plug-in unit",
"$TYPE_ON_OFF_SWITCH": "On/Off switch",
"$TYPE_OPEN_CLOSE_SENSOR": "ZHAOpenClose",
"$TYPE_ORP_SENSOR": "ZHAOrp",
"$TYPE_PH_SENSOR": "ZHAPh",
"$TYPE_POWER_SENSOR": "ZHAPower",
"$TYPE_PRESENCE_SENSOR": "ZHAPresence",
"$TYPE_PRESSURE_SENSOR": "ZHAPressure",
"$TYPE_RANGE_EXTENDER": "Range extender",
"$TYPE_RELATIVE_ROTARY": "ZHARelativeRotary",
"$TYPE_SALT_SENSOR": "ZHASalt",
"$TYPE_SMART_PLUG": "Smart plug",
"$TYPE_SPECTRAL_SENSOR": "ZHASpectral",
"$TYPE_SWITCH": "ZHASwitch",
"$TYPE_TDS_SENSOR": "ZHATds",
"$TYPE_TEMPERATURE_SENSOR": "ZHATemperature",
"$TYPE_THERMOSTAT": "ZHAThermostat",
"$TYPE_VIBRATION_SENSOR": "ZHAVibration",
"$TYPE_WARNING_DEVICE": "Warning device",
"$TYPE_WATER_LEAK_SENSOR": "ZHAWater",
"$TYPE_WINDOW_COVERING_DEVICE": "Window covering device",
"$TYPE_ZGP_SWITCH": "ZGPSwitch"
}
}
I will check later about value with the FLAG ZCL or I must use a formula from the raw number (6688770) to find the Chlorine CL who have this range 0.0-4.0 mg/L ?!?
A other question how would be possible to calibrate this tools? With this?
Whaou ! Nice try ! ;-) Just take care of the number of
"read": {
"fn": "tuya"
},
The read
for tuya
function is special and must only be specified on one item . It doesn't actually read a single value but triggers the Tuya device to report all datapoints (https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-support-Tuya-manufacturer-specific-cluster-&-How-to-know-which-datapoints-a-Tuya-device-provides%3F)
A other question how would be possible to calibrate this tools? With this?
May be, or by adding a new /config/calibration item for sensors that have this function available and a write function (may not so easy if value is raw). Seems that there are two PH calibration for this device ?!
103: pH Calibration 114: PH Calibration 115: EC Calibration 116: ORP Calibration
A other question how would be possible to calibrate this tools? With this?
May be, or by adding a new /config/calibration item for sensors that have this function available and a write function (may not so easy if value is raw). Seems that there are two PH calibration for this device ?!
103: pH Calibration 114: PH Calibration 115: EC Calibration 116: ORP Calibration
Here the list of the Datapoint (Updated)
1: TDS 2: Temperature 101: ORP 102: Chlorine 7: Battery Percentage 103: pH Calibration 104: Backlight 105: Backlight Value 10: pH Value 11: EC Value 106: pH Max Value 107: pH Min Value 108: EC Max Value 109: EC Min Value 110: ORP Max Value 111: ORP Min Value 112: Chlorine Max Value 113: Chlorine Min Value 114: PH Calibration 115: EC Calibration 116: ORP Calibration 117: Salt
For PH there is finally 3 datapoints one with 10 (only Read) and the other with 103 (EU Calibration) and 114 (Asia Calibration). I will receive soon Calibration Solution I will test it. For PH I think would not so difficult the number are easy to read (See Example 760 = 7.6). For ORP and EC for the moment I don't know how to convert the raw number in ORP (-999 +999)mV and EC 0-2000μS/cm
PH Example:
ORP Example:
Whaou ! Nice try ! ;-) Just take care of the number of
"read": { "fn": "tuya" },
The
read
fortuya
function is special and must only be specified on one item . It doesn't actually read a single value but triggers the Tuya device to report all datapoints (https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-support-Tuya-manufacturer-specific-cluster-&-How-to-know-which-datapoints-a-Tuya-device-provides%3F)
I will make a new DDF to clean that.
Here the list of the Datapoint
I think you have to refer here for the DP list : https://github.com/zigpy/zha-device-handlers/issues/2565#issuecomment-1713762553
Tag "cap/measured_value/dimension" don't exist with the last version 2.23.0-beta
Has been changed to cap/measured_value/substance
For ORP and EC for the moment I don't know how to convert the raw number in ORP (-999 +999)mV and EC 0-2000μS/cm
Seems that there could be 3 potential ranges for EC
I resolve this issue I also must include all new subdevices into constants.json "/usr/share/deCONZ/devices/generic"
Ha ? oups, good to know, for me this file was optionnal.
Lol, I like the new sensors
EC: Electrical Conductivity
: if you want to kill someone with electricity in the swiming pool
TDS: Total Dissolved Solids
it's an acid wimming pool to dissolve the corpse after ?
(I don't have swimming pool, but from my memory we were checking only ph on my old one) It's a professional product ?
Seriously you have information about the device working mode ?
- how are working min/max ? it's to trigger an alarm ?
Yes it is … I think it’s used from into Tuya App but can be easily made by home automation software
But how ? I don't see a "DP alarm", and it's managed by the device, else why it have DP for them ? can set them direclty on the app.
But how ? I don't see a "DP alarm", and it's managed by the device, else why it have DP for them ? can set them direclty on the app.
You're rigth ! But it's described that way
Or the values that are given into calibration automaticaly change the range of min/max ? EC can have 3 ranges for instance.
(I don't have swimming pool, but from my memory we were checking only ph on my old one) It's a professional product ?
It can also be used for spa/jacuzzi/hotub that are more "unstable" environnements than swimming pool and you have to check for more parameters. Can also be used for big fish tanks.
i'm happy that this kind of product is on the "mass" market ... Hope it is reliable then I'll certainly buy one for my cottage's Spa, avoiding a 160 km travel each week.
Here a new version of DDF without repeating function read for Tuya:
Please check @BabaIsYou if it's correct?
I also try with a other version config/offset with DP 103 and DP 114 but receive 0 like value.
{
"name": "config/offset",
"parse": {
"dpid": 114,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
New DDF:
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE200_v1jqz5cy",
"modelid": "TS0601",
"vendor": "Tuya",
"product": "Zigbee Chlorine Meter PH ORP EC TDS Salinity Temp CL",
"sleeper": false,
"status": "Gold",
"path": "/devices/_TZE200_TS0601_v1jqz5cy_v10.json",
"subdevices": [
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0514"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86394,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 2,
"eval": "Item.val = (10 * Attr.val);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_PH_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0512"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "pH"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 10,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_CHLORINE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x041a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"default": 0
},
{
"name": "cap/measured_value/min",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mg/L"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 102,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_ORP_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mV"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 101,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_EC_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x043a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "μS/cm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 11,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_TDS_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042B"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 1,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_SALT_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x040D"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 86400,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 0,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 255,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"parse": {
"dpid": 117,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
}
]
}
I will try later other test but now swimming!
If it's just an offset, you don't need to use dp, can just use something like
{
"name": "config/offset",
"default": 0
},
and
{
"name": "state/measured_value",
"parse": {
"dpid": 1,
"eval": "Item.val = Attr.val + R.item('config/offset').val;",
"fn": "tuya"
},
"default": 0
}
the offset will be managed by deconz direclty.
IMO, if I understand correctly the wiki, only one read for tuya fn is needed for the whole device. Then it's better to choose the one with the lowest refresh.interval (temperature for instance that is the more "volatile" parameter in this list) to populate all the other items at this interval. All others have to be in the form
"read": {"fn": "none"},
"parse": {
"dpid": xxx,
"eval": "Item.val = yyy);",
"fn": "tuya"
},
"read": {"fn": "none"},
New version:
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZE200_v1jqz5cy",
"modelid": "TS0601",
"vendor": "Tuya",
"product": "Zigbee Chlorine Meter PH ORP EC TDS Salinity Temp CL",
"sleeper": false,
"status": "Gold",
"path": "/devices/_TZE200_TS0601_v1jqz5cy_v12.json",
"subdevices": [
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0514"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"read": {
"fn": "none"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"refresh.interval": 3600,
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 2,
"eval": "Item.val = (10 * Attr.val);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_PH_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0512"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "pH"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 10,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_CHLORINE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x041a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"default": 0
},
{
"name": "cap/measured_value/min",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mg/L"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 102,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_ORP_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "mV"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 101,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_EC_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x043a"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"description": "Maximum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/min",
"description": "Minimum value of state/measured_value.",
"default": 0
},
{
"name": "cap/measured_value/unit",
"static": "μS/cm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 11,
"eval": "Item.val = (ZclFrame.at(3) << 32) | (ZclFrame.at(2) << 16) | (ZclFrame.at(1) << 8) | ZclFrame.at(0);",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_TDS_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x042B"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 1,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
},
{
"type": "$TYPE_SALT_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x040D"
],
"items": [
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/unit",
"static": "ppm"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/measured_value",
"read": {
"fn": "none"
},
"parse": {
"dpid": 117,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
]
}
]
}
If it's just an offset, you don't need to use dp, can just use something like
{ "name": "config/offset", "default": 0 },
and
{ "name": "state/measured_value", "parse": { "dpid": 1, "eval": "Item.val = Attr.val + R.item('config/offset').val;", "fn": "tuya" }, "default": 0 }
the offset will be managed by deconz direclty.
Now I understand @Smanar how the offset working. Not sure it's work with this device.
Here the notice how to calibrate PH / ORP / EC if you have the app and the gateway. I don't have.
Calibration methods:
•Ph calibration
•ORP calibration
•EC Calibration
How I can calibrate with deCONZ? Shall I create new subdevices with DP 114 and DP 103 for PH Calibration?
He, yep, I don't see other method, I don't find better method, problem is only "light" device have "send request only" field For sensor can be
{
"name": "config/calibration",
"read": {
"fn": "none"
},
"write": {
"dpid": 114,
"dt": "0x10",
"eval": "Item.val;",
"fn": "tuya"
}
},
But I don't know the type and the value to use. For this code I m using a "bool" type with 0/1. Generaly even is the request is bad, the device send a "report" with the same dpid, so it's possible to look at it to see the correct synthax on logs.
(And need to add a new json file again, a config_calibration_item.json but this one can be used for all sensor)
He, yep, I don't see other method, I don't find better method, problem is only "light" device have "send request only" field For sensor can be
{ "name": "config/calibration", "read": { "fn": "none" }, "write": { "dpid": 114, "dt": "0x10", "eval": "Item.val;", "fn": "tuya" } },
But I don't know the type and the value to use. For this code I m using a "bool" type with 0/1. Generaly even is the request is bad, the device send a "report" with the same dpid, so it's possible to look at it to see the correct synthax on logs.
(And need to add a new json file again, a config_calibration_item.json but this one can be used for all sensor)
When I look the log info I can see type 0x02 means value
I change Bool with Double
{
"schema": "resourceitem1.schema.json",
"id": "config/calibration",
"datatype": "Double",
"access": "RW",
"public": true,
"description": "Calibrate Solution."
}
Here in DDF:
{
"name": "config/calibration",
"read": {
"fn": "none"
},
"write": {
"dpid": 114,
"dt": "0x02",
"eval": "Item.val;",
"fn": "tuya"
}
},
In API I see value null. How I can write a calibration number?
// Value for dp_type
// ------------------
// 0x00 DP_TYPE_RAW ?
// 0x01 DP_TYPE_BOOL ?
// 0x02 DP_TYPE_VALUE 4 byte unsigned integer
// 0x03 DP_TYPE_STRING variable length string
// 0x04 DP_TYPE_ENUM 1 byte enum
// 0x05 DP_TYPE_FAULT 1 byte bitmap (didn't test yet)
So type 2 is classic value (so double in the json is fine)
{
"name": "config/calibration",
"read": {
"fn": "none"
},
"parse": {"fn": "tuya", "dpid": 114, "eval": "Item.val = Attr.val;"},
"write": {
"dpid": 114,
"dt": "0x2b",
"eval": "Item.val;",
"fn": "tuya"
}
},
0x02 is tuya type,converted in 0x2b for deconz type. Have added the "parse" part for the json be able to receive the data, but not sure it's usefull, IDK if the state remain, or if it's a "one shoot" request.
For information I will be away for a week, so can't help to finish this device.
As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.
As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.
Hi, many thanks for this work!
For those, who are not familiar with DDF development and deconz in detail: It would be nice, to get step by step instruction on how to integrate the pool tester.
I tried to upload the above DDF-file with the phoscon app, but it fails to import the file.
To validate my phoscon app and deconz-installation, I tried to upload the DDFs of some other devices from the deconz device page and they all work!
Thank you for assistance!
Hello, https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet
You just need to create a text file called what_you_want.json in a "devices" folder. And restart deconz.
You just need to create a text file called what_you_want.json in a "devices" folder. And restart deconz.
Thank you for the help. What is the content of this what_you_want.json?
Here https://github.com/dresden-elektronik/deconz-rest-plugin/issues/7215#issuecomment-1722207474 You will miss the last part, the calibration but can start with this version to test.
Hi,
I only get an Temp-Sensor in Phoscon. How can i get the PH and chlorine sensor?
Hello, I don't think Phoscon support them, better to use third app.
Device
Screenshots
Basic
Identify
Alarms
Device Temperature
Groups
Scenes
On/Off
Level Control
Color Control
Simple Metering
Diagnostics
Other clusters that are not mentioned above