Xiaomi_aqara.click not found

Hi,

I recently purchase a aqara switches (x2 single, x2 double) and set as wireless switch mode in xiaomi app

I view my devices as:

(double)
switch.interruptor_cocina_izquierda
switch.interruptor_cocina_derecha

(single)
switch.interruptor_entrada

i try to setup an automation like this:

- id: '1579191503570'
  alias: '[DOM] Interruptor Cocina / Aspirar la casa '
  description: ''
  trigger:
  - event_data:
      click_type: single
      entity_id: switch.interruptor_cocina_derecha
    event_type: xiaomi_aqara.click
    platform: event
  condition: []
  action:
  - alias: ''
    data:
      entity_id: script.vacuum_casa
    service: homeassistant.turn_on

But dont work. I find event xiaomi_aqara.click but it doesnt exist

Anyone can help me?

Are you sure you can see them as switch.something? I have some aqara switches too connected to a Xiaomi v2 gateway and they appear as binary_sensor.something.

Here is one of my automations (in Spanish too :)):

- id: '1525140123459'
  alias: Encender Flexo Angel - Interruptor Angel
  trigger:
    - platform: event
      event_type: xiaomi_aqara.click
      event_data:
        entity_id: binary_sensor.interruptor_angel
        click_type: double
  action:
    service: light.toggle
    entity_id: light.flexo_angel

It works perfectly fine.

Regards.

Yes

Ok, I understand now. Binary_sensors are wireless switches. I have another wired switch and appears as switch.interruptor_entrada. Unfortunately I haven’t created any automation for it yet.

Anyway, try to use the same order in the “trigger” part as I used. I don’t remember where I read that the “platform: event” line should be the first one.

I’ve tried to create an automation with this wired switch, but it only supports one event (“click”) and is associated to some light I cannot change (my wife would kill me). If this does not work for you I could try to test it when I’m alone at home…

Regards.

Edit: Did you test with “click” instead of “xiaomi_aqara.click”? When I created the automation I copied it from someone else’s and they were using “click”. Perhaps they had wired switches instead of wireless ones

I try to set event as click

- id: '1579191503570'
  alias: '[DOM] Interruptor Cocina / Aspirar la casa '
  description: ''
  trigger:
  - event_data:
      entity_id: switch.interruptor_cocina_derecha
    event_type: click
    platform: event
  condition: []
  action:
  - alias: ''
    data:
      entity_id: script.vacuum_casa
    service: homeassistant.turn_on

And try with wireless mode on/off but no results

I know it should work the same, but try to put the “platform” line first in the “trigger”. I read somewhere there was a problem with that.

Tomorrow I will install two new wired switches, one double and another one single. I didn’t plan to use them in HA automations, because they are wired to lights, but anyway I’ll try to create one automation just to see if it works.

Regards.

- id: '1579211651721'
  alias: '[DOM] Luz habitacion / Switch'
  description: Encender o apagar la luz de la habitacion con el boton
  trigger:
  - platform: event
    event_data:
      click_type: single
      entity_id: binary_sensor.switch_habitacion
    event_type: xiaomi_aqara.click
  condition: []
  action:
  - data:
      entity_id: light.bombilla_rgb
    service: light.toggle

Nothing happens :frowning:

How can i convert switch to binary sensor? I try to deactivate wireless mode but dont work

I’m sorry, but I couldn’t install the wired switches. Two of them together are much bigger than two standard switches :frowning:

About your automation, I can’t see anything strange, so I would start looking for things like wrong indentations or something like that. By the way, in my automations I don’t have the “- data” line, only entity_id and service.

I suppose everything works in Mi Home app, isn’t it?

Regards.

Ps. You can try loggin to see what’s happening. Just add this to your configuration.yaml:

logger:
  default: info
  logs:
    xiaomi_aqara: debug

This should show you events coming from the Xiaomi Gateway

Yesterday I had some time and tried to make one of my wired switches work with HA. I couldn’t detect a click in any way.

I tried converting the switch to wireless switch. Activating it from HA still makes it work as a wired switch, even when pushing it physically does something else. And I could not find anything in logs, even when activating debugging for xiaomi_aqara or “switch” component. “xiaomi_aqara.click” or “click” didn’t work in the automations.

Going back to wired switch configuration didn’t solve anything, it was impossible to detect any click nor make it work in automations.

I even tried to detect a state change (from off to on or on to off), but it didn’t work either. It seems there is something wrong in this component or that wired switches (even in wireless configuration) don’t send any state or event to HA. They do send it to Xiaomi Gateway, because I can create automations in Mi Home, but HA doesn’t seem to receive anything.

Regards.

Ps. It seems that the only way to make Aqara wired switches work with HA would be without the Xiaomi-Aqara gateway, using a different Zigbee controller, which I don’t have

1 Like

Much thanks for your time. I’l buy a alternative zigbee controller to manage this automations :slight_smile:

Please, keep us informed. Maybe some time I’ll have to got that way too… :slight_smile:

Regards.

1 Like

Sure :slight_smile:

This zigbee usb controller will work?

Buy a zigbee driver in ellelabs. I have configured it and now I see the following:

The wall switch have too much entities inside:

I buy this zigbee usb controller: https://elelabs.com/products/elelabs-usb-adapter.html

I need install zigbe2mqtt to control my devices?

Any ideas?