[OBSOLETE] Xiaomi Sensors and Button (beta)

Except battery readings everythings else works after I followed your above steps and here is the output… :



Battery Changed info ??

Awesome …thanks @ArstenA @veeceeoh for your patience and support

1 Like

If they are Aqara Temp/Humidity sensors you can get the battery reading immediately with a SHORT-press of the reset button on the sensor itself (the same button used for pairing).

That will result in the sensor sending a special announcement message to the hub, and @ArstenA’s device handler will read the battery report in that message and it should update instantly in your SmartThings mobile app.

Just curious - was the timezone already set, or did you just set it now?

EST timezone was set and it was set after @ArstenA post.

After reset I did not configure that part - my bad

It worked .Does it get auto updated or we need to do this STEP every time to get the battery readings.

any idea why this error occurs -

Sensor 02: Parsing description: read attr - raw:

Great to hear!

On Aqara devices, a battery report is sent to the hub every 50 minutes. So now that the device handler is working correctly, you should see the next battery report in 50 or less minutes. So you don’t have to push the button to get the battery report again, until you replace the battery (which probably means re-pairing the sensor, and the SmartThings hub always misses the Xiaomi sensors’ initial battery report during pairing).

If you saw the message [debug] Sensor 02: Parsing description: read attr - raw: etc. at the same time when you pushed the reset button, that’s completely normal. The SmarThings hub sees the special announcement message as a “raw read attributes” message, and the device handler code tells the Live Log to add that debug message so the person who wrote the code knows that it’s working and can see other user’s logs and tell what’s going on.

You’ll also see that Parsing description: read attr - raw: etc., message along with a parseReadAttr: message every time the sensor sends a pressure report. In fact I see those messages in the log screenshot after you got the devices working.

1 Like

thank you …

I’ll read more later but just a quick note…yes when I changed to the ST temperature sensor it shows in the app! When I use the DH it does not. I’ll have to get to work now but hey it’s progress :slight_smile:

@cowboysdude :+1:

TL;DR = @busybeee 's ST hub’s timezone wasn’t set - setting it fixed his problems and the @ArstenA/bspranger device handler is working now.

You should try doing the same.

YOU are right…I didn’t have my location set!!! As soon as did that it works!! THANK YOU so much for your patience…

NOW I’m actually going to try and pair one NOT using catchall… but actually in the catchall they’ve been reporting all day…I’ve checked them while at work several times…they seem to be updating…

But I do get this in living logging when I hit the refresh button:

3:07:39 PM: error java.lang.IllegalArgumentException: Needs to be string or int, received null value: null
2831ad41-7d74-4ffa-83e8-bc3493a3ab32 3:07:39 PM: debug FRS: Configured health checkInterval when refresh()
2831ad41-7d74-4ffa-83e8-bc3493a3ab32 3:07:39 PM: debug FRS: refreshing

2 Likes

All the refresh button does is re-configured the Device Health Check time interval to every 2hours, 2 minutes. As I understand it, it’s only used when DeviceHealth is turned on in your SmartThings mobile app (click the “More” button at the lower-right, and it’s the 4th item down:

However, for now, I recommend turning off DeviceHealth, because it’s not fully stable from what I’ve read, and can incorrectly report some devices as “offline” and after that happens you can only get them back by re-pairing.

The java.lang.IllegalArgumentException has to do with the code looking for your hub’s hardware ID, but for some reason it must be blank in your case, which causes the null error. (“null” means the information you’re trying to retrieve has no value or is blank.)

I am still doing research on the Device Health issues, and may recommend the refresh button be removed completely from the Xiaomi device handlers, because if the Device Health code is removed, the button has no function.

TL;DR = Turn off DeviceHealth in your mobile app settings, and currently there’s no need to use the “refresh” button in the SmartThings mobile app for your Xiaomi sensors.

1 Like

Oh ok sounds great!! All is working and updating perfectly now!! Using the DH suggested! Everything is showing up…who knew that all the issue was just as simple as setting your location… :slight_smile:

1 Like

We have tried to resolve the time zone issue and may have a solution that needs to be implemented.

2 Likes

So - question here - suppose you decided you wanted to try rebuilding your zigbee mesh - 'cause you have new routers or whatever and are hoping that Xiaomis will find other routers (like the Xbee).

The regular wisdom is you turn off your router for 15-20 minutes - every end device wakes up and finds its best new parent.

But what if you’re a Xiaomi that only checks in every 50/55/60 minutes (depending on device). Wouldn’t you just go back to your original after 20 minutes?

Rabbit hole…

Perhaps you can look at their last check in and plan your outage during that checkin?

Good idea - I’ll map their check in times and try shut down during a period when at least 2 or 3 are checking in … all for research :slight_smile:

This may have been addressed somewhere else, but I’ve read through several thousand posts commenting and helping the main two people developing the DHs for these Things.

I appreciate the heck out of all the work put into the DHs that allow us to use these non-ST supported Things! You guys are great!

Anyway, I’ve used the DHs developed by both @a4refillpad and @ArstenA (bspranger) and can’t for the life of me figure out why no one has mentioned changing the Thing button colors under the Thing list in the Smartthings App so it blends in with the other Things and states in the list.

This seems to only apply to a4refillpad’s Button DH, not sure about the others, but should be finding out in a week or so when some other Xiaomi items arrive.

I was going to try to do the Gethub pull/push thing to help, but since I’m new-ish to Smartthings and have minimal experience with Gethub, I figured I’d put the change I did here and anyone who wants to, can change theirs or update the DHs available if it’s seen as worthy.

Somewhere between line 55 and about line 80, depending on the DH you’re using (mentioned above), if you change the background color attributes to the ones shown below, they seem to match the ST App color scheme, of course YMMV. Maybe others will like it as well.

           		attributeState("on", label:' push', action: "momentary.push", backgroundColor:"#00A0DC")
        	attributeState("off", label:' push', action: "momentary.push", backgroundColor:"#ffffff", nextState: "on")

My next step is trying to get the actual data the sensors put out.

I would like to build a module for the MagicMirror2 to display that info on it.

Suggestion for a start point?

Thank you all!

Boom.

1 Like