Automation problem - Aqara switch wireless

Hi,
I conected Aqara switch wireless via MQTT to Home assistant. System show me this sensors:
sensor.0x00158d00044ad11f_action
sensor.0x00158d00044ad11f_battery
sensor.0x00158d00044ad11f_click
sensor.0x00158d00044ad11f_linkquality

I create automation for this switch to turn on and of lamp

  • id: ‘Test’
    alias: test
    initial_state: ‘off’
    trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
    entity_id: sensor.0x00158d00044ad11f_click
    click_type: single
    action:
    • service: light.toggle
      entity_id: light.lamp_2

When I’m press the button nothing happen :frowning:
Log file:
2020-07-09 14:51:59 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: device_automation 0x00158d00044ad11f click_single
DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/sensor/0x00158d00044ad11f/action/config (retained): b’{“icon”:“mdi:gesture-double-tap”,“value_template”:"{{ value_json.action }}",“state_topic”:“zigbee2mqtt/PrzelacznikSypialnia”,“json_attributes_topic”:“zigbee2mqtt/PrzelacznikSypialnia”,“name”:“PrzelacznikSypialnia_action”,“unique_id”:“0x00158d00044ad11f_action_zigbee2mqtt”,“device”:{“identifiers”:[“zigbee2mqtt_0x00158d00044ad11f”],“name”:“PrzelacznikSypialnia”,“sw_version”:“Zigbee2mqtt 1.14.1”,“model”:"Aqara wireless switch (with gyroscope)

thanks for hep

Marcin

Welcome to the community. Please refer to this guide (item 11) when posting code snippets in order for forum users to provide proper help.