Xiaomi Aqara Mini Switch doesn't show switch

Thanks @Jc2k , Any update? Does the latest version now support the “stateless programmable switch”, I am still looking for the solution. As I have two Aqara mini switich and one xiaomi cube switch, I can’t use it now.

2 Likes

As per last update, 0.107.0 now supports events. I’ve also had good feedback on users with Aqara gateways and sensors like motion sensors. Unfortunately some other devices don’t have very robust HK implementations so i’ve spent most of 0.108.0 answering support tickets. At this point i don’t think “stateless programmable switch” support will be in 0.108.x unfortunately.

It’s next on my todo, though. I’ve had a rough and ready PR working but it needs some refactoring as entity-less event sources aren’t something homekit_controller has had to deal with before.

Yes, in current version there is no stateless programmable switch support yet.
We are looking forward to hearing from you! Thank you for your work!

Hi!
What about stateless programmable switch support in 0.109x ?
Thank you!

Again, Thanks @Jc2k, sorry for keep bothering you. But I am a newbie to HA, I have no other way to use thoese stateless programmable swith, maybe I think I can use xiaomi gateway without Homekit suppport. But I am not sure if it possible, even that work, I need to repaired all the sensor and switch to the new xiaomi gateway, and maybe lot of work to make it work with siri. So I prefer to wait the new version of HA to support it, as I have all these device from Aqara support homekit.
BTW, if there is HA release note anywhere? So I can check the new feature by myself.

When you go on the main website there is a wite box on the left hand side that says “Current Version”. In that box there is a link that says “Release Notes”. Click on it. Right now it points to the release notes for 0.109 which are here. You can search for homekit_controller to find stuff that might be related to this.

Right now you won’t find anything. After the massive push at the start of the year (arguably used more time than i actually had to give) i’ve run out of free time and what I do have is currently going on triaging bug reports (especially regressions), not new features. E.g. last night another Aqara user was having trouble with unstable async connections. We found the Aqara can’t handle the level of concurrency we used by default and when I have time i’ll be putting in a PR for that bug.

With where we are in the release cycle, the lack of anyone else contributing to homekit_controller, and my crippling lack of free time I can’t tell you when the change will land. I would say it almost certainly won’t be in 0.110.

But it is a feature that is coming. It is the priority new feature. I have this type of device myself and i want it to work with Home Assistant. I got a prototype working already. The problem is really just one of refactoring the prototype so that it is suitable for code review (it took shortcuts that aren’t of sufficient quality).

If it’s of any interest I got a couple of these switches recently (these ones, right?) and when paired with the Xiaomi gateway they appear as binary sensors. They work fine, I have a couple of automations detecting double clicks and long_click_press.

Hi @thoughton

Which version of the button do you have? Mine says on the back WXKG11LM

BR

Either my eyes are getting worse or those numbers are a bit faint! Yes, it’s the same model WXKG11LM.

OK I have the same, but just now realized you have a Xiaomi-Hub and not an Aqara-Hub. I added it via the Homekit-Controller --> https://www.home-assistant.io/integrations/homekit_controller/
You’ve probably added it via the Xiaomi-Integration, right? --> https://www.home-assistant.io/integrations/xiaomi_aqara/

OK for anyone who wants a stupid solution :smiley:

I create in the Aqara-App for each button-event i want to check an automation, each sets the Aqara-Hub-Light to a different brightness level, waits 1s, and turns it off again. And then I check in HA for the brightness-level, and thus i know which button was clicked.
Here’s my table for a Switch with 2 buttons, first is the brightness in the Aqara-App and second is the one in HA since in HA its from 0-255:

Single-L: 20 / 51
Double-L: 21 / 53.55
Long-L: 22 / 56.1
Single-R: 25 / 63.75
Double-R: 26 / 66.3
Long-R: 27 / 68.85

And then just create a template-sensor:

        tmpl_button2:
            friendly_name: "Button 2"
            value_template: >-
                {% if state_attr('light.aqara_hub_eab7', 'brightness') == 51 %}
                  Links_Klick
                {% elif state_attr('light.aqara_hub_eab7', 'brightness') == 53.55 %}
                  Links_Klick-Doppel
                {% elif state_attr('light.aqara_hub_eab7', 'brightness') == 56.1 %}
                  Links_Klick-Lang
                {% elif state_attr('light.aqara_hub_eab7', 'brightness') == 63.75 %}
                  Rechts_Klick
                {% elif state_attr('light.aqara_hub_eab7', 'brightness') == 66.3 %}
                  Rechts_Klick-Doppel
                {% elif state_attr('light.aqara_hub_eab7', 'brightness') == 68.85 %}
                  Rechts_Klick-Lang
                {% else %}
                  Fertig
                {% endif %}

Works so far, delay of ~1s to turn on a light :slight_smile:

1 Like

Thats brilliant! If it works its not stupid :smile:

Any news? Will it drop in 0.111.x?

Hey, I tried your setup and it kinda works for me, I adjust the brightness the same way you did, but sometimes the template sensor misbehaves, sometimes when I click once it will says Single_Click (working good) but then I would double click and it will still says Single_Click, then after a few presses it will change to Double_Click, (thinking it finally work but…) if I press the button once, it will still say Double_Click on the template sensor! Any insights on this?

I have the same issue. My Aqara switch is connected via a HUSBZB-1 though.

I open to suggestions as well.

I have now Zigbee2MQTT, but what I did was, I set the Hub-Light on, and then i check in HA for the brightness, then set the brightness to a default value, and then turn it of in the HA-Automation rather than on the Aqara-Automation. So it’s as long/short turn on as needed. Better then a set amount of time.
If you don’t set the brightness back to default, next time you turn the light on, for a short time it’s the old value.

Do you use Zigbee2MQTT? The Swtiches of Aqara are supported by it, so it should work normally.

I don’t, I use the ZHA integration with a HUSBZB-1. I thought the button was supposed to show up as switches, instead it just shows up as remote, and a battery sensor. I have had the HUSBZB-1 for a long time but I am just now getting around to trying it out.

I noticed on the remote that I could create an automation with it, started one and ended up with the below yaml code. Works great.

  - alias: 'Toggle Bedroom Fan'
    trigger: 
      - platform: device
        device_id: redacted
        domain: zha
        type: remote_button_short_press
        subtype: remote_button_short_press
    action:
      - service: fan.toggle
        entity_id: fan.bedroom_fan

The xiaomi normal wifi switch also only shows as battery sensors, hence not working either. Unfortunately that is a show stopper for me as I use the switches to connect other pieces that not part of the xiaomi world. I have been using Home Assistant since the beginning but unfortunately I will now have to find an alternative home automation system. I wish I could help solving the issue and I am very thankfull to all the great volunteers, but there seems to be more emphasis in developing a cool dark theme instead of solving this quite serious issue. How can I help in trying to solve the issue with stateless switches and Homekit integration, who should I talk too, I can try to help if I am pointed in the right direction,

1 Like

Hi,
I have the same problem and i wish a help to integrate the aqara switchs using the homekit integration (i want to have several mi smart hub in the house). I don’t want to get 50€ Conbee 2 just for some switches.
I red a lot about it and i don’t find any solution when we don’t get any event from the switch when listening to *.
I’m very new at home assistant and it’s a show stopper for me too.
Can you please help us to use this wonderful open source tool ?