Xiaomi Aqara Mini Switch doesn't show switch

Hi,

I connected one of the newer Xiaomi Gateways ZNDMWG03LM via HomeKit Integration with home assistent. I’ve coupled a Aqara Mini Switch (squarish shape) with the gateway but in home assistent the switch shows only up as “Stateless Programmable Switch Battery”. The switch itself is not visible, therefore I can’t use the switch event for some automations.

Any ideas?

Bildschirmfoto von 2020-02-01 21-57-41

Have you checked the states of your binary_sensor section?

Most of the Aqara switches and sensors show up as binary_sensor.xxxxx instead of sensor.xxxxx

It’s unlikely a binary sensor, more likely because it doesn’t have state it only fires events. Try looking in the Available Events list in the Developer Options -> Events tab. There will probably be a Xiaomi or Aqara events listed.

You can subscribe to the event to see what is sent when you press the button on the switch.

Then in your automation you would use the event as a trigger rather than a state change.

1 Like

Hi,

thanks. Unfortunately there are no aquara events listed in the events tab.
Here are the events which are listed:

  • homeassistant_close (5 Listener)
  • entity_registry_updated (12 Listener)
  • homeassistant_start (1 Listener)
  • homeassistant_stop (9 Listener)
  • device_registry_updated (2 Listener)
    • (1 Listener)
  • time_changed (12 Listener)
  • core_config_updated (4 Listener)
  • platform_discovered (9 Listener)
  • component_loaded (3 Listener)
  • user_removed (1 Listener)
  • state_changed (2 Listener)
  • service_registered (1 Listener)
  • service_removed (1 Listener)
  • panels_updated (1 Listener)
  • themes_updated (1 Listener)
  • persistent_notifications_updated (1 Listener)
  • lovelace_updated (1 Listener)
  • area_registry_updated (1 Listener)

any ideas what else to do to get the aqara switches working?

Hi,

thanks.
Unfortunately, the switch does neither show up as sensor.xxxxx nor as binary_sensor.xxxxx.
I’ts just the battery of the switch which shows up as sensor.stateless_programmable_switch_battery.
In fact I didn’t quite get up the point where to look for.
I searched through all the developer tabs but found nothing which matches a switch.
I wonder if this is due to the fact that the aqara switch is not recognized properly by home assistant or because it’s connected via the homekit gateway.

Anyway – I’d be glad if someone could provide more ideas…

Hello and welcome to the forum. As @dgaust already wrote, go to the “Dev. Tools” afterwards click on “Events”. Scroll down on this page and then enter that here (screenshots). Maybe this will help you…

or…

Thanks for clarification.
The switch doesn’t trigger neither ‘*’ nor ‘xiaomi.aqara_click’ events.
xiaomi.aqara_click events are also not listed in the column for available events (like it is in your screenshot).

Hello, have you ever tried the direct connection from the Xiaomi gateway to HA? I have no experience with the homekit, but maybe that’s the cause of your problem

Hi, do you solve the problem yet? I have the same problem with my wireless mini switch(WXKG11LM). The mini switch is paired with a homekit version of aqara hub(ZHWG11LM) and I use homekit controller to add hub into HA. I can only see the sensor.wireless_mini_switch_9fdc_battery in entity list. No luck to find any binary_sensor entity and any related event in event tab.

Did you try listening for all events by entering * in the listening box? The event_type doesn’t need to be in the list in the event tab. I have for example deconz_event, which is also not showing up in the events list.

There are a couple of things going on here:

  • “Stateless Programmable Switch” is not supported by homekit_controller (see list of supported devices here: https://www.home-assistant.io/integrations/homekit_controller/)
  • The “Stateless Programmable Switch” type is stateless and won’t show up as a binary_sensor anyway (binary_sensor inherently is on/off, where as stateless switch is just a “pressed” event)
  • homekit_controller doesn’t support events in any released version and as there is no state on this switch there is nothing to poll

The unreleased dev version of home-assistant does support events (PR was merged yesterday) and will be in 0.107.0 hopefully. Support for “Stateless Programmable Switch” is next on my list (My Hue remote also shows up as a “Stateless Programmable Switch”).

4 Likes

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.