Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device support request - TuYa Smart Air Sensor _TZE200_mja3fuja #17439

Closed
jmluxem opened this issue Apr 23, 2023 · 11 comments
Closed

Device support request - TuYa Smart Air Sensor _TZE200_mja3fuja #17439

jmluxem opened this issue Apr 23, 2023 · 11 comments
Labels
new device support New device support request

Comments

@jmluxem
Copy link

jmluxem commented Apr 23, 2023

Link

https://a.aliexpress.com/_ms7pX0y

Database entry

{"id":105,"type":"Router","ieeeAddr":"0xa4c138d4fe33f3b9","nwkAddr":27178,"manufId":4417,"manufName":"_TZE200_mja3fuja","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65506":32,"65508":1,"modelId":"TS0601","manufacturerName":"_TZE200_mja3fuja","powerSource":1,"zclVersion":3,"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1682015339812,"defaultSendRequestWhen":"immediate"}

Comments

Tried setting up this device and configuring an external converter but haven’t gotten anything working.

External converter

Nothing usable…

I was trying to setup a converter to make this report the same as another very similar device that I already have and that is supported: _TZE200_dwcarsat - the TuYa TS0601_smart_air_house_keeper

I've tried setting up something like below but it hasn't worked:

convert: (model, msg, publish, options, meta) => {
    const dpValue = tuya.firstDpValue(msg, meta, 'tuya_air_quality');
    const dp = dpValue.dp;
    const value = tuya.getDataValue(dpValue);
    switch (dp) {
    case tuya.dataPoints.tuyaSabTemp:
        return {temperature: calibrateAndPrecisionRoundOptions(value / 10, options, 'temperature')};
    case tuya.dataPoints.tuyaSabHumidity:
        return {humidity: calibrateAndPrecisionRoundOptions(value / 10, options, 'humidity')};
        // DP22: Smart Air Box: Formaldehyd, Smart Air Housekeeper: co2
    case tuya.dataPoints.tuyaSabFormaldehyd:
        if (['_TZE200_mja3fuja'].includes(meta.device.manufacturerName)) {
            return {co2: calibrateAndPrecisionRoundOptions(value, options, 'co2')};
        } else {
            return {formaldehyd: calibrateAndPrecisionRoundOptions(value, options, 'formaldehyd')};
        }
        // DP2: Smart Air Box: co2, Smart Air Housekeeper: MP25
    case tuya.dataPoints.tuyaSabCO2:
        if (meta.device.manufacturerName === '_TZE200_mja3fuja') {
            // Ignore: https://github.com/Koenkk/zigbee2mqtt/issues/11033#issuecomment-1109808552
            if (value === 0xaaac || value === 0xaaab) return;
            return {pm25: calibrateAndPrecisionRoundOptions(value, options, 'pm25')};

Supported color modes

No response

Color temperature range

No response

@jmluxem jmluxem added the new device support New device support request label Apr 23, 2023
@jmluxem
Copy link
Author

jmluxem commented May 7, 2023

This device seems to be identical to _TZE200_dwcarsat

I have still been unsuccessful trying to get _TZE200_mja3fuja to mimic function of _TZE200_dwcarsat

@Charliedean
Copy link

Also having this issue. @jmluxem did you mange to fix this?

@oedo808
Copy link

oedo808 commented May 31, 2023

Me too! First zigbee device joined but no expected entities :-)

@jmluxem
Copy link
Author

jmluxem commented Jun 2, 2023

I have not been able to fix this. Haven't had much free time to devote. Was hoping @Koenkk might be able to sprinkle some of his magic, since I don't believe any real datapoint-finding is required - I'd bet that a direct conversion from _TZE200_dwcarsat would allow this to function, but making that work properly escapes me. The unsupported device is _TZE200_mja3fuja, but I bought it thinking that it was identical to _TZE200_dwcarsat - they both have the same functions. I may be wrong but I don't exactly have the knowledge/time/hardware to test my belief.

@Koenkk
Copy link
Owner

Koenkk commented Jun 2, 2023

Could you check if the issue is fixed with the following external converter: https://gist.github.com/Koenkk/002a6a797922f736db47fd4bb2f5f19c

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m, check if issue is fixed

@jmluxem
Copy link
Author

jmluxem commented Jun 3, 2023

Heck yeah, that's why you're the boss :)
That converter got temperature and humidity reporting correctly - confirmed by breathing into the sensor.
CO2, VOC, and Formaldehyde are reporting values, but tough for me to confirm validity/correctness since it seems the sensor updates those at a much slower rate, and it may not be very accurate to boot. PM25 not reporting any value currently.
Regardless, this is leagues better than anything I had gotten working. Thank you!

State values:
{
"humidity": 43,
"linkquality": 163,
"temperature": 28.3,
"co2": 13,
"formaldehyd": 514,
"pm25": null,
"voc": 72
}

Please let me know if there are any other logs or items I can pull for your benefit.

@Koenkk
Copy link
Owner

Koenkk commented Jun 3, 2023

Can you try the following, in your data/database.db change the manufacturer name from _TZE200_mja3fuja to _TZE200_dwcarsat and see if everything works now? (no external converter needed)

@jmluxem
Copy link
Author

jmluxem commented Jun 3, 2023

I run HAOS with z2m as an addon. I am not seeing a 'data' directory. In my file structure, I have config/zigbee2mqtt/database.db

Within that database.db file, I changed the name to _TZE200_dwcarsat and restarted z2m, but it doesn't appear to be keeping the change - when i go back to the database.db file, the old _TZE200_mja3fuja name is back where I had just changed it.

@Koenkk
Copy link
Owner

Koenkk commented Jun 4, 2023

You need to stop z2m, make the change and start z2m.

@jmluxem
Copy link
Author

jmluxem commented Jun 5, 2023

Thank you for that tip/correction. I updated the database.db file and now the device is working without the converter. Everything appears to be working

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Jun 5, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jun 5, 2023

Great, integrated the changes!

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request
Projects
None yet
Development

No branches or pull requests

4 participants