HA+Z2M+Aqara H2 Dimmer WS-K05E Device Triggers Not Working

Hi all, first post and super n00by here. I installed HA for the first time 10 days ago so please go easy on me. I did search the forums in general and blueprints exchange specifically, and I have read and will try to abide by the “Help us help you” guidelines.

I have been unable to get the Device Triggers to work for my Aqara H2 Smart Dimmer ( WS-K05E ). I would appreciate any advice or thoughts on what I might be doing wrong.

  1. HA Yellow
  2. Built-in Zigbee hardware
  3. Installed as Home Assistant OS, not containerized
  4. Zigbee2MQTT Add-on installed and working

I have configured a MOES 4-Gang switch through Z2M using its device triggers, and that worked exactly as I expected. I have also configured an Aqara T2 Smart Bulb, and the light actions work as expected there too.

Perhaps most interestingly, I can even get the Aqara H2 to work if I use the MQTT trigger instead of the Device triggers.

So for example, here is an automation I feel should work but doesn’t:

alias: H2T2
description: ""
triggers:
  - type: changed_states
    device_id: 60997af18a05d4e032524a00cbe925f7
    entity_id: 559fd0e984ca291d36a1158a64e958da
    domain: light
    trigger: device
conditions: []
actions:
  - action: light.toggle
    metadata: {}
    data: {}
    target:
      device_id: eb3ed80b981570e8542a086219193216
mode: single

…whereas this very similar one for the MOES works fine:

alias: MOES_T2
description: ""
triggers:
  - type: changed_states
    device_id: 8f6e12e386828b182c02c672ad663951
    entity_id: b109c8f6cf45a6ae259fae087d4ea86b
    domain: switch
    trigger: device
conditions: []
actions:
  - action: light.toggle
    metadata: {}
    data: {}
    target:
      device_id: eb3ed80b981570e8542a086219193216
mode: single

…and this one for the Aqara works as well:

alias: Aqara_On
description: ""
triggers:
  - trigger: mqtt
    topic: zigbee2mqtt/Aqara Dimmer 3-button
    payload: "OFF"
    value_template: "{{ value_json.state_1 }}"
conditions: []
actions:
  - action: light.turn_on
    metadata: {}
    data:
      brightness: "{{ trigger.payload_json.brightness_1 }}"
    target:
      device_id: 2d10c293a7ccb745081603117ebf5dfe
mode: single

The last one has a couple extra things going on (added brightness, reversed on/off behavior as relates to state so as to make the LED on the switch on when the light is off and vice-versa) but I think this gets the point across.

I suppose to one way of thinking there’s nothing really wrong with using the MQTT trigger this way, but it seems clunky to me. Perhaps more importantly I just feel like it suggests I’m doing something wrong, and at this stage I’m just trying to learn how everything works. So…let me know how I can do it better and learn more. Thanks!

It seems that the device is not supported yet.

1 Like

Oh wow, thank you that is very helpful. I’ll try adding that converter following this doc [Edit: nope after reading/learning a bit more it’s this one I want] and see how it goes. Please let me know if I misunderstood that and I should be doing it differently.

Just for my education, am I right in thinking the fact it’s in as an issue there suggests it’ll eventually be added into the main Z2M? And though I know it’ll vary a lot, is there a general ballpark on how long that process takes?

It works! Mostly…need to figure out the dimming controls as right now they don’t change the brightness until you press the on/off button twice. But that sounds a lot like a skill issue on my part.

The good news is that adding the converter was super easy and fast. The docs didn’t really quite spell it out though and I found the key thing in another forum post, so for future generations of n00bs here is how to add your first External Converter:

  1. Create a new directory /homeassistant/zigbee2mqtt/external_converters
  2. Create a file in that directory named your_device_name.js containing the converter code
  3. Restart zigbee2mqtt

In my case I did 1 and 2 via the HomeAssistant Code Studio addon, but I imagine there are plenty of other ways.

(I marked this as the solution bc the steps above are the more generally useful information, but for the specific External Converter for this dimmer see VietNgoc’s link)

2 Likes

The only thing the docs don’t really clarify is that the folder for external converters might not be located in data/external_converters if you’re running Z2M inside HA as an addon. Other than that, it’s relatively simple.

Well in point of fact the doc actually never even says you should put files into the directory, nor does it mention that the directory won’t exist if you haven’t done this before, nor does it say that the directory might need to go in a completely different place from what the doc explicitly says is the location.

But thanks for chiming in with a link to a doc I had already pasted above and no other information except to point out how simple all this is. That’s quite helpful and not insulting at all.

1 Like

Jesus mate, chill. I wasn’t trying to be condescending. I was just trying to help.

Guess I’ll take note of your account and try not to be so helpful in the future. Hope you’re happy with yourself.

Take a quick reread of what you wrote and ask yourself what part of it was intended to be helpful.

Dude, my post was an observation based on my experiences with reading the docs. There have been countless other people who got caught out with the /data path and created a data folder which didn’t work.

It wasn’t meant to help you directly - it was meant to help anyone coming across this post a year or two from now. I wanted to clarify this part most of all, because z2M can be installed in a variety of different ways (including not requiring HA at all)

Anyway, I’m glad you resolved your issue, GFY (and by that I mean Good For You and am absolutely not implying anything else which might fit that acronym)

1 Like

Cool. I’m confident those future readers will a)get the answer they needed from my comment with the steps and b)have no trouble figuring out who came in here with an attitude issue.

1 Like

Thanks for that absolutely clear clarification.
I also tried adding a external converter a few days again and couldn’t figure out, why it didn’t work. Good thing you didn’t give up like me after 3 hours.

(And yes, I am also new to the whole HA stuff since 2 weeks or so)

1 Like

@jusdisgi hi, I just bought this device and I would also like to decouple the up/down buttons so I can use them to control other devices. Can you u please share your converter? Does it support decoupling the buttons ?