Koenkk / zigbee2mqtt

Zigbee šŸ to MQTT bridge šŸŒ‰, get rid of your proprietary Zigbee bridges šŸ”Ø
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.96k stars 1.67k forks source link

Xiaomi QBKG03LM and QBKG04LM issues #943

Closed Koenkk closed 4 years ago

Koenkk commented 5 years ago

As various (probably similar) issues with the Xiaomi QBKG03LM and QBKG04LM have been reported, I decided to create this single issue and close the other ones.

Reported issues:

Nephiel commented 5 years ago

Question: Since these switches cannot act as routers, is there any reason they're recognized by Z2M as being of type Router instead of EndDevice?
What would happen if I were to replace "type":"Router" with "type":"EndDevice" by hand in my devices.db for these switches?

antst commented 5 years ago

After I installed 0.33uF 400V capacitors, I didnā€™t have single issue. Much cheaper than AEOTEC bypass.

voynovia commented 5 years ago

After I installed 0.33uF 400V capacitors, I didnā€™t have single issue. Much cheaper than AEOTEC bypass.

can I learn more how to connect a capacitor?

NewFolk commented 5 years ago

Hello, I am on "version":"1.4.0","commit":"6b75465","coordinator":20190425. And my QBKG04LM does not work too. Some times i see Failed to ping some times genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - 2 failed with error Error: AF data request fails, status code: 205. No network route. Please confirm that the device has (re)joined the network.

funcasta commented 5 years ago

It's weird, but I added a Xiaomi socket (which acts as a router) to my network, and now all the switches are working fine (although I can see the ping error in the log file from time to time)

NewFolk commented 5 years ago

@antst How do you connect capacitor?

Nephiel commented 5 years ago

@voynovia @NewFolk in parallel with the bulb. Make sure the capacitor has no polarity (polypropylene) and has the correct ratings, it can be dangerous! I'd ask an electrician, to be safe.

@NewFolk The error 205 is probably related to issue #1536.

Any ideas about https://github.com/Koenkk/zigbee2mqtt/issues/943#issuecomment-491527487 ?

antst commented 5 years ago

About speed. I find strange thing. I finally got stable setup, and I see that some of my switches are stably fast and some stably slow. And there is no correlation on signal level, hops etc/ But for the fast ones line in database.db is shorter

antst commented 5 years ago

No, that's not true. But what is true is that "fast" ones were at some point attached to aqara hub (and possibly got firmware update), while slow ones were never part of aqara. And this is 100%.

EDIT: I tried to add one of slow switches to aqara hub and then turn off aqara hub (without removing switch from it) and repair to Z2M....and it became fast!

antst commented 5 years ago

But there is something else, we miss with those switches. When they are connected to aqara hub, they ignore long-press on buttons, which normally force them to re-pair, while hub is online. And I'd love to have the same for Z2M. Very good with the kids.

antst commented 5 years ago

We need to sniff what aqara hub tells to those switches on first pair (supposedly hub alter something, and this removes delay, and this is now firmware update) to implement the same in Z2M. But while I was experimenting, I am out of "slow" switches now.

urusha commented 5 years ago

I could sniff, but as I understand I need the network key and the channel of my aqara gateway, how can I get this info?

antst commented 5 years ago

If you use Wireshark, there are plenty of descriptions. But it must be switch which was never connected to aqara hub

urusha commented 5 years ago

Ok, I've got the key. But my prod network seems to be on the same channel as the test one, so if there is no way to filter out the prod network, I have to sniff in another place to get a clean dump, I'll try to do this tomorrow,

antst commented 5 years ago

Do it just on different channel!

On 26 May 2019, at 13:10, urusha notifications@github.com wrote:

Ok, I've got the key. But my prod network seems to be on the same channel as the test one, so if there is no way to filter out the prod network, I have to sniff in another place to get a clean dump, I'll try to do this tomorrow,

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

urusha commented 5 years ago

I don't think there is a way to change xiaomi gateway channel... And repairing all prod devices is not an option for me.

antst commented 5 years ago

By the way, once I had coordinator running rock-stable, I see that i still experience random switches off. But now, with capacitor, it is not that lethal, it doesn't hang and doesn't loose connection to the gateway and does not require reset/repair. And I think this time it is not related to the power. But still, after few hours "ON", typically about 3-4 hours, it turns off. Not always though. And you can immediately turn it on from zigbee. And I don't think that this "off" even is reported immediately.

urusha commented 5 years ago

Here is the dump. Lags persist with Xiaomi Gateway v2 (1.4.1_167). Switch spams the network with IEEE 802.15.4 Data Requests (2-3 per second), and this could be the reason of the lags. @antst do you see these packets with your switches (may be there are several versions of these switches and some of them don't spam)? pair.pcapng.zip

antst commented 5 years ago

Keep observation over my switches. Now, with stable coordinator, I see that they turn off always somewhere between 3 and 4AM ) like timer )

antst commented 5 years ago

Here is the dump. Lags persist with Xiaomi Gateway v2 (1.4.1_167). Switch spams the network with IEEE 802.15.4 Data Requests (2-3 per second), and this could be the reason of the lags. @antst do you see these packets with your switches (may be there are several versions of these switches and some of them don't spam)? pair.pcapng.zip

Yes, I see those also. And it is the same with xiaomi coordinator. Looks like bug in firmware of those switches.

antst commented 5 years ago

Argh. Looks like there are 5 packets per second from switch (and 5 ACKs from coordinator). 5 switches results in steady flow of 50 unnecessary packets per second! Damn aqara.

Nephiel commented 5 years ago

@antst Does the spamming happen with switches that have been connected to the Aqara gateway (and updated their firmware by doing it)? Also, does it happen with both 03LM and 04LM models?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

directman66 commented 4 years ago

Hey. QBKG03LM switches could previously be controlled through the topics zigbee2mqtt/0x00158d00022bc3ab/left/set by sending the payload {"state_left": "OFF"} and zigbee2mqtt/0x00158d00022bc3ab/right/set by sending the payload {"state_left": "OFF"}.

Everything worked well. But after updating to version 1.7.0 the management topics changed. Now you can control it only by sending zigbee2mqtt/0x00158d00022bc3ab/right/set by sending the payload {"state": "OFF"}. I have already adapted the code and control methods when the result of the command corresponds to the command being sent. I do not like that sending the state parameter I see the result in the state_right topic. Can I add an old control option in addition to the existing one?

pmuntyanu commented 4 years ago

I had an issue w/ my aqara switch which was turning off(w/o any notice) after setting up the decoupled mode and turning off the bulb. After this, I could only remove the bulb and install it again to return the switch to life. Also, the switch was turned on sometimes(relay), even during the night. So to fix it, I (followed @Nephiel 's advice)bought and installed the Fibaro Dimmer bypass 2. Because the issue was appearing immediately, I should have seen it, but do not so far.

My setup: Zigbee2mqtt 1.9.0 CC2530 CC2591 aqara switch bypass

ArkadiuszNiemiec commented 4 years ago

@antst I have soldered the 0.33 uF capacitor to AC wires inside my LED lamp but after one day the relay switched off. My automation was able to turn it on back but only after 7 minutes. Is this fix still working for you? No disconnects? Edit: I have calculated the reactance of this capacitor for 230/50 and it should behave as the equivalent of 5 W load. This should be enough for any switch. Edit2: Oh, I have just read your newer replay. So it still disconnects for you...

ArkadiuszNiemiec commented 4 years ago

@pmuntyanu How is the situation with Fibaro Bypass? Does it still switch off from time to time? Maybe there's something more than a capacitor.

workinganimal commented 4 years ago

I am not sure if this helps but i found out a thing about the QBKG03LM self turning off. I just changed my home and discovered that the QBKG03LM started to turn off randomly once in a week or so. I have 2 of these switches and i used the same switches in my last apartment but there i didnĀ“t have any problems with them. The key difference here is that in my last apartment the switches had different brakers and also where on different phases. Now they have the same braker and are on the same phase and started to turn off randomly. This means that they are somehow interfering which each other. Does anybody have an idea how to resolve this?

radudami commented 4 years ago

I'm not sure if it's related, but ever since I've added the IKEA TRƅDFRI signal repeater to the network none of the switches have turned off by themselves. It still happens if the switch is on and I turn of the smart bulb at full power, but I guess this is a different issue.

ArkadiuszNiemiec commented 4 years ago

@radudami I have 4 switches connected though IKEA TRADFRI and all turns off randomly, even when the lamp is off and even with capacitor/by passes connected in parallel to the lamp :(

ArkadiuszNiemiec commented 4 years ago

They have just released a new version of their switches: https://www.gearbest.com/blog/tech-news/xiaomi-aqara-smart-wall-switch-d1-release-make-lighting-smart-12003

alexbohariuc commented 4 years ago

Are there any plans for adding the D1 wall switches or are they compatible (even if not listed)? Iā€™m intending to buy around 10 wall switches and i kinda like the design of D1.

Koenkk commented 4 years ago

@alexbohariuc some are already supported in the latest dev branch

mattydanby commented 4 years ago

... Now they have the same braker and are on the same phase and started to turn off randomly. This means that they are somehow interfering which each other. Does anybody have an idea how to resolve this?

I started with a QBKG03LM and used both switches in a decoupled mode, this worked without issue including resets for months.

I then added a QBKG12LM (with a permanent live) on a separate RCBO circuit breaker but on the same phase. I am able to reset this and configure couple/decoupled modes for both switches. However now I experience the following issues on the 03LM even if the circuit breaker is off for the new 12LM.

1) The 03LM will not reset to try a re-join.

2) Once the mains supply is on the light powers on and I can see both switches have power. This will remain regardless of any other device state or activity for weeks. However as soon as I switch off the a light attached to the 03LM (decoupled) the 03LM powers down (blue status lights go out).

3) a- In this state the light is still powered but the switches do not respond via HA and as soon as I switch on the attached light via HA, the 03LM reboots (audible relay click is heard) the light switches off and approx. 1 minute later I can power on the 03LM via HA the light switches on!

3) b- In a coupled configuration the same occurs but occationally the light looses power so I can't switch it on. But i can turn the light on/off via HA but when off the blue status lights both go out and then on again with the light operation.

I hope that makes sense, does anyone have the same experience?

Any thoughts @Koenkk ?

I assume the D1's could have similar issues.

winterscar commented 3 years ago

Bump. I get random relay turn-offs with the two switch no neutral xiaomi wall switch. Tried with the fibaro bypass and that didn't fix anything for me.

o-mega commented 1 week ago

Almost 4 years passed since last issue update, but maybe anyone figured out the solution? My aqara d1 switches (no neural) randomly turns off and I cannot find proper solution to fix it.