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
Device not useable after pairing (Smart Plugs) - [zigpy.appdb] Error handling '_save_attribute' event #201
Comments
I may have a similar issue with the exact same plug. If yes, I have the exact same issues and here's my HA community post about it which provides some more information: https://community.home-assistant.io/t/problem-pairing-with-nous-a1z-smart-plug/447400 I also tried it first with nous plugs (amazon link) and they show the same behavoir. Another thing: I tried zigbee2mqtt which didn't work for me either (with the nous plugs), but both (nous and aqara) work with the deconz addon. Pairing is no problem there at all. |
a) does the plug still blinks, even though HA says that pairing is done? Same with Tuya Plug (exact model: tz3000_cehuw1lw_ts011f) Here is a full log from the Tuya plug attached FullLog-Zigbee-Tuya-TS011F-Pairing.log Also I see the same error in your log:
Maybe this helps also to find the problem:
|
Now I join this club but with one additional information: All the behavior mentioned in this ticket is reproducible (blinking after pairing, shortly controllable device), BUT I do not use deconz (recently migrated to SkyConnect). It has nothing to do with that specific hardware but zigpy in general. I would gladly provide further information if it is helpful. |
All of these messages are logged as |
I can post an update here. My plug is working fine since weeks now. What I have done is, I completely wiped all zigbee configuration, database etc and paired everything again with ZHA running HomeAssistant SkyConnect, before that I was also succesful with the deconz stick and ZHA but the trick was to clean everything zigbee related after deleting all integrations and enties from HA. So that my Zigbee setup is clean. I guess it was some database write error in a pairing procedure and this cant be fixed with deleting the device and repairing it. I also experimented with some zigbee.db database tools but that doesnt fix that problem. My plug works now fine, no disconnects, no random switch offs, everything works like a charm. |
I've got the same issue also explained here: https://community.home-assistant.io/t/tuya-zigbee-ts011f-issue/507221/2 . Today I tried cleaning up the zigbee.db file (manually removing the plug from all the tables using its ieee) and even disabling the foreign keys of the offending table but nothing seems to work. Would like to avoid repairing all my zigbee devices. |
Yes, I would also like to avoid that way, but that doesnt worked for me. So the only solution I found, is stop ZHA and remove the ZHA integration. Then remove all left over files like the db, from the ZHA stuff. I rebooted HA completely and do a fresh start with ZHA integration. Since that, I have not even one problem with the plug. |
I think a few things need to be cleared up before people start destroying their networks unnecessarily. There's no need to touch or "clean" The specific debug log message mentioned here is completely normal: it shows up every single time you join a device. It's logged under the normally-invisible If the device is unusable after joining, the database has no relation with this issue because it's merely used as a cache for incoming data, and to keep track of the IEEE -> NWK mapping for individual devices. Every Zigbee device sends data periodically back to the coordinator so if its NWK address changed, zigpy would re-discover its IEEE address immediately.
The move away from the Conbee is likely the only change that made a difference. The Conbee is known to have weird firmware routing issues. The alternative is because your network's channel was not 15. Re-forming a new ZHA network will do so on channel 15 instead of whatever your stick currently has (likely 11 if used with Z2M). |
Fist I use a conbee2 stick with ZHA (zigpy-deconz).
I have a large zigbee network, with devices from OSRAM (Ledvance), IKEA, Philips Hue and some Xiaomi / Aqara. Every device works without any problems but now I wanted a new plug with power metering. I bought a Tuya TS011F Plug, updated it to the latest firmware with zigbee2mqtt with my conbee2 in the company.
So now I would like to pair it with ZHA -> Pairing Ok -> Uncontrollable after pairing success. Tried it again and again, no success.
Then I tried it again with zigbee2mqtt, plug works without problems after pairing.
Okay maybe strange behaviour, now I bought a Aqara Smart Plug (Model: SP-EUC01)
Pairing success -> Uncontrollable after pairing.
So there must be some error. I checked the log and I see this that looks strange:
2022-08-11 16:56:33.429 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (54:ef:44:10:00:4d:c4:4e, 1, 0, 4, 'LUMI') params: FOREIGN KEY constraint failed
Also while pairing, device configures 2 / 3 times, that also happen with the cheap Tuya plug.
FullLog-Zigbee-Aqara-Pairing.log
The text was updated successfully, but these errors were encountered: