Xiaomi Aqara Smart Wireless Switch with Deconz

Just looked at mine and there are no quotes around the event, could give that a try ?

- alias: Turn off Kirsty's lamp from ikea dimmer
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: tradfri_remote_control
      event: 1002
  condition:
    condition: state
    entity_id: light.kirsty_s_lamp_2
    state: 'on'
  action:
    service: light.turn_off
    entity_id: light.kirsty_s_lamp_2

@Holdestmade I think it’s more fundamental than the automation. I’ve been able to trigger the automation by calling the service, which tells me that the automation will be triggered when the event is recognised by HA. I’ve just updated to 92.2, just in case. I think the next thing for me to try is to remove the add-on and start from a clean slate. I’ve already tried removing the integration and re-initialising that so I think I need to get my setup as clean as possible and re-start from there.

Triggering the automation manually only runs the action part and ignores the trigger and condition

I’ve had a play with the listen activity for events and no activities under deconz_event fire. That concerns me, hence my thought of removing the add-on and re-stalling.

That is strange, do the switches show up like the attached screenshot of part of my deconz integration ? The Dressing Table Switch is a Aqara switch

yes, exactly the same.

image

I had the same problem when i searched for xiaomi or ikea switches. Then i changed from deconz to zha and that didnt help. I still only get the battery status

What’s the problem with the switches? They appear with the “battery_level” in the integration but you have to use dconz_events in your automations. So your automation should look like this:

- id: '19'
  alias: Kueche - Smart Button - Single Click - LEDs an
  trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      event: 1000
      id: smart_switch_kuche
  action:
  - entity_id: light.leds
    service: light.toggle

@dnuc no, that aspect is fully understood. The issue is that the deconz_event is not presented under the events tab on the developer menu. I’ve tried removing and re-installing the add-on and that hasn’t helped it re-appear (it has existed in the past, when it was first installed). For the devices the battery level is present which shows that they are recognised. I have not been able to get the deconz_event recognised whilst it is not present in the events tab.

What do you mean? Do you get an error when you type deconz_event in the box which says Event to describe to

no, no error, but also no response, I assume because on the left hand side where available events are listed it does not show.

I’ve just got myself a conbee II, so I think I’m going to strip out the add-on and then re-add from first principles, It’ll take a while but worth it if it solves the issue.

here is mine

First i did

1

which is the philps Dimmer
which is the long press or the I

- alias: 'Toggle Hall from dimmer'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: dimmer_switch
      event: 1003
  action:
    service: light.toggle
    entity_id: light.hallway

see clear as mud

It doesn’t show in the list in mine either. You have to type deconz_event in the box and click start listening.

I’ve not had a proper play with the square switches yet as it seems FAR more difficult than with the round switches.

When possible I prefer to use the web automation editor and this is what the Square switches look like:

32%20pm

As you say, nothing but battery level. But here is what the round/circular switches look like:

And here is what a resultant automation might look like:

- id: '1571831725978'
  alias: Toggle Bedroom Lamp
  description: Single click toggles the bedroom lamp
  trigger:
  - device_id: fb436949f0ec4474a92e8c770239dd4d
    domain: deconz
    platform: device
    subtype: turn_on
    type: remote_button_short_press
  condition: []
  action:
  - data:
      entity_id: light.bedroom_lamp
      transition: 3
    service: light.toggle

It seems like the square aquaria switches are second class citizens in more ways than just their capabilities (when compared to the round ones).

Thanks for the detailed breakdown, mihalski, this made my life a lot easier. Appreciate this community so much!

If you’re up to creating a custom_component by modifying the existing Deconz integration you could follow this:

Hi all,

I have the same problem here with my IKEA Switch. It’s set up through deConz (on Conbee II) - not ZHA - and it was working perfectly until a couple of days ago. Home assistant was recognizing 2 entities for this device: one as Switch and one as Sensor-battery level).

I set up my automation very easily using Device->Turn On button pressed, and the action would simply turn on my light bulb. All was working perfectly.
Switch%20OK

All of a sudden, the switch has disappeared as entity from HA, and I can only see the battery sensor. The switch does not appear in any device list. I checked in Developer Tools-> States and it’s not there either. The only thing I see is the battery sensor, nothing else:

Anyone has any idea what could have caused this and how it could be fixed?

I have the same issue with an Xiaomi Switch (firmware 09-27-2017) that only shows as a battery level sensor. When I try to listen to deconz_event nothing is fired in HA. Any clues?

Seems like it’s normal…
I solved this problem by using deconz_event as trigger. See below:

- id: '1576874566498'
  alias: Switch ON-OFF
  description: ''
  trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      event: 1002
      id: your_switch_name #this is the name used in your Conbee (in the Phoscon web app)
  condition: []
  action:
  - service: light.toggle
    entity_id: light.name_of_your_light

Let me know if it works for you.

-nik