Xiaomi Aqara Smart Wireless Switch with Deconz

Has anyone managed to get a Xiaomi remote working with Deconz? I’ve got the remote registered using Phoscon and its appearing in HA (battery sensor showing only).

I’ve setup an automation to recognise a trigger event;

# remote control press
- id: '1537608960001'
  alias: "Switch Light on remotely"
  hide_entity: true
  initial_state: true
  trigger:
    - platform: event
      event_type: deconz_event
      event_data:
        id: bedlight_julie
        event: "1002"
  action:
    - service: light.toggle
      entity_id: light.sleep_inducer

I’ve been able to fire the event using the developer tool: Events, so I know the automation works, but I haven’t been able to identify the event number correctly (I think). Has anyone any experience of this and how to identify the event?

You can use the event listener in the events panel. Use deconz_event and start listening. Press the remote and you’ll see the event code to use.

1 Like

Thanks for the response, I’d not looked at that before. When I use it, nothing shows, so I used to to observe other events and they show, so I I’m wondering if it’s the deconz add-on that is not recognising the events of the switch. I can see it’s passing the battery level through the sensor (which is what it’s supposed to do), but not it seems the button press, unless there is something else I’ve not done.

As a belt and braces check i looked at the logs in the deconz add-on and can see the button press activity, it just doesn’t seem to be firing an event.

Maybe delete the deCONZ integration and re-add ?

Already done, afraid it didn’t make any difference either. I’ve also checked that the conbee stick is at the latest firmware level. HA is at 0.92.1, so I’m up to date all round.

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).