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 Zigbee Human Presence Sensor. TS0601 by _TZE204_sxm7l9xa #2429

Open
Agimgrue opened this issue Jun 12, 2023 · 18 comments
Labels
stale Issue is inactivate and might get closed soon Tuya Request/PR regarding a Tuya device

Comments

@Agimgrue
Copy link

Agimgrue commented Jun 12, 2023

Problem description

Only device exist, with anything else.

TS0601
por _TZE204_sxm7l9xa
Conectado a través de Zigbee Coordinator
Zigbee info
IEEE: a4:c1:38:9f:d2:31:dd:b9
Nwk: 0x8b19
Device Type: Router
LQI: 111
RSSI: Desconocido
Visto por última vez: 2023-06-12T20:04:07
Fuente de alimentación: Mains

Device https://a.aliexpress.com/_Ew1B0SN

I've see an external converter js to run it on z2m.

Solution description

I post it here if anyone can adapt it as a custom quirk or include it on ZHA library

Screenshots/Video

Screenshots/Video

Screenshot_2023-06-12-20-12-58-431_io homeassistant companion android

Device signature

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE204_sxm7l9xa",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

Diagnostic information

Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.5.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.11",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Madrid",
    "os_name": "Linux",
    "os_version": "6.1.25",
    "supervisor": "2023.06.1",
    "host_os": "Home Assistant OS 10.1",
    "docker_version": "23.0.3",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "dual_smart_thermostat": {
      "version": "0.5.5",
      "requirements": []
    },
    "mikrotik_router": {
      "version": "0.0.0",
      "requirements": [
        "librouteros>=3.2.0",
        "mac-vendor-lookup>=0.1.12"
      ]
    },
    "xiaomi_gateway3": {
      "version": "3.2.1",
      "requirements": [
        "zigpy>=0.44.1"
      ]
    },
    "fs1pg": {
      "version": "1.1",
      "requirements": []
    },
    "delete": {
      "version": "1.9",
      "requirements": []
    },
    "ariston": {
      "version": "0.13.1",
      "requirements": [
        "ariston==0.13.1"
      ]
    },
    "mqtt_discoverystream": {
      "version": "0.9",
      "requirements": []
    },
    "spotcast": {
      "version": "v3.6.30",
      "requirements": []
    },
    "floureon": {
      "version": "1.0.0",
      "requirements": [
        "pythoncrc",
        "broadlink>=0.15.0"
      ]
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "deepstack_object": {
      "version": "4.6.0",
      "requirements": [
        "pillow",
        "deepstack-python==0.8"
      ]
    },
    "tuya_v2": {
      "version": "1.5.0",
      "requirements": [
        "tuya-iot-py-sdk==0.4.1"
      ]
    },
    "pvpc_hourly_pricing": {
      "version": "1.1.0",
      "requirements": [
        "aiopvpc==4.2.1"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "tapo_control": {
      "version": "5.1.0",
      "requirements": [
        "pytapo==3.1.12"
      ]
    },
    "xiaomi_miot": {
      "version": "0.7.9",
      "requirements": [
        "construct==2.10.56",
        "python-miio>=0.5.6",
        "micloud>=0.3"
      ]
    },
    "tuya_custom": {
      "version": "0.1.7",
      "requirements": []
    },
    "huawei_solar": {
      "version": "1.2.6b5",
      "requirements": [
        "huawei-solar==2.2.7b5"
      ]
    },
    "programmable_thermostat": {
      "version": "8.1",
      "requirements": []
    },
    "localtuya": {
      "version": "5.2.0",
      "requirements": []
    },
    "edata": {
      "version": "2023.02.1",
      "requirements": [
        "e-data==1.1.0",
        "python-dateutil>=2.8.2"
      ]
    },
    "frigate": {
      "version": "4.0.0",
      "requirements": [
        "pytz==2022.7"
      ]
    },
    "fullykiosk": {
      "version": "1.1.0",
      "requirements": [
        "python-fullykiosk==0.0.11"
      ]
    },
    "esios": {
      "version": "1.0.0",
      "requirements": []
    },
    "alarmo": {
      "version": "v1.9.9",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "requirements": [
      "bellows==0.35.5",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.99",
      "zigpy-deconz==0.21.0",
      "zigpy==0.55.0",
      "zigpy-xbee==0.18.0",
      "zigpy-zigate==0.11.0",
      "zigpy-znp==0.11.1"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 35609,
    "manufacturer": "_TZE204_sxm7l9xa",
    "model": "TS0601",
    "name": "_TZE204_sxm7l9xa TS0601",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4417,
    "power_source": "Mains",
    "lqi": 57,
    "rssi": null,
    "last_seen": "2023-06-12T18:48:33",
    "available": true,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": "0x0104",
          "device_type": "0x0051",
          "input_clusters": [
            "0x0000",
            "0x0004",
            "0x0005",
            "0xef00"
          ],
          "output_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "242": {
          "profile_id": "0xa1e0",
          "device_type": "0x0061",
          "input_clusters": [],
          "output_clusters": [
            "0x0021"
          ]
        }
      },
      "manufacturer": "_TZE204_sxm7l9xa",
      "model": "TS0601"
    },
    "active_coordinator": false,
    "entities": [],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "SMART_PLUG"
      },
      {
        "name": "unknown 97 device_type of 0xa1e0 profile id"
      }
    ],
    "user_given_name": "Presencia Comedor",
    "device_reg_id": "fc0174ade3fd07b5571bb86a60596440",
    "area_id": "comedor",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "SMART_PLUG",
          "id": 81
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0xef00": {
            "endpoint_attribute": null,
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0001": {
                "attribute_name": "app_version",
                "value": 74
              },
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "_TZE204_sxm7l9xa"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "TS0601"
              }
            },
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      },
      "242": {
        "device_type": {
          "name": "unknown",
          "id": 97
        },
        "profile_id": 41440,
        "in_clusters": {},
        "out_clusters": {
          "0x0021": {
            "endpoint_attribute": "green_power",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}

Logs

Logs
[Paste the logs here]

Custom quirk

Z2M External Converter
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_ikvncluo'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_lyetpprm'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_jva8ink8'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_holel4dk'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_xpq2rzhq'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_wukb7rhc'},
        {modelID: 'TS0601', manufacturerName: '_TZE204_ztc6ggyl'},
        {modelID: 'TS0601', manufacturerName: '_TZE204_sxm7l9xa'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_ztc6ggyl'}],
    model: 'TS0601_smart_human_presence_sensor',
    vendor: 'TuYa',
    description: 'Smart Human presence sensor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    exposes: [
        e.illuminance_lux(), e.presence(),
        exposes.numeric('target_distance', ea.STATE).withDescription('Distance to target').withUnit('m'),
        exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(9).withValueStep(1)
            .withDescription('sensitivity of the radar'),
        exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15)
            .withDescription('Minimum range').withUnit('m'),
        exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15)
            .withDescription('Maximum range').withUnit('m'),
        exposes.numeric('detection_delay', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.1)
            .withDescription('Detection delay').withUnit('s'),
        exposes.numeric('fading_time', ea.STATE_SET).withValueMin(0).withValueMax(1500).withValueStep(1)
            .withDescription('Fading time').withUnit('s'),
        // exposes.text('cli', ea.STATE).withDescription('not recognize'),
        exposes.enum('self_test', ea.STATE, Object.values(tuya.tuyaHPSCheckingResult))
            .withDescription('Self_test, possible resuts: checking, check_success, check_failure, others, comm_fault, radar_fault.'),
    ],
    meta: {
        tuyaDatapoints: [
            [104, 'illuminance', tuya.valueConverter.raw],
            [105, 'presence', tuya.valueConverter.boolean],
            [106, 'radar_sensitivity', tuya.valueConverter.raw],
            [107, 'maximum_range', tuya.valueConverter.raw],
            [108, 'minimum_range', tuya.valueConverter.raw],
            [109, 'target_distance', tuya.valueConverter.raw],
            [110, 'detection_delay', tuya.valueConverter.raw],
            [111, 'fading_time', tuya.valueConverter.raw],
        ],
    },
};

module.exports = definition;

Additional information

No response

@dipseth
Copy link

dipseth commented Jun 12, 2023

I have similiar issue but for _TZE204_sooucan5

@blainfaulkner
Copy link

I've got the same issue here _TZE204_sxm7l9xa, When added it only displays diagnostics. Any information I can provide let me know.

@dipseth
Copy link

dipseth commented Jun 19, 2023

FYI this work for me for presence sensor entity and a switch.

@niknik98
Copy link

I have the same issue with TZE204_sxm7l9xa

@nictronik99
Copy link

same issue with TZE204_sxm7l9xa, i've not tested the @dipseth suggestion yet but i'm new to this world and i don't know the difference between TZE204 with different _xxxxxxxx. someone who knows how to get working this sensor can reply please?

@dipseth
Copy link

dipseth commented Jun 29, 2023

@nictronik99 If your device's signature matches what was originally mentioned (not counting the manufacturer code TZE204_... , but the look at the input_clusters clusters, profile_id, etc.) the link I provided should work I believe. Elsewhere in that thread there are instructions for how to implement a custom quirk.

@nictronik99
Copy link

@nictronik99 If your device's signature matches what was originally mentioned (not counting the manufacturer code TZE204_... , but the look at the input_clusters clusters, profile_id, etc.) the link I provided should work I believe. Elsewhere in that thread there are instructions for how to implement a custom quirk.

I tried a different route.... I switched to zigbee2mqtt....

@EnzovdWetering
Copy link

I have the same issue too. Would love to add the wall mount version to ZHA. To be specific, I have the Tuya TS0601 by _TZE204_sxm7l9xa.

Scherm­afbeelding 2023-07-11 om 20 18 56

@labaland
Copy link

I need for "_TZE204_sooucan5" Would be nice if someone can add it. I dont know how :(
image

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Jul 30, 2023
@monstergubl
Copy link

im interested too not work since yet

@adey
Copy link

adey commented Aug 18, 2023

Any update?

Thanks.

@labaland
Copy link

labaland commented Aug 18, 2023 via email

@racedo
Copy link

racedo commented Aug 20, 2023

@labaland could you elaborate on what works? The lates HA still doesn't show any sensors.

I'm attaching what HA sees when adding the device, which still makes the device unusable.

Thanks.

image

@Woll3
Copy link

Woll3 commented Aug 25, 2023

Custom quirk available here: [Device Support Request] ZY-M100 #2378

Support will be added: Add support for more TS0601 sensors and configuration

@sneakythr0ws
Copy link

don't forget _TZE204_sooucan5 pls

@chimeranzl
Copy link

chimeranzl commented Apr 10, 2024

Adding the _mtoaryre variant to an older quirk file, under variant2 section seems to work nicely https://raw.githubusercontent.com/zigpy/zha-device-handlers/c7b130a20614e3e364c9fea023d632014a5726d1/zhaquirks/tuya/ts0601_motion.py

...
class TuyaMmwRadarOccupancyVariant2(CustomDevice):
    """Mini/Ceiling Human Breathe Sensor"""

    signature = {
        #  endpoint=1, profile=260, device_type=81, device_version=1,
        #  input_clusters=[4, 5, 61184, 0], output_clusters=[25, 10]
        MODELS_INFO: [
            ("_TZE204_qasjif9e", "TS0601"),
            ("_TZE204_mtoaryre", "TS0601"),
        ],
...

@Amerigo1973
Copy link

Simeone can add TZE204_nbkshs6k plesse?

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Issue is inactivate and might get closed soon label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is inactivate and might get closed soon Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

No branches or pull requests