Trigger Node-RED flow with Aqara MiniSwitch (Help with events:all node)

I’m trying to trigger a flow in Node-RED using various button presses from an Aqara MiniSwitch device. I’m stuck on filtering by event type using the events: all node.

I can see the events firing in Activity but I have no idea how to put those in as event type filters.

Any examples or even a link to examples would be much appreciated.

Update: Made a bit of progress by using an events: all node with no filtering (ignored warning) and connecting it to a debug node so I could look at the output. I should note that i’m doing this on a dev instance of HA and not on a busy system. I can see an event type of ‘zha_event’ generated each time I do something with the button.

Now, I think I just need to understand the event data and parse it.

Does anyone know why the entity_id in the event data would be ‘undefined’?

For now I’m triggering off of a match to payload.event.device_id and payload.event.command which seems to work. It seems a little hacky that I’m not using an entity_id but in looking at device entities, it does not have an entity for the button, only the battery. Maybe that’s why it shows in the event data as undefined?

Here is the working flow if anyone is interested. The 2x miniswitches update the value of HomeSeer virtual devices when they are actuated. I’m in the process of migrating from HomeSee to HA so I need this kind of conduit to keep both systems running.

Blockquote [{“id”:“f751f613464238f3”,“type”:“group”,“z”:“ff0eaaf925f96eb3”,“style”:{“stroke”:“#999999”,“stroke-opacity”:“1”,“fill”:“none”,“fill-opacity”:“1”,“label”:true,“label-position”:“nw”,“color”:“#767676”},“nodes”:[“2b733274774f2bcc”,“c29df44b49d70814”,“76d1b0ea8392bfd4”,“87e05d344cf8511f”,“e05cf730460e87e6”,“d6c5b185217f078f”,“9767843c3ffc1956”,“d1e6ec9c1f8941ba”,“0e1507602eb9a36e”,“7281accaeb8991a2”,“b5fa9f9301570480”,“22554e91f76554a1”,“88df905dc3abefe9”,“f7490b479148c3d9”,“ae4645599464362f”,“1ad22ffc622061a2”,“c608a1850082f8c9”,“33292870f750ee85”,“835e5203f1033ebf”,“11514ce5feb796ae”,“c4a27f671aac32b3”,“33dde493903e0abd”,“d36ce0c5dadc2e56”,“f693326efb4e1f20”],“x”:74,“y”:759,“w”:1532,“h”:522},{“id”:“2b733274774f2bcc”,“type”:“server-events”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“”,“server”:“ed67a34680202f89”,“version”:3,“exposeAsEntityConfig”:“”,“eventType”:“zha_event”,“eventData”:“”,“waitForRunning”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“”,“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:“$outputData("eventData").event_type”,“valueType”:“jsonata”}],“x”:190,“y”:1020,“wires”:[[“c29df44b49d70814”,“76d1b0ea8392bfd4”]]},{“id”:“c29df44b49d70814”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“From Aqara MSx”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:390,“y”:940,“wires”:},{“id”:“76d1b0ea8392bfd4”,“type”:“switch”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“”,“property”:“payload.event.device_id”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“5225f754f6a2df366856ea953ddfc505”,“vt”:“str”},{“t”:“eq”,“v”:“ca83a118f99fcd0aa4c6f4d8027ba28a”,“vt”:“str”},{“t”:“else”}],“checkall”:“true”,“repair”:false,“outputs”:3,“x”:470,“y”:1020,“wires”:[[“87e05d344cf8511f”],[“f7490b479148c3d9”],]},{“id”:“87e05d344cf8511f”,“type”:“switch”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“”,“property”:“payload.event.command”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“single”,“vt”:“str”},{“t”:“eq”,“v”:“double”,“vt”:“str”},{“t”:“eq”,“v”:“hold”,“vt”:“str”},{“t”:“eq”,“v”:“release”,“vt”:“str”},{“t”:“else”}],“checkall”:“true”,“repair”:false,“outputs”:5,“x”:650,“y”:880,“wires”:[[“e05cf730460e87e6”,“9767843c3ffc1956”],[“e05cf730460e87e6”,“b5fa9f9301570480”],[“e05cf730460e87e6”,“22554e91f76554a1”],[“e05cf730460e87e6”,“88df905dc3abefe9”],]},{“id”:“e05cf730460e87e6”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“From MS1”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:890,“y”:800,“wires”:},{“id”:“d6c5b185217f078f”,“type”:“comment”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“Zigbee MiniSwitches from Home Assistant”,“info”:“”,“x”:280,“y”:800,“wires”:},{“id”:“9767843c3ffc1956”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“short = 1002”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1002”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:890,“y”:860,“wires”:[[“d36ce0c5dadc2e56”]]},{“id”:“d1e6ec9c1f8941ba”,“type”:“hs-device”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“Library MS1 Button”,“device”:“2571”,“server”:“120999c1.0e0c66”,“feature”:“2572”,“reportonstartup”:true,“x”:1190,“y”:920,“wires”:[[“0e1507602eb9a36e”]]},{“id”:“0e1507602eb9a36e”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“DEBUG: From MS1”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:1410,“y”:920,“wires”:},{“id”:“7281accaeb8991a2”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“DEBUG: To MS1”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:1190,“y”:860,“wires”:},{“id”:“b5fa9f9301570480”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“double = 1004”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1004”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:900,“y”:900,“wires”:[[“d36ce0c5dadc2e56”]]},{“id”:“22554e91f76554a1”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“hold = 1001”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1001”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:890,“y”:940,“wires”:[[“d36ce0c5dadc2e56”]]},{“id”:“88df905dc3abefe9”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“release = 1003”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1003”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:900,“y”:980,“wires”:[[“d36ce0c5dadc2e56”]]},{“id”:“f7490b479148c3d9”,“type”:“switch”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“”,“property”:“payload.event.command”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“single”,“vt”:“str”},{“t”:“eq”,“v”:“double”,“vt”:“str”},{“t”:“eq”,“v”:“hold”,“vt”:“str”},{“t”:“eq”,“v”:“release”,“vt”:“str”},{“t”:“else”}],“checkall”:“true”,“repair”:false,“outputs”:5,“x”:670,“y”:1140,“wires”:[[“ae4645599464362f”,“1ad22ffc622061a2”],[“ae4645599464362f”,“11514ce5feb796ae”],[“ae4645599464362f”,“c4a27f671aac32b3”],[“ae4645599464362f”,“33dde493903e0abd”],]},{“id”:“ae4645599464362f”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“From MS2”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:910,“y”:1060,“wires”:},{“id”:“1ad22ffc622061a2”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“short = 1002”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1002”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:910,“y”:1120,“wires”:[[“f693326efb4e1f20”]]},{“id”:“c608a1850082f8c9”,“type”:“hs-device”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“TV Room MS2 Button”,“device”:“2574”,“server”:“120999c1.0e0c66”,“feature”:“2575”,“reportonstartup”:true,“x”:1220,“y”:1180,“wires”:[[“33292870f750ee85”]]},{“id”:“33292870f750ee85”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“DEBUG: From MS2”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:1470,“y”:1180,“wires”:},{“id”:“835e5203f1033ebf”,“type”:“debug”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“DEBUG: To MS2”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:“”,“statusType”:“auto”,“x”:1210,“y”:1120,“wires”:},{“id”:“11514ce5feb796ae”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“double = 1004”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1004”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:920,“y”:1160,“wires”:[[“f693326efb4e1f20”]]},{“id”:“c4a27f671aac32b3”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“hold = 1001”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1001”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:910,“y”:1200,“wires”:[[“f693326efb4e1f20”]]},{“id”:“33dde493903e0abd”,“type”:“change”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“name”:“release = 1003”,“rules”:[{“t”:“delete”,“p”:“payload”,“pt”:“msg”},{“t”:“set”,“p”:“payload.value”,“pt”:“msg”,“to”:“1003”,“tot”:“num”},{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“update”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:920,“y”:1240,“wires”:[[“f693326efb4e1f20”]]},{“id”:“d36ce0c5dadc2e56”,“type”:“junction”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“x”:1060,“y”:900,“wires”:[[“d1e6ec9c1f8941ba”,“7281accaeb8991a2”]]},{“id”:“f693326efb4e1f20”,“type”:“junction”,“z”:“ff0eaaf925f96eb3”,“g”:“f751f613464238f3”,“x”:1080,“y”:1160,“wires”:[[“c608a1850082f8c9”,“835e5203f1033ebf”]]},{“id”:“ed67a34680202f89”,“type”:“server”,“name”:“Home Assistant”,“version”:6,“addon”:false,“rejectUnauthorizedCerts”:true,“ha_boolean”:[“y”,“yes”,“true”,“on”,“home”,“open”],“connectionDelay”:true,“cacheJson”:true,“heartbeat”:false,“heartbeatInterval”:“30”,“areaSelector”:“friendlyName”,“deviceSelector”:“friendlyName”,“entitySelector”:“friendlyName”,“statusSeparator”:": ",“statusYear”:“hidden”,“statusMonth”:“short”,“statusDay”:“numeric”,“statusHourCycle”:“default”,“statusTimeFormat”:“h:m”,“enableGlobalContextStore”:false},{“id”:“120999c1.0e0c66”,“type”:“hs-server”,“name”:“HS4B”,“host”:“172.29.1.18”,“port”:“80”},{“id”:“90b76461f143bae3”,“type”:“global-config”,“env”:,“modules”:{“node-red-contrib-home-assistant-websocket”:“0.80.3”,“node-red-contrib-homeseer”:“1.0.6”}}]