Xiaomi Aqara Switch WXKG11LM (Binary sensor) "on / off" no toggle for trigger?

I feel very stupid as I continue to try and learn home assistant.

I’m using the user interface, to try and build a simple automation?
I can clearly see in the lovelace UI if I press and hold the switch it says “on” once I let go, it says off.
The switch is a toggle ONLY to put it ‘on’ would be to hold it down.

Yet in the automation configuration menu, I see only these options

Trigger Type: Device
Device: SWitch_132423423452235(etc) TURNED ON (or OFF) or battery level
Then a time duration.

So I’m trying to make an automation and it isn’t working - I just want those triggers to be a ‘toggle’? Have I added it incorrectly?

It clearly says here:


" Model WXKG11LM only supports single , double , long_click_press and hold events"
Perfect! Why are those not the options, in the trigger menu?

Confused.

I ended up using node red for mine. Mine are connected through the smarthings integration so I only get pushed and held. I also had to deal with the held function also sending a pushed function. I solved it but I’m sure in not the most efficient way , I am very new. Here is the node red flow.

[{"id":"8b233c1c.20648","type":"subflow","name":"aqara button","info":"","category":"","in":[{"x":40,"y":160,"wires":[{"id":"a892c935.0e2848"}]}],"out":[{"x":500,"y":80,"wires":[{"id":"b2cfdffb.ca12","port":0}]},{"x":340,"y":160,"wires":[{"id":"a892c935.0e2848","port":1}]}],"env":[],"color":"#DDAA99"},{"id":"a892c935.0e2848","type":"switch","z":"8b233c1c.20648","name":"Pushed/Held","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"held","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":160,"wires":[["b2cfdffb.ca12"],["450ac802.894108","496bf257.632ebc"]]},{"id":"b2cfdffb.ca12","type":"gate","z":"8b233c1c.20648","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":370,"y":80,"wires":[[]]},{"id":"450ac802.894108","type":"change","z":"8b233c1c.20648","name":"Close Gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":200,"wires":[["b2cfdffb.ca12"]]},{"id":"c319de8c.d35d3","type":"delay","z":"8b233c1c.20648","name":"delay gate open","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":560,"y":280,"wires":[["b2cfdffb.ca12"]]},{"id":"496bf257.632ebc","type":"change","z":"8b233c1c.20648","name":"open Gate ","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":280,"wires":[["c319de8c.d35d3"]]},{"id":"f0cb5c7e.9caa5","type":"tab","label":"Living room button","disabled":false,"info":""},{"id":"8bb175f6.c47108","type":"server-events","z":"f0cb5c7e.9caa5","name":"","server":"1f07ad34.678b53","event_type":"smartthings.button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":115,"y":60,"wires":[["c830133.ea9ebf","3168e262.b3e04e"]]},{"id":"3168e262.b3e04e","type":"debug","z":"f0cb5c7e.9caa5","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":40,"wires":[]},{"id":"c830133.ea9ebf","type":"change","z":"f0cb5c7e.9caa5","name":"","rules":[{"t":"move","p":"payload.event.device_id","pt":"msg","to":"topic","tot":"msg"},{"t":"move","p":"payload.event.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":80,"wires":[["7f2e0fc1.a8e37"]]},{"id":"7a99b032.4405d","type":"debug","z":"f0cb5c7e.9caa5","name":"filter","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":320,"wires":[]},{"id":"7f2e0fc1.a8e37","type":"switch","z":"f0cb5c7e.9caa5","name":"route by message topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"feddc7f9-48ee-42a0-b824-7ce8ffe6fb60","vt":"str"},{"t":"eq","v":"685b22b2-d61b-458b-90d6-386420806a86","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":220,"wires":[["7a99b032.4405d","4baecf3.a03b63"],[]]},{"id":"8133a712.1de3c8","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"hallway lights","server":"1f07ad34.678b53","version":1,"debugenabled":false,"service_domain":"light","service":"toggle","entityId":"light.hallway_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":100,"wires":[[]]},{"id":"5bd505ff.83861c","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"kitchen lights","server":"1f07ad34.678b53","version":1,"debugenabled":false,"service_domain":"light","service":"toggle","entityId":"light.living_room_lights","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1030,"y":180,"wires":[[]]},{"id":"4baecf3.a03b63","type":"subflow:8b233c1c.20648","z":"f0cb5c7e.9caa5","name":"aqara button","env":[],"x":650,"y":200,"wires":[["8133a712.1de3c8"],["5bd505ff.83861c"]]},{"id":"1f07ad34.678b53","type":"server","name":"Home Assistant","addon":true}]

I did combine some functions in a subflow so not sure how they will show up for you but that is where the magic happens.

Craig

Any update on this? I would like to avoid coding in YAML & instead do the configuration in the Automations UI - thanks for your help!