Hi all,
I’m currently facing an issue where zha_events trigger twice in node red (but not in HA).
For example, when pressing a zigbee button I’m using for testing, I get 3 events showing in dev tools (counter starts from 0):
However given the very simple setup in node red:
[{"id":"4858bf146b4c5e89","type":"server-events","z":"dde7691.7f69f98","name":"ZHA Events","server":"c713aa1.19ba158","version":1,"event_type":"zha_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"}],"x":1010,"y":400,"wires":[["00e3729c776cdef6","33638e67e94a1d67"]]},{"id":"33638e67e94a1d67","type":"debug","z":"dde7691.7f69f98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":340,"wires":[]},{"id":"c713aa1.19ba158","type":"server","name":"Home Assistant","version":1,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
I see 6 events returned, and upon checking the output I can see all 3 original events have been duplicated:
(to note, timestamps between screenshots do not match as node red was offloaded when I triggered it the first time, so I had to press the button again. Rest assured that events are duplicated each time).
This results in my setup receiving twice the amounts of events and therefore triggering my flows more times than needed. For instance I get multiple notifications of the same thing or something else that toggle gets toggled back almost immediately.
I had a look on node-red-contrib-home-assistant-websocket github issue page but there was very little of relevance. Someone experienced something like this but it turned out they were not filtering the event properly and they were catching unrelated events, for instance. I will also be posting an issue on there soon, but I thought this would be the best starting point.
Temporary remedies I could think of include attaching a cycle node with 2 outputs, with only 1 of them being connected to the rest of the setup, however I’ve not tested everything, so I’m not 100% sure that ALL events are duplicated.
Another thought was to create an HA automation to read zha_event and re-publish it as a new type of event, which kinda worked but I wasn’t able to include the entire event_data section, probably because I don’t know how.
Has anyone ever encountered this issue before?
No matter what I try I cannot seem to resolve this problem, and I cannot figure out how this is happening.
Thank you for your time in helping me solve this problem!