[Release] Xiaomi / Aqara / Opple Drivers with Presence!

To get support for this driver you're going to have to post this on their forums. Look at Markus' profile pic.

1 Like

You should try to use the "Zigbee - Generic Device Toolbox" driver to wipe the states clean and then give @chirpy's driver a go. :slight_smile:
"Zigbee - Generic Device Toolbox" can be installed via the HPM.

3 Likes

I am seeing an error with the Aqara Vibration Sensor when I try to set the Open and or Closed position.

errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '9.1' with class 'java.lang.String' to class 'java.math.BigDecimal' on line 475 (setClosedPosition)

1 Like

I had something similar when switching between different drivers from Markus and other ones.
Install Markus's Zigbee - Generic Device Toolbox driver, change to that and delete all the various bits you can delete and then switch back to the driver you want to use

I have the exact same problem as @ericreed and already used @markus' Generic Device Toolbox.

Unfortunally nothing has changed, the GroovyCastException (line 475) is still raising. :cry:

BTW: Changing the sensitivityLevel is also not working (but without any error message).

Is the error with Markus's driver or the one from chirpy?

If it's Markus's it likely won't be fixed anytime soon as he doesn't have access to the latest firmware. So in that case just try the driver from chirpy.

The reason I was getting the error was because I changed drivers and somehow code from the old driver was left over. When I searched for the code that the error was complaining about the code wasn't actually there so I knew that it wasn't a problem with the code, just some left over stuff from swapping in between drivers.

So can you have a look at the code and see if it actually a problem in the driver itself.
If it's actually a problem with the driver and it's chirpy's one he will likely fix it very quickly

I'm using Markus's driver.

BTW: IMHO @chirpy's driver has no option to set the Open and or Closed position.

I'm not at my computer at the moment so I can't have a look at the code but it likely is a bug in the code, either because of something changed from the Hubitat firmware or a bug that was there.

I'd suggest trying the other forum they Markus uses but I personally haven't had luck getting him to fix a different bug with the wired switches.

As chirpy is actively maintaining his driver I'd suggest if that's the only thing missing that you make a request for him to add that feature.

I personally don't have the vibration sensor so my help unfortunately can't be that specific

2 Likes

I've had a look at the code and at the error in detail and I'm very new to groovy but according to the documentation I found the problem is that a float type number (9.1 in the error reported by @ericreed) which is being stored as a string is trying to get converted to a BigDecimal type.
BigDecimal seems to only accept whole numbers.

So there's 2 ways to fix Markus' driver as I can tell. Figure out where the 9.1 comes from and round that down to 9 before it gets to line 475 or potentially change the type from BigDecimal to something that supports floating point numbers.

Apologies again as I can't be more helpful. While I am a software developer I am slowly starting to learn groovy.

BigDecimal is a floating decimal type, and by definition supports a string to BigDecimal conversion (actually prefers it over float) ....

1 Like

That's interesting.

Any idea why then the error would come up?
Cannot cast object '9.1' with class 'java.lang.String' to class 'java.math.BigDecimal'

To me that says it's trying to convert from float stored as a string to BigDecimal but it can't do that

This seems to be the line causing that error:

BigDecimal cX = device.currentState("currentX")?.value

link to line in driver code

Groovy should have handled it, but you can always force it using the Java syntax:

BigDecimal cX = new BigDecimal(device.currentState("currentX")?.value)

I updated the code with your recommended fix and it works. (I think). I updated 6 lines, both open and close positions.

2 Likes

Hey, did you ever manage to find a workaround for this? I am seeing the same on on the QBKG03LM.

Erm, yes. But you’re not going to like it.

I bought an Aqara M2 hub. :grimacing:

I know.

But it's excellent.

For the issue at hand it should be a simple fix in the driver to properly assign the child devices. Well, a simple fix for someone who's worked out how the child device allocation works in these drivers, which I haven't. IIRC it is flexibly assigned unless there's something hard-coded for specific models. Sorry to not be of more help. :slightly_frowning_face:

As for why the M2, when I added some repeating wall dimmers recently the mesh collapsed and all the Aqara devices scuttled off again. After nearly three years fighting with them I realised their hubs now support offline HomeKit and the M2 has a wired ethernet port.

Given everyone in this house gets on well with the HomeKit dashboard (and we have some Hive gear which is only controllable through HomeKit unless you use their annoying app) it seemed like the stars had aligned.

Oh, and of course I'm using the excellent Homebridge Hubitat plugin, which exposes anything I like (except for buttons :sob:) from the two Hubitat hubs to HomeKit as well. The speed of control is amazing.

2 Likes

In my system logs I repeatedly find:

[sys:1] Unable to execute hubAction:delay 2000 sent from Switch Cocina, invalid or unspecified protocol.

[sys:1] Unable to execute hubAction:delay 2000 sent from Botón Mi 1, invalid or unspecified protocol.

This happens every 25 minutes (roughly). Both devices are Xiaomi / Aqara. The first one is a wireless Aqara wall switch. The second one, a Xiaomi Wireless button.

Both work perfectly and never had an issue with them.

Any clue of what may be going on?

I use to see that when using Markus’ driver.

So what are you using now?

1 Like

I really liked Markus’ driver, but since it is no longer being maintained and the system throws errors, I’ve switched to this one:

3 Likes

Hi just paired D1 wireless double switch WXKG07LM and this kind of logs:

    dev:72021-03-07 16:53:22.146 infoButton 2 was pushed
    dev:72021-03-07 16:53:22.140 infoMultistate - endpoint: 2, taps: 0, physicalButton: 2, physicalButtons: 0, button: 2
    dev:72021-03-07 16:53:22.132 infoMultistate - description:read attr - raw: 4E490200120A5500210000, dni: 4E49, endpoint: 02, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0000 | parseMap:[raw:4E490200120A5500210000, dni:4E49, endpoint:02, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0000, clusterInt:18, attrInt:85, valueParsed:0]
    dev:72021-03-07 16:53:20.313 warnUnknown model (lumi.remote.b286acn02) - PLEASE REPORT THIS LOG TO THE DEV - description:read attr - raw: 4E490200120A5500210200, dni: 4E49, endpoint: 02, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0200 | parseMap:[raw:4E490200120A5500210200, dni:4E49, endpoint:02, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0002, clusterInt:18, attrInt:85, valueParsed:2]
    dev:72021-03-07 16:53:20.303 infoButton 2 was double tapped
    dev:72021-03-07 16:53:20.298 infoButton 2 was pushed
    dev:72021-03-07 16:53:20.293 infoMultistate - endpoint: 2, taps: 2, physicalButton: 2, physicalButtons: 0, button: 2
    dev:72021-03-07 16:53:20.286 infoMultistate - description:read attr - raw: 4E490200120A5500210200, dni: 4E49, endpoint: 02, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0200 | parseMap:[raw:4E490200120A5500210200, dni:4E49, endpoint:02, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0002, clusterInt:18, attrInt:85, valueParsed:2]
    dev:72021-03-07 16:53:18.517 warnUnknown model (lumi.remote.b286acn02) - PLEASE REPORT THIS LOG TO THE DEV - description:read attr - raw: 4E490200120A5500210100, dni: 4E49, endpoint: 02, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0100 | parseMap:[raw:4E490200120A5500210100, dni:4E49, endpoint:02, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0001, clusterInt:18, attrInt:85, valueParsed:1]
    dev:72021-03-07 16:53:18.509 infoButton 2 was pushed
    dev:72021-03-07 16:53:18.505 infoMultistate - endpoint: 2, taps: 1, physicalButton: 2, physicalButtons: 0, button: 2
    dev:72021-03-07 16:53:18.478 infoMultistate - description:read attr - raw: 4E490200120A5500210100, dni: 4E49, endpoint: 02, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0100 | parseMap:[raw:4E490200120A5500210100, dni:4E49, endpoint:02, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0001, clusterInt:18, attrInt:85, valueParsed:1]
    dev:72021-03-07 16:53:14.365 warnUnknown model (lumi.remote.b286acn02) - PLEASE REPORT THIS LOG TO THE DEV - description:read attr - raw: 4E490100120A5500210000, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0000 | parseMap:[raw:4E490100120A5500210000, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0000, clusterInt:18, attrInt:85, valueParsed:0]
    dev:72021-03-07 16:53:14.359 infoButton 1 was pushed
    dev:72021-03-07 16:53:14.353 infoMultistate - endpoint: 1, taps: 0, physicalButton: 1, physicalButtons: 0, button: 1
    dev:72021-03-07 16:53:14.334 infoMultistate - description:read attr - raw: 4E490100120A5500210000, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0000 | parseMap:[raw:4E490100120A5500210000, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0000, clusterInt:18, attrInt:85, valueParsed:0]
    dev:72021-03-07 16:53:11.571 warnUnknown model (lumi.remote.b286acn02) - PLEASE REPORT THIS LOG TO THE DEV - description:read attr - raw: 4E490100120A5500210200, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0200 | parseMap:[raw:4E490100120A5500210200, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0002, clusterInt:18, attrInt:85, valueParsed:2]
    dev:72021-03-07 16:53:11.554 infoButton 1 was double tapped
    dev:72021-03-07 16:53:11.548 infoButton 1 was pushed
    dev:72021-03-07 16:53:11.542 infoMultistate - endpoint: 1, taps: 2, physicalButton: 1, physicalButtons: 0, button: 1
    dev:72021-03-07 16:53:11.535 infoMultistate - description:read attr - raw: 4E490100120A5500210200, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0200 | parseMap:[raw:4E490100120A5500210200, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0002, clusterInt:18, attrInt:85, valueParsed:2]
    dev:72021-03-07 16:53:09.251 warnUnknown model (lumi.remote.b286acn02) - PLEASE REPORT THIS LOG TO THE DEV - description:read attr - raw: 4E490100120A5500210100, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0100 | parseMap:[raw:4E490100120A5500210100, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0001, clusterInt:18, attrInt:85, valueParsed:1]
    dev:72021-03-07 16:53:09.242 infoButton 1 was pushed
    dev:72021-03-07 16:53:09.236 infoMultistate - endpoint: 1, taps: 1, physicalButton: 1, physicalButtons: 0, button: 1
    dev:72021-03-07 16:53:09.228 infoMultistate - description:read attr - raw: 4E490100120A5500210100, dni: 4E49, endpoint: 01, cluster: 0012, size: 0A, attrId: 0055, encoding: 21, command: 0A, value: 0100 | parseMap:[raw:4E490100120A5500210100, dni:4E49, endpoint:01, cluster:0012, size:0A, attrId:0055, encoding:21, command:0A, value:0001, clusterInt:18, attrInt:85, valueParsed:1]

The driver version is v1.0.1.1123 and sequence what I used in logs is

  • one tap with left switch
  • double tap with left switch
  • long press with left switch
  • and same with right switch

I don't know what those logs mean and why it shows that the device is unknown?

Download the Hubitat app