Xiaomi_aqara.click not found

Tags: #<Tag:0x00007f7c60453b78> #<Tag:0x00007f7c60453a88> #<Tag:0x00007f7c60453948>

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