[RELEASE] Xiaomi Drivers with Health Status and Zigbee2MQTT

how about adding temp and humidity offset to the driver..

also not getting any battery readings does it take a while?

@birdslikewires

I messed about with this, but with limited success. Changing the behaviour of the device isn't something which is exposed in the official product, perhaps the feature is buggy or unfinished.

It's possible to hide such readings with the driver, but what would be the point? The messages are still sent, received and processed before being discarded. I don't really see such "smoothing" as the responsibility of the driver.

Sounds like you have a dodgy sensor. There should be no need for offsetting. Who's to say the offset is linear throughout the scale?

Yes. The devices send the battery report when the feel like it, usually every hour or so.

1 Like

it is not smoothing.. it is that the sensor is not usefull with incorrect temps .. i use a digital surface thermometer to verify and without offsets it is not usuable in my wine fridge.. no bigee though i found another driver that does offer that.. and have it working.. dont need the other features anyway.. but if you want i can add the code as i have in the past. .it would not be a feature obviously built it but adjustments would be done internally in the driver before posting the temp event.

No, I was referring to @marcaronson408's message there.

Glad you're sorted. Thanks for the offer, but I'd still question the accuracy of your device if you need an offset. But remember, the sensor isn't sampling a surface temperature but an ambient air temperature, so you will have differences using two alternate means of measurement.

I want to add a comment to the discussion - no doubt like so many others, i've experienced a lot in and around the environmental management capability of my smart home.
I wrote a small document somewhere previously, discussing the variations in sensor location placement. Regardless if the device is reporting accurately (an issue all to itself) there is also the variable of position within a room. EG; if I pull temperature from my ceiling PIR, I get 78.2. When measured with a surface thermometer it is very accurate. At the floor of the same room I have an Aquara against the floor, and touching an outside wall. When it snows, my feet get cold! The sensor at the floor would report 69.3. Again, I checked the accuracy with a surface thermometer and luckily the Aquara was very accurate as well.
One could use the Average + app by @bptworld (I think) however this didn't fix me for rules about the floor heater and the aquara.
On my desk is a thermometer and it says 71.4. For me, I ignore the value of the floor sensor,(only using it specifically for my office floor heater rule) and 'offset' the ceiling sensor 7 degrees lower. In this way, my tiles and rules 'see' the room temp at or near what I feel.
Offset really is a useful feature in a temp sensor/driver.

@birdslikewires Switch to your driver (via HPM) for a few WXKG11LM but get the following error on all of them.

warn Ellas knapp fönsterlampa : Received : endpoint: 01, cluster: 0012, clusterId: null, attrId: 0055, command: 0A with value: 0100 and data: null
warn Ellas knapp fönsterlampa : UNKNOWN DATA! Please report these messages to the developer.

I have hit CONFIGURE after changing driver. I have also removed one device completely and re-added with same result.

Any idea?

That's interesting, not seen cluster 0012 reported on any of my '11LMs, though I have seen it on other devices. Could you tell me:

  • When does it happen - when a particular press is made, randomly or at set intervals?
  • Does the device work despite the warning?

The error happens when I press the button.
The buttons didn’t work.

I just tried the 12LM driver and it works fine with that driver. I have triple checked the back side of the buttons and they say 11LM…

That is very odd.

Do you get all of the functions of the 12LM? I think the easiest one to check for would be the accelerometer. Take a look at the device page and log output while you shake the button!

If you get an "active" reading on the accelerometer and button 6 is "pressed" then you've got a 12LM in an 11LM case. Or... somebody has put the wrong battery cover on. :slight_smile:

No, I do not get any other functionality than button 1. I tried shaking the device but no accelerometer showing up in the device tab or in the log.

Last quiz questions! :wink:

  • What is shown as the model in the Data section of the Device page?
  • Is the device recently purchased, or recently added and removed from a Xiaomi hub?

Models for me '11LM being "lumi.sensor_switch.aq2" and '12LMs are "lumi.sensor_swit".

Second question is pondering whether there's been new firmware released.

All 4 buttons show:

  • model: lumi.remote.b1acn01
  • physicalButtons: 1
  • application: 02
  • driver: v1.0.1.1123
  • manufacturer: LUMI

I have had the buttons for about two years and they have never been paired to a Aqaba/Xiaomi, don’t own one.

Ah, well, would you look at that.

Known about in the veeceeoh drivers, I must have some earlier revision units here.

Keep using the '12LM driver for now and let me know of any errors. I may try to merge the two drivers, there should be enough which is similar, the real trick is that the driver may end up presenting features which aren't available on all units, which is always a source of frustration when configuring behaviours and automation. If I can work around that then I may well do it.

Looks like my model names are being truncated somewhere too.

2 Likes

I switched to the veeceeoh drivers for my new revision of the 11LM. I can send you the “send to dev” strings for all the events from your driver if you want. They seem pretty straightforward and I was going to submit a PR to your driver until you pointed me to the veeeceeoh ones. =p

1 Like

Hold doesn't seem to work. Push and double tap work as it should though.

@birdslikewires Do you think it’s possible to get Hold working on my 11LM buttons using the 12LM driver?

If it’s sending the right messages, yes. Can you turn on the debug and trace logs, press and hold and send the log output here?

I hope this helps. Let me know if you need anything else.

Log

@birdslikewires Do you need any other info for getting hold to work?

Someone on here once said that they were still waiting for the 36 hour days they'd ordered from Amazon to arrive. I think my order is also still outstanding. :wink:

There's an updated version of the WXKG12LM driver which now contains support for the WXKG11LM. It's pointless maintaining them separately now given the r2 has the hold and release function; the reason to keep them separate was to avoid presenting functionality that the device didn't support, but if that now involves maintaining three almost identical drivers then my principles can go jump.

To try this out, first make sure you are running HPM v1.8.7. Then check for updates and install the WXKG12LM update. If you've installed manually you will now need to add my library code like this:

  • Download library.zip
  • Install using Developer Tools > Bundles > Import ZIP

Then you can update the WXKG12LM code to v1.04.

Clearly I don't have a WXKG11LMr2 to test with, so please check that the hold, release and level values are being updated as expected.

2 Likes