[Release] Xiaomi / Aqara device drivers

community_driver

#363

I hate the Tradfri outlets... No physical power button, too big/block the other outlet, etc.

But they DO work really well with the Xiaomi devices. :slight_smile: My devices have been rock solid with them.

Just a note, you will need to remove/re-pair the Xiaomi devices AFTER the Tradfri outlets are in place. Xiaomi devices don't like changing routes post-pairing.


#364

So in reality you don't hate them. You just dislike their external design. :rofl::joy::sunglasses:


#365

True. I also like their low price. :smile:


#366

Thanks! Is it enough to "re-find" the devices or should I completely remove the devices and start from scratch (which means I'd have to re-do all the apps that use them)?


#367

You can manually re-join them. No need to start over from scratch.

If the issue is Xiaomi products dropping off the network after a few hours, it's most likely not a mesh issue, but rather the refuse-to-rejoin-after-timeout issue that I described in layman's terms in this recent post.

Absent poor signal strength or mesh interference, I would look at what ZigBee devices are on the network that act as repeaters. Do you have any?


#368

Luckily. I didn't have to do that with mine. I just replaced my sylvania outlets with the tradfri outlets and they jumped over. Not all at once but over the course of the day they all started checking in through various other repeaters. I had the xbee scanner running and could actually see them moving around as I left it running. Worst case scenario for a couple I wanted up right away, I either pressed the button or held it to force it and it did its thing.


#369

Hmmmm... I'm misunderstanding. I did read your explanatory post and thought the conclusion was that moving all the Xiaomi products to repeat through Tradfrì outlets would fix the mesh issue. Perhaps I'm calling the refuse-to-join problem a "mesh issue" and you are more discriminatory in your terminology?

I'm hoping that inserting Tradfrì outlets will solve my problem. Do you think that's the case?

I do have plenty of other regular Zigbee repeaters. But, as an example, due to the reputation of the Osram string lights, I've kept them on my ST mesh to isolate then away from everything else, including the Xiaomis, on my Hubitat zigbee mesh.


#370

Not necessarily.

By design, devices on a ZigBee negotiate the route of their connection without user interaction. Using an XBee, I've watched as ZigBee end devices (which cannot act as routers themselves) change their route through one repeater, then a different repeater, and then back to the first repeater. As I understand it, which repeater an end device connects through is determined mainly by the signal strength, relative to that of other nearby repeaters.

So other than making sure incompatible repeaters are distant enough, there's no way to control which repeater (on the same ZigBee network) your Xiaomi / Aqara devices (or any end other devices) will route through.

Also, when I say "incompatible" repeaters, it's not always just because they get "impatient" waiting for Xiaomi / Aqara devices to check in. I have witnessed and read about a host of other issues such as difficulty during pairing, devices never getting past the initialization stage of pairing, and also messages not being sent through to the hub.

Bottom line, you want to make sure there's no way your Xiaomi / Aqara devices will connect through an incompatible repeater. This can be accomplished in three ways:

  1. Don't use any incompatible repeaters at all.
  2. Make sure incompatible repeaters are distant enough that Xiaomi / Aqara devices don't route through them. Only an XBee or ZigBee sniffer can help verify this.
  3. "Sandbox" your Xiaomi / Aqara devices on a different hub (e.g., a second Hubitat, or another home automation solution that works with Xiaomi / Aqara devices - but preferably not a SmartThings hub because too much functionality can be lost)

Pros and Cons of Xiaomi Zigbee Devices
#371

Just received my vibration sensor. Ordered December 6 :roll_eyes:
Is 0.7b the most up to date beta I should be using?

Curious why there are also contact, motion and pushable button capabilities in the driver?


#372

Where did you order it?


#373

Gearbest. They say it was because of the Canada Post strike, and while it's true that it was still on for a few days after they sent it, it didn't even enter Canada during the strike period, so total BS.

I even paid the slightly higher price for the Canada Line shipping, which in the past has been about 15 days. The contact sensor I ordered a month after that had to go through Switzerland got here in 3 weeks!


#374

I ordered my 8 contacts, 2 cubes and one motion Aqara in Ali Express, lets see how long takes, at least they are on the carrier. Most orders has been like one month for delivery.


#375

It's... complicated. :rofl:

From my version 0.7b release notes post:

The sensor has so many different functions that I had to use a range of capabilities to accommodate all of them.

Of course the funny thing to me is that so far in my experience the one thing this sensor doesn't do well is its namesake. It should be called a tilt/shock sensor.


#376

@veeceeoh This is working great! Most of the time it's vibration because it is soooo sensitive to that. I'm actually thinking this might just work for my washer. The one I received seems to detect the slightest vibration. Tilt is working, although the numbers jump around a bit. I'm wondering if I test it with an angle gauge how accurate it is. Did detect drop a few times, but hard to get that reading because of its sensitivity to vibration.

In any case, great job on the driver once again. Thank you so much!


#377

Unfortunately, I think my two sensors arrived with the sensitivity setting at "Low", and until I figure out how to get the driver to send the right command to change the setting, I'm stuck with a sensor that detects nothing when half my house shakes on my washer's spin cycle! :rofl:


#378

Wow, I really lucked out then. This is working exactly like I had hoped.


#379

Mine are similar .... you can fist-thump the desk that they are sat on and they don't seem to register anything (unless you thump really hard) ... but tilt / move they seem pretty sensitive. I've had some success with using them as a chair occupancy sensor on a wheelie / gas strut office type chair.


#380

@veeceeoh I deployed one of the vibration sensors to be used as an open / close sensor on a lift up lid on a storage cupboard where closed is approximately horizontal and open is approximately vertical.

I set the closed position successfully, then opened the lid and set the open position successfully. Upon shutting the lid though I got an error and the contact state is stuck at open.

I'm running 0.7b, logs below:

dev:122 2019-02-03 13:54:36.722 info V1: Motion reset to inactive after 65 seconds
dev:122 2019-02-03 13:54:36.721 info V1: Sensor is stationary
dev:122 2019-02-03 13:53:31.692 info V1: Vibration/movement detected (Motion active)
dev:122 2019-02-03 13:18:02.521 info V1: Recent activity level reported at 40
dev:122 2019-02-03 13:17:40.050 info V1: Motion reset to inactive after 65 seconds
dev:122 2019-02-03 13:17:40.049 info V1: Sensor is stationary
dev:122 2019-02-03 13:16:40.634 error groovy.lang.MissingMethodException: No signature of method: static java.lang.Float.parseFloat() is applicable for argument types: (java.math.BigDecimal) values: [2.1] Possible solutions: parseFloat(java.lang.String) on line 155 (parse)
dev:122 2019-02-03 13:16:35.022 info V1: Vibration/movement detected (Motion active)
dev:122 2019-02-03 13:16:32.770 info V1: Acceleration reset to inactive
dev:122 2019-02-03 13:16:32.766 info V1: Sensor is stationary
dev:122 2019-02-03 13:16:30.745 info V1: Tilt detected (Acceleration active)
dev:122 2019-02-03 13:16:30.741 info V1: Tilt angle changed by 21°
dev:122 2019-02-03 13:13:02.731 info V1: Battery level is 50% (2.975 Volts)
dev:122 2019-02-03 13:13:01.499 info V1: Recent activity level reported at 18
dev:122 2019-02-03 13:10:33.385 info V1: Open position successfully set
dev:122 2019-02-03 13:10:33.383 info V1: Calculated position is open
dev:122 2019-02-03 13:10:11.606 info V1: Motion reset to inactive after 65 seconds
dev:122 2019-02-03 13:10:11.601 info V1: Sensor is stationary
dev:122 2019-02-03 13:09:15.013 info V1: Open/Closed position is unknown because Open and/or Closed positions have not been set
dev:122 2019-02-03 13:09:10.679 info V1: Acceleration reset to inactive
dev:122 2019-02-03 13:09:08.643 info V1: Tilt detected (Acceleration active)
dev:122 2019-02-03 13:09:08.640 info V1: Tilt angle changed by 66°
dev:122 2019-02-03 13:09:06.568 info V1: Vibration/movement detected (Motion active)
dev:122 2019-02-03 12:52:17.734 info V1: Recent activity level reported at 13
dev:122 2019-02-03 12:21:04.759 info V1: Battery level is 50% (2.975 Volts)
dev:122 2019-02-03 12:21:03.536 info V1: Recent activity level reported at 12
dev:122 2019-02-03 11:21:53.791 info V1: Battery level is 50% (2.975 Volts)
dev:122 2019-02-03 10:54:02.656 info V1: Recent activity level reported at 5


#381

Thanks for the report! I have fixed that issue:

[BETA] v0.7.1b of Aqara Vibration Sensor Device Driver

The updated beta device driver code can be found here.

Detailed Change List

  • Fixed errors in open/close position function by removing all forced unneeded float objects in convertAccelValues(), setClosedPosition(), and setOpenPosition()

#382

Still seems to be the same error for me :frowning:

I double checked to make sure I'd updated the driver and it definitely says 0.7.1b at the top.

dev:122 2019-02-04 13:14:37.992 info V1: Recent activity level reported at 28
dev:122 2019-02-04 13:11:46.864 info V1: Motion reset to inactive after 65 seconds
dev:122 2019-02-04 13:11:46.860 info V1: Sensor is stationary
dev:122 2019-02-04 13:10:55.816 error groovy.lang.MissingMethodException: No signature of method: static java.lang.Float.parseFloat() is applicable for argument types: (java.math.BigDecimal) values: [2.1] Possible solutions: parseFloat(java.lang.String) on line 155 (parse)
dev:122 2019-02-04 13:10:53.557 info V1: Drop detected (Button pushed)
dev:122 2019-02-04 13:10:47.053 info V1: Acceleration reset to inactive
dev:122 2019-02-04 13:10:45.025 info V1: Tilt detected (Acceleration active)
dev:122 2019-02-04 13:10:45.023 info V1: Tilt angle changed by 26°
dev:122 2019-02-04 13:10:41.840 info V1: Vibration/movement detected (Motion active)