[OBSOLETE] Xiaomi Sensors and Button (beta)

@kebel871 Have you tried from :

Yup I’m using it. Just couldn’t import it from your repo and add to copy paste code. Dunno why but IDE wasn’t listing your groovy after I added your repo.

1 Like

Of I get some free time I will work on this. It looks like it should not be to difficult to implement.

Thank you . Now i got it to work. :wink:

I have the Xiaomi Aqara motion sensor. I have tried this method using the your steps above, however I do not see “Catchall.” I only thing I am able to see “ssdp Term,” “Ping,” & “zwStatus.” Am I doing something wrong. is there possibly any other steps. I really appreciate the help.

My Xiaomi water sensor has stayed connected over 24 hours. I get this error whenever it checks in. Line 91 in the SmartSense moisture handler is the Map map = zigbee.getEvent(description)
f49b72e3-51f0-48ba-a89b-4184c1fedf93 12:39:57 PM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 12:39:57 PM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 11:49:48 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 11:49:48 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 10:59:44 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 10:59:44 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 10:09:38 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 10:09:38 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 9:19:30 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 9:19:30 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240200000101082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 8:29:25 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 8:29:25 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 7:39:14 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 7:39:14 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328180421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 6:49:07 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 6:49:07 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328180421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 5:59:03 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 5:59:03 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240200000102082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 5:08:56 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 5:08:56 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 4:18:48 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 4:18:48 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 3:28:40 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 3:28:40 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240200000101082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 2:38:47 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 2:38:47 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000
f49b72e3-51f0-48ba-a89b-4184c1fedf93 1:48:27 AM: error java.lang.NumberFormatException: For input string: “nu” @ line 91
f49b72e3-51f0-48ba-a89b-4184c1fedf93 1:48:27 AM: debug description: catchall: 0104 0000 01 01 0100 00 7B61 00 04 115F 0A 01 01FF422201210D0C0328190421A84305210B0006240100000000082103020A210000641000

You do not need to do it this way.

Go to add a ‘Thing’, then press the pairing button, the led will flash wait a few seconds for the led to respond again. Keep doing this waiting 3 or so seconds between button presses the led will eventually start to respond with 3 flashes, a pause and 3 flashes, these 3 flashes will change pace a little when you continue the sequence and eventually it will show up on the screen. You then will probably have to go and assign the correct DH to it via the IDE.

I know its been asked many time. But can some one help me. I am trying to pair my first Xiaomi Door/Window Sensor. I Created a4refillpad : Xiaomi Door/Window Sensor in My Device Handlers. But when i try to pair nothing comes up. I don’t see anything in list of events with catchall.
Thank you

Did you read my post directly above yours? Have you tried that?

Yes, just tried it again. are you holding the pair or just pressing?

No holding the button!

just press/release it, wait a few seconds for the LED to flash back, keep repeating until it shows in the app. As you get close the LED will flash 3 times then again 3 times after a second or two. Just continue to single press the button and wait a few seconds for the LED to respond. The hub will pick it up.

You can reset the sensor by holding the button for several seconds until the LED stops flashing, then release, you should get a single flash after that press and hold the button again and the LED should flash quickly for a few seconds, wait for it to finish then release the button. The Sensor should be full reset now. Try to pair it again…

1 Like

Not sure if i am missing something else but its not working :frowning:


This is my Device Handlers

and i know that sensor is working since i don’t have a problem connecting it to Mi Home app

When you are trying to pair it to ST is the Mi Hub turned Off? Also do you have any other hard wired zigbee devices like sockets/outlets or bulbs? If you do then turn these off at the mains before trying to pair the sensors to ST as sometimes the sensors try to route through a different device when pairing and it fails or does not complete properly. Also are you sure they are not actually pairing, I have seen recently that sometimes I do not get the pairing confirmation in the ST app but if I go back to the list of ‘Things’ it has actually added it.

Only thing zigbee is my front lock.

An the MI Hub is turned off

The lock is battery powered I assume so will not have an effect.

It is probably just down to the button pressing. There is a knack to it. Press/release the button, the LED will flash, wait a few seconds it will flash again, then press release the button again, wait for second lot of flashes, repeat until it appears in the app. This has worked for me with over 40 sensors some of which I have paired dozens of times due to issues experiences with the Hub f/w update a while back.

Oh and assume/hope you have a V2 hub of course? They do not or at least apparently do not work with the V1 Hub.

1 Like

Yes Hub V2. I already tried another sensor. rebooted hub. not sure. :frowning:

Sorry Andrew, not sure what else to suggest.

How long do you persevere with pressing the button? Sometimes it can take a few minutes for it to pick it up. Are you using iOS or droid? I have found (mentioned above) that sometimes (more so on iOS) that recently it does not actually confirm pairing for me but it does add the sensor to the list.

Also, it does not matter if you have the DH installed or not, that is separate, the Hub will pick up the sensor without it. It may call the ‘Thing’ something funny like ‘Door Sensor’ etc. so be sure to just look for things that were not in the list before.