Xiaomi/Aqara Water sensor

@MaverickASC That device handler doesn’t work for me. When I trigger the wet condition, the sensor in my Things still says “dry.”

However, if I go to live logging, I see this (so it seems like it’s partially working):
9:20:16 PM: debug AQUARA-WS RESULT: [name:water, value:dry, descriptionText:${device.displayName} is dry, translatable:true]
9:20:16 PM: debug AQUARA-WS RAW: zone status 0x0000 -- extended status 0x00
9:20:01 PM: debug AQUARA-WS RESULT: [name:water, value:wet, descriptionText:${device.displayName} is wet, translatable:true]
9:20:01 PM: debug AQUARA-WS RAW: zone status 0x0001 -- extended status 0x00

Also, if I push the button, I get this (some bytes omitted):
9:20:22 PM: debug AQUARA-WS RESULT: [:]
9:20:22 PM: debug AQUARA-WS UNKNOWN DM: [raw:6C0D0100…1000, dni:6C0D, endpoint:01, cluster:0000, size:7c, attrId:0005, encoding:42, value:6C75…1000]
9:20:22 PM: debug AQUARA-WS DM: [raw:6C0D0100…1000, dni:6C0D, endpoint:01, cluster:0000, size:7c, attrId:0005, encoding:42, value:6C75…1000]
9:20:22 PM: debug AQUARA-WS RAW: read attr - raw: 6C0D0100…1000, dni: 6C0D, endpoint: 01, cluster: 0000, size: 7c, attrId: 0005, encoding: 42, value: 6C756D692E…1000

Just added a new one and seeing 85% battery, so looks good!

How did you get the battery level to report? For me, using the device handler results in the wet/dry indicator not working.

Thanks for testing this out and sharing the log file. I was looking for this information. Let me try and repro this and make adjustments to the DH. This helps me out with debugging it.

For this event:

9:20:16 PM: debug AQUARA-WS RESULT: [name:water, value:dry, descriptionText:${device.displayName} is dry, translatable:true]
9:20:16 PM: debug AQUARA-WS RAW: zone status 0x0000 – extended status 0x00

I have to fix the current DM as the Wet/Dry part was working in the v0.1 DM so it should be an easy fix.

For pushing the button part:

9:20:22 PM: debug AQUARA-WS RESULT: [:]
9:20:22 PM: debug AQUARA-WS UNKNOWN DM: [raw:6C0D0100…1000, dni:6C0D, endpoint:01, cluster:0000, size:7c, attrId:0005, encoding:42, value:6C75…1000]
9:20:22 PM: debug AQUARA-WS DM: [raw:6C0D0100…1000, dni:6C0D, endpoint:01, cluster:0000, size:7c, attrId:0005, encoding:42, value:6C75…1000]
9:20:22 PM: debug AQUARA-WS RAW: read attr - raw: 6C0D0100…1000, dni: 6C0D, endpoint: 01, cluster: 0000, size: 7c, attrId: 0005, encoding: 42, value: 6C756D692E…1000

I have seen this message but as of yet I do not have any idea how to process this information means. Most of this is reverse engineering as there is no document available regarding these sensors. But thanks for sharing this info.

[EDIT] I have updated the DH with the fix. It seems like I had used find replace to replace all instances of {{ with single { which might caused this issue. Have not had a chance to test the change yet, but I think it should be OK

1 Like

Just tested the new code. Seems like it’ll signal back to the hub on wet/dry statuses, but the APP will not reflect it. Here’s what I see in the logs.

016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:05:00 PM: debug AQUARA-WS: Configuring Reporting and Bindings.
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:04:42 PM: debug AQUARA-WS RESULT: [name:water, value:wet, descriptionText:{{device.displayName}} is wet, translatable:true]
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:04:42 PM: debug AQUARA-WS RAW: zone status 0x0001 – extended status 0x00
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:03:14 PM: debug AQUARA-WS RESULT: [name:water, value:dry, descriptionText:{{device.displayName}} is dry, translatable:true]
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:03:14 PM: debug AQUARA-WS RAW: zone status 0x0000 – extended status 0x00
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:02:47 PM: debug AQUARA-WS RESULT: [name:water, value:wet, descriptionText:{{device.displayName}} is wet, translatable:true]
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:02:47 PM: debug AQUARA-WS RAW: zone status 0x0001 – extended status 0x00
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:02:29 PM: debug AQUARA-WS RESULT: [name:water, value:dry, descriptionText:{{device.displayName}} is dry, translatable:true]
016ff3f7-c422-45d6-9c4e-2adb8fd2d8c2 5:02:29 PM: debug AQUARA-WS RAW: zone status 0x0000 – extended status 0x00

Thanks. Came home, tested. It should work fine now. Please update your DH.

1 Like

How long does it take before seeing a battery level? I tried this same device handler yesterday at one point when I was struggling to get the sensor paired. But it wouldn’t turn to the wet state . Reverted back to the smartsense moisture sensor, which doesn’t include battery level. Then I saw Maverick updated the code and tried again. Now the wet and dry work nicely, but no battery level shows up yet. I want to put this on the lid of my sump pump, but battery level would be nice to know I am still protected.

Thanks

Out of my 8 sensors only 1 shows the battery level. Not sure how it happened, but I couldn’t get the battery level for the other 7 to show. The primary function of wet/dry notification on all 8 works now though.

Only 1 out of 4 is reporting battery level for me as well. Also, one sensor I tested immediately after pairing a couple days ago with the smartsense moisture sensor dh is now always showing up as dry, (worked properly initially). I’m going to change the battery out and retest since now both dh yield the same result. Haven’t been able to test the other 2 yet.

Quick update to my post. The battery level appeared overnight (showing 82%). Looks like it showed up about 3 hours after I initially set up the DH with the latest code.

One other question - I was trying to figure out how to add MaverickASC’s github into the IDE for ST (github integration), but I can’t for the life of me get it to show find it. I have added a few others before - so not sure if there is an issue with the repo, or if i am missing something. I noticed that the “path” to it is MaverickASC/MaverickASC/Aquara, and this is a bit different than the others I have successfully added (the repo wasn’t two levels deep).

Mine did too. It took until overnight to show. I’m still having trouble pairing my second one. When I hold the button it stays solid for about 2.5 seconds, then turns off briefly then back on.
Repeat forever (I’ve tried for up to 1.5 minutes). Has anyone else had this issue? Any advice?

My experience has been the same. Battery level showed up over night as well. Additionally, with the SmartSense DH, most of my sensors would be reported as “Unavailable” in a few hours. This has not happened yet, and hope it does. Thanks again @MaverickASC

I found that some sensors are just stubborn. There’s a couple of things that have worked for me:

  1. Holding the button for about a minute where it goes to a series of flashes until it stops. Then holding it again for a shorter period of time until flashing stops. After this, quickly pressing it once should result in 1 large solid followed by 2 quick short flashes.

  2. Holding the button for about a minute where it goes to a series of flashes until it stops. Then holding it again and letting go when its in middle of the 2nd set of flashes.

The point is to get the device in a state where a single quick press results in 1 large solid followed by 2 quick short flashes. In my observations it’s only this state that produces the catchall in the hub logs.

I actually just ended up adding @MaverickASC battery code to a handler I already started working on that has device health and latest check in showing.

2 Likes

That’s great. Would you mind sharing as well?

Just a follow up to my last post. I noted that under my other sensors not reporting battery; there was no info listed under their recent tab.

I removed them from smarthings, re-paired them, applied Maverick’s dh and tested them. Happy to report they all sensed when wet and all are reporting battery levels now after an hour or so.

Thanks Maverick for creating the dh!

I’d also like to try out your device handler.

Thanks!

Blockquote
Follow the reset & pair process:
a. Hold the sensor down for some time till the light flashes and then turns off (takes around 1 minute or so). Key point to note that once you let go you should see a single flash (my unit was not showing this behavior, so i improvised).
b. To complete reset, you need to hold it down again and then wait for the light flash to turn off. Reset completes at this step.
c. Put it in pairing mode, quick press till it flashes, repeat if does not work (in my case it did not work).

if you are having trouble follow these directs for sure
i found with my device I had to hold it down for a full minute until the lights turned off and stayed off.

then i started the device search on my device.

i then tried a basic single click. noting happened.
then i tried holding the button down until there was a multi-light flash – about five seconds – and then it showed in the catch all.

i may have had to do the above 1-2 cycles, but not much more than that!

Good luck!!

I think i have found the secret sauce here. I was able to pair my 3 new sensors and 1 old one which was the stubborn one by this process, under 30 secs each:

RESET:
a. Hold the sensor down for some time till the light flashes and then turns off (takes around 1 minute or so).
b. To complete reset, you need to hold it down again and then wait for the light flash to turn off. Reset completes at this step.

PAIR:
a. Put it in pairing mode, by pressing it for 4-5 seconds till it starts flashing: these are slow flashes 0.5 seconds apart. Then let go the button and you should see a couple of quick flashes and then device goes blank and then after 1-2 seconds flashes again one time (rinse and repeat if you do not see this behavior).
b. This is when it pairs and you should see a the "catchall: " show up followed by a zbjoin.

Couple of things that help:

  1. Turn off harmony hub if on the same network. Produces a lot of unnecessary chatter which may cause you to miss the event or make it harder.
  2. Unplug from power any media players like Smart TV’s (especially Samsung Smart TV), to avoid unnecessary device chatter.
  3. If possible turn OFF 2.5 Ghz band of your Wi-Fi router or Wi-Fi completely during the pairing process. Smarthings hub automatically picks a Zigbee band based on its own algorithm. But I am not sure if unpaired devices can choose a unique band automatically and hence your Wi-Fi MAY be interfering with the pairing process. Once paired I have not seen any communication issues.

NOTE: I also updated the DH with colors for battery levels, device health on the primary tile and a configure option (non-interactive). Also adjusted the fingerprint.

3 Likes

So far, I’ve paired 19 Xiamoi Water sensors with the methods mentioned in this thread. Also I’m using @MaverickASC’s DH and all have the battery level.

Now I am just trying to get updates to show. But so far these have been working out great.