Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xaomi WXKG11LM Switches trigger without button press #13685

Closed
isujosh opened this issue Aug 25, 2022 · 8 comments
Closed

Xaomi WXKG11LM Switches trigger without button press #13685

isujosh opened this issue Aug 25, 2022 · 8 comments
Labels
problem Something isn't working stale Stale issues

Comments

@isujosh
Copy link

isujosh commented Aug 25, 2022

What happened?

I have installed two Xaomi WXKG11LM switches and setup a simple automation to toggle two lights on/off with a single button press. This works fine. However, if I leave the switches alone - they both trigger 50 minutes later - without any button press.

The logs clearly show the button presses I made but then show that Zigbee2MQTT received a message 50 minutes later to switch the units again - without any intervention by me.

Curiously, this appears to be 3000 seconds after the first press - not sure if that is significant.

What did you expect to happen?

I expected that there would be no change to the light status without a press of the switch

How to reproduce it (minimal and precise)

Setup HA automation to set button press to toggle light on/off.

Zigbee2MQTT version

1.27.0-1

Adapter firmware version

26780700

Adapter

Conbee II

Debug log

First Button Press.log
Phantom Button Press.log

@isujosh isujosh added the problem Something isn't working label Aug 25, 2022
@isujosh isujosh changed the title Xaomi WXKG11LM Switches trigger without Xaomi WXKG11LM Switches trigger without button press Aug 25, 2022
@Koenkk
Copy link
Owner

Koenkk commented Aug 25, 2022

I don't see any actions being published in Phantom Button Press.log. e.g.

Zigbee2MQTT:info  2022-08-25 12:39:23: MQTT publish: topic 'zigbee2mqtt/Switch 2', payload '{"action":null,"battery":100,"device_temperature":30,"linkquality":255,"power_outage_count":12,"voltage":3225}'

You see that action is null which means that no action has been triggered.

The MQTT publish: topic 'zigbee2mqtt/Switch 2' happens because the button sends a battery status update.

@isujosh
Copy link
Author

isujosh commented Aug 25, 2022

I can see that - but why then is the light ("Living Room Colour 2") state being changed to "ON" off the back of that 'null' action?

Something is clearly triggering it. In fact, why are there even any messages from the switch at all... they should'nt be doing anything unless the button is pressed.

@isujosh
Copy link
Author

isujosh commented Aug 25, 2022

This issue seems to be like https://github.com/Koenkk/zigbee2mqtt/issues/12018 - (and Issue #1967).

There is a comment there about the 50 minute cycle and the device sending a 'genBasic' message to itself. https://github.com/Koenkk/zigbee2mqtt/issues/12018#issuecomment-1093799243

This sounds like a very similar issue to me

@Koenkk
Copy link
Owner

Koenkk commented Aug 26, 2022

I can see that - but why then is the light ("Living Room Colour 2") state being changed to "ON" off the back of that 'null' action?

Because you probably have an automation which triggers on this. See https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html#responding-to-button-clicks how to properly setup your automation.

@isujosh
Copy link
Author

isujosh commented Aug 26, 2022

Because you probably have an automation which triggers on this. See https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html#responding-to-button-clicks how to properly setup your automation.

No, I don't have any other automation triggering this light.

As a test, I amended zigbee-herdsman-converters/devices/xiaomi.js as follows:

{ zigbeeModel: ['lumi.sensor_switch.aq2', 'lumi.remote.b1acn01'], model: 'WXKG11LM', vendor: 'Xiaomi', description: 'Aqara wireless switch', meta: {battery: {voltageToPercentage: '3V_2850_3200'}}, exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release']), e.device_temperature(), e.power_outage_count()], fromZigbee: [fz.xiaomi_multistate_action, fz.xiaomi_WXKG11LM_action, fz.ignore_basic_report, fz.legacy.WXKG11LM_click, fz.legacy.xiaomi_action_click_multistate], toZigbee: [], },

I removed: fz.xiaomi_basic and added: fz.ignore_basic_report

and this solved the issue completely. The button actions still work and of course, if I had any other automations triggering these lights then this change obviously wouldn't have made any difference because it is specific to only one device: WXKG11LM.

For whatever reason, the WXKG11LM genBasic status update triggers the automation despite the fact that the action is set to "null"

@Koenkk
Copy link
Owner

Koenkk commented Aug 26, 2022

For whatever reason, the WXKG11LM genBasic status update triggers the automation despite the fact that the action is set to "null"

That is a problem in your automation, not in zigbee2mqtt. Your automation should not do anything when action null is published. https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html#via-mqtt-device-trigger-recommended shows how to properly set up an automation which does not trigger on action: null.

@isujosh
Copy link
Author

isujosh commented Sep 2, 2022

For whatever reason, the WXKG11LM genBasic status update triggers the automation despite the fact that the action is set to "null"

That is a problem in your automation, not in zigbee2mqtt. Your automation should not do anything when action null is published. https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html#via-mqtt-device-trigger-recommended shows how to properly set up an automation which does not trigger on action: null.

I'll revisit that to see where this is going wrong. Thanks for the pointer

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale issues label Oct 3, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests

2 participants