$9 Zigbee Xiaomi Door/Window Sensors (works for some people)

Maybe @pstuart or @JDRoberts could help us out? Please, please, please?

Sorry, because I now rely on text to speech I can no longer read any of the actual code or the log entries. So when you get to that stage you need one of the master coders. Hopefully someone will take an interest.

@JohnR

3 Likes

Thank you very much anyway!

Redo the pair join process and show the whole log. Need to see if it fingerprints to a specific cluster or clusters.

Since it joined, you can just try to change the devicetype to any of the standard ZigBee devices and see if those work as well.

2 Likes

This is very promising, I have some motions coming, and Iā€™ll log the heck out of em.

1 Like

Hello @pstuart!

I have already tried to change the device type to one of the standard Zigbee ones with no success so far.

Will retry again tomorrow just in case I missed any.

I will also repeat the reset/pairing process and keep all the logs. However, do not expect anything more detailed than what I have already provided for the motion sensor above.

Thanks for getting involved my friend.

Make sure you are seeing the whole logs and not just the ā€œthingā€ the cluster reporting on join will ONLY show up in the full log view and not when filtered. Easy to miss it.

Also, try installing this code in the devicetypes in the IDE and click the refresh and see if it reports anything interestingā€¦

/**
 *  Unknown Zigbee Test Device
 *
 *  Copyright 2015 Patrick Stuart
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
metadata {
	definition (name: "Unknown Zigbee Test Device", namespace: "pstuart", author: "Patrick Stuart") {
		capability "Refresh"
	}

	simulator {
		// TODO: define status and reply messages here
	}

	tiles {
		// TODO: define your main and details tiles here
	}
}

// parse events into attributes
def parse(String description) {
	log.debug "Parsing '${description}'"

}

// handle commands
def refresh() {
	log.debug "Executing 'refresh'"
	// TODO: handle 'refresh' command
getClusters();
}

def getClusters() {
	log.debug "getClusters hit $device.deviceNetworkId please check full logs for response, may need a smartapp installed that subscribes to location parsing, like SHM, it will not be filtered to this device in the format like cp desc: ep_cnt:4, ep:01 C4 C5 C6"
	"zdo active 0x${device.deviceNetworkId}"
}
1 Like

Hi Patrick,

I created a new device type (Unknown Zigbee Test Device) with your code and self published. I then assigned this device type to the thing. I saw nothing on the logs.

How do I refresh? From within the iPhone app?

Regarding the logs, I have selected the ALL tab. Is there somewere else I should check?

Thank you very much

Hi there!

I have deleted all three things and re-paired only the door sensor in order to make this as simple as possible.
These are the logs:

I changed the device type first to ā€œSmartsense door sensorā€ so that it creates an interface in the iPhone app and thn again changed the device type to the one you provided. I then tapped on refresh on the thing tab from within the iPhone app and these logs were produced:

f8589554-8546-4abc-9781-162a5c191ee9 12:12:51 Ļ€.Ī¼. EET: trace NON-HUE EVENT catchall: 0000 8038 00 00 0140 00 0000 00 00 0000 00 00 0000F8FF0714000A0010ACB0C5ACC6C3C2B0D4D0D3ECEBCECFCF
f8589554-8546-4abc-9781-162a5c191ee9 12:12:51 Ļ€.Ī¼. EET: trace Location: catchall: 0000 8038 00 00 0140 00 0000 00 00 0000 00 00 0000F8FF0714000A0010ACB0C5ACC6C3C2B0D4D0D3ECEBCECFCF
4b977a62-d4b1-4a7a-9ca7-9038fc39b937 12:12:47 Ļ€.Ī¼. EET: debug Parse returned Kā€™s iPhone has arrived
2ed999cf-9f7a-4666-aac3-e502280f527f 12:12:43 Ļ€.Ī¼. EET: debug getClusters hit 387A please check full logs for response, may need a smartapp installed that subscribes to location parsing, like SHM, it will not be filtered to this device in the format like cp desc: ep_cnt:4, ep:01 C4 C5 C6
2ed999cf-9f7a-4666-aac3-e502280f527f 12:12:43 Ļ€.Ī¼. EET: debug Executing 'refreshā€™
*** 12:12:36 Ļ€.Ī¼. EET: info Waiting on eventsā€¦***
*** 12:12:36 Ļ€.Ī¼. EET: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.***
*** 12:12:36 Ļ€.Ī¼. EET: info This console provides live logging of your SmartThings.***

I hope it may help you somehow @pstuart!

Thanks again for getting involved.

So they donā€™t advertise any endpoints on join. The catchall looks like it is checking in on non compliant ha endpoint so it is pretty much a no go from here. Without specific cluster and endpoint docs, it appears to be a custom ZigBee device and not following a standard after pairing.

2 Likes

Hey Patrick thank for getting back.

Is there any more tests you want me to run?
Or we write it off at this point?

:frowning:

I donā€™t know any more tricks. First ZigBee device that didnā€™t report endpoints.

Okay sir. It is unfortunate but at least we tried.

Do you think it would be worth it if i tried with the motion sensor as well?

Canā€™t hurt. Your time.

Okay my friend. Will do that tomorrow and report back here.

Hi all! Hello @pstuart my friend.

i have tried the motion sensor and it DOES WORK!

See bellow:

1 Like

Yes, but it doesnā€™t give endpoints which makes it difficult to know anything.

Since it is a motion sensor, see if it checks in with and without motion with a catchall.

Hi @pstuart!

I am not sure i understand what you mean it does not give endpoints.In my second screenshot above i think i see smh about endpoints in the log.

Here is what i have seen:

  1. I pair the motion sensor and it appears as a thing
  2. I define the device to be ā€œSmartsense motion sensorā€
  3. I see it in the iPhone app
  4. The device does work (only once - you can see that in the screenshot above)

When i am refreshing again i get this error in the logs:

05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:12 AM GMT+2: debug Parse returned [name:motion, value:active, descriptionText:Thing detected motion]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:12 AM GMT+2: debug motion
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:12 AM GMT+2: debug Desc Map: [raw:D9DC0104060800001801, dni:D9DC, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, value:01]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:12 AM GMT+2: debug description: read attr - raw: D9DC0104060800001801, dni: D9DC, endpoint: 01, cluster: 0406, size: 08, attrId: 0000, encoding: 18, value: 01
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:04 AM GMT+2: debug Parse returned [name:motion, value:active, descriptionText:Thing detected motion]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:04 AM GMT+2: debug motion
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:04 AM GMT+2: debug Desc Map: [raw:D9DC0104060800001801, dni:D9DC, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, value:01]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:37:04 AM GMT+2: debug description: read attr - raw: D9DC0104060800001801, dni: D9DC, endpoint: 01, cluster: 0406, size: 08, attrId: 0000, encoding: 18, value: 01
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:51 AM GMT+2: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.math.BigInteger#.
Cannot resolve which method to invoke for [null, class java.lang.Integer] due to overlapping prototypes between:
[class [I, int]
[class [B, int]
[class java.lang.String, int] @ line 321
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:51 AM GMT+2: debug Sending enroll response
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:51 AM GMT+2: debug refresh called
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:49 AM GMT+2: debug Parse returned [name:motion, value:active, descriptionText:Thing detected motion]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:49 AM GMT+2: debug motion
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:49 AM GMT+2: debug Desc Map: [raw:D9DC0104060800001801, dni:D9DC, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, value:01]
05d65540-b5c9-4c32-ad2b-7028c0fadbf0 12:36:49 AM GMT+2: debug description: read attr - raw: D9DC0104060800001801, dni: D9DC, endpoint: 01, cluster: 0406, size: 08, attrId: 0000, encoding: 18, value: 01

  • 12:36:57 AM GMT+2: info Waiting on eventsā€¦*
  • 12:36:57 AM GMT+2: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.*
  • 12:36:57 AM GMT+2: info This console provides live logging of your SmartThings.*

In the logs it seems to be catching motion every time but the event ā€œmotionā€ registers only once. At least that is what i understand.

This is the full log of the only event that actually registered:

Thing detected motion
Name Value
*data *
{

  • ā€œmicroDeviceTileā€: {*
  •    "type": "standard",*
    
  •    "icon": "st.motion.motion.active",*
    
  •    "backgroundColor": "#53a7c0"*
    
  • }*
    }
    date 2015-11-23 12:21:38.341 AM EET (2015-11-22T22:21:38.341Z)
    description Thing detected motion
    deviceId 05d65540-b5c9-4c32-ad2b-7028c0fadbf0
    deviceTypeId 821425e6-b305-468a-9a27-db0e4852ce3a
    displayed true
    eventSource DEVICE
    hubId MASKED by me
    id 65fd1ee2-9167-11e5-bfb4-0a588c3c57cb
    isStateChange true
    isVirtualHub false
    linkText Thing
    locationId MASKED by me
    name motion
    rawDescription read attr - raw: D9DC0104060800001801, dni: D9DC, endpoint: 01, cluster: 0406, size: 08, attrId: 0000, encoding: 18, value: 01
    translatable false
    unixTime 1448230898341
    value active
    viewed false

What do you think is happening?

Thanks a lot

I appreciate your tenacityā€¦ But clearly you are not getting what I am telling you. These devices do not advertise their join endpoints, without that, there is no way to fingerprint them in ST.

Something is binding Endpoint 01 to cluster 0406 which is not a standard zigbee HA cluster, it is a custom cluster.

However, it appears to be translating to the value 01 which might mean motion detected. It could also just be a heartbeat / checkin.

Without proper docs, it would be just guessing as to how to program up this sensor on that cluster (or even other clusters it isnā€™t responding to)

The error you are getting above is because there is no endpoint fingerprint.

Unfortunately, I canā€™t do anything more based on the information above. The device is a custom zigbee device and doesnā€™t appear to conform to zigbee ha standards for the type of device it advertises to be.

2 Likes

Hello all!

I have run some more tests with the Door sensor.
I have defined it as Tyco Door/Window sensor.

Look at the logs as i move the two pieces together and then separate them:

1fee41f4-f292-414e-8c25-377b1a5f1c76 1:12:00 Ī¼.Ī¼. EET: debug Parse returned [:]
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:12:00 Ī¼.Ī¼. EET: debug description: on/off: 0
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:59 Ī¼.Ī¼. EET: debug Parse returned [:]
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:59 Ī¼.Ī¼. EET: debug description: on/off: 1
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:56 Ī¼.Ī¼. EET: debug Parse returned [:]
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:56 Ī¼.Ī¼. EET: debug description: on/off: 0
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:50 Ī¼.Ī¼. EET: debug Parse returned [:]
1fee41f4-f292-414e-8c25-377b1a5f1c76 1:11:50 Ī¼.Ī¼. EET: debug description: on/off: 1

  • 1:11:46 Ī¼.Ī¼. EET: info Waiting on eventsā€¦*
  • 1:11:46 Ī¼.Ī¼. EET: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.*
  • 1:11:46 Ī¼.Ī¼. EET: info This console provides live logging of your SmartThings.*

Still the event does not actually catch. In the event list of the device there are no records.

Unfortunately i am no dev and i cannot make this work.

Hopefully someone (@pstuart i am not pointing at you :smiley:) might get interested in this and work it out eventually.