Wyze Lock integration

Argh! I totally forgot that I updated to 0.115.5! Now my log resembles yours so i’ll see if can figure out which attributes are needed for the quirk

1 Like

Thank you so much for taking the time to help me with this! I got the correct attributes identified and everything works properly now. It’s nice to have the lock automatically show it’s correct state for a change

Awesome! Glad I could help. @dmulcahey did the hard work of deciphering the mess that the lock sends and writing this quirk. It sucks wyze won’t share any info.

Hopefully one day the variables for the quirk can be read from a config file or be set up in the zha config panel.

2 Likes

So just when i thought everything was working perfectly now, my lock has been randomly changing it’s state from locked to unlocked. It’s not actually unlocking itself, just seems to be setting the state incorrectly. No idea why, i thought i identified all the correct attributes for the states as they all do report correctly (locked/unlocked, closed/open). Have you had any similar experiences?

I don’t have the lock in production and haven’t noticed that

I had the same issue. Some messages from the lock are being incorrectly identified as lock state changes. I fixed it by looking at an additional value which was changed in the messages.

This is what I changed:

        self.info(
            "Interesting attributes - 0: %s, 52: %s, 41: %s, 56: %s, 57: %s",
            args[0],
            args[52],
            args[41],
            args[56],
            args[57],
        )
        if args[52] == 221 and args[41] == 155 and args[0] == 79:
            self.warning("the lock is unlocked via the app")
            self.endpoint.device.lock_bus.listener_event("lock_event", 2)
        elif args[52] == 221 and args[41] == 156 and args[0] == 79:
            self.warning("the lock is locked via the app")
            self.endpoint.device.lock_bus.listener_event("lock_event", 1)
        elif args[52] == 217 and args[41] == 155 and args[0] == 79:
            self.warning("the lock is unlocked manually")
            self.endpoint.device.lock_bus.listener_event("lock_event", 2)
        elif args[52] == 217 and args[41] == 156 and args[0] == 79:
            self.warning("the lock is locked manually")
            self.endpoint.device.lock_bus.listener_event("lock_event", 1)
        elif args[52] == 212 and args[41] == 156 and args[0] == 79:
            self.warning("the lock is locked via auto lock")
            self.endpoint.device.lock_bus.listener_event("lock_event", 1)

I’m currently using a ConBee2 as my zigbee stick and can’t seem to see the “Interesting attributes” you mentioned anywhere in my logs? Any idea how to see that info?

Thanks! I added those attributes to my lock quirk, seems to be working so far

Are you able to pair the lock with that zigbee stick?

If so you need to pair the lock, install the quirk, turn on debug logging in your configuration.yaml, gather the attributes and then modify the quirk with those attributes.

Yes! i was able to pair the lock with the conbee2 no problem. Lock and unlock via HA works no issues.

I was actually following the steps in the post WYZE LOCK - Zigbee - Home Assistant - HassIO - HassOS - ZHA integration - Working as expected - remove cloud control to try and get the “interesting attributes” values to update the “lock.py” file but don’t see that line in the logs when debug is enabled. (Did everything except step 6 since i can’t find those values)

Wondering if i have to enable this https://github.com/zha-ng/zigpy-deconz-parser but not really sure how to enable that parser. Not a coder so unsure of how to use this deconz parser to get more visibility in the logs.

1 Like

I don’t have a conbee2 stick but i don’t think you have to do anything special besides turning on debugging. Try adding the following your yaml and see if anything pops up in the log when you open/close the lock

logger:
  default: info
  logs:
    homeassistant.components.zha: debug
    zigpy: debug
    zigpy_xbee: debug
    zigpy_deconz: debug
    zigpy_cc: debug

have all those in my logger config and still nada. that’s why i think i need to use that deconz-parser to get more detailed information just don’t know how to enable it within HA.

# Setup Logging for Debug Purposes
logger:
  default: warning
   logs:
     asyncio: debug
     homeassistant.core: debug
     homeassistant.components.zha: debug
     zigpy: debug
     bellows: debug
     zigpy_xbee: debug
     zigpy_deconz: debug
     zigpy_zigate: debug
     zigpy_deconz_parser: debug
     bellows.zigbee.application: debug
     bellows.ezsp: debug
     zigpy_cc: debug
     zigpy_deconz.zigbee.application: debug
     zigpy_deconz.api: debug
     zigpy_xbee.zigbee.application: debug
     zigpy_xbee.api: debug
     zigpy_zigate: debug
     zigpy_znp: debug
     zhaquirks: debug
1 Like

Hello Mike
I have the same issue, when I lock and unlock manually, door state changes from lock to unlock tree times.
how can I fix it?
here is my lock.py

   if args[52] == 65 and args[41] == 187:                                                                                                                                     
        self.warning("the lock is unlocked via the app")                                                                                                                       
        self.endpoint.device.lock_bus.listener_event("lock_event", 2)                                                                                                          
                                                                                                                                                                               
    elif args[52] == 65 and args[41] == 188:                                                                                                                                   
        self.warning("the lock is locked via the app")                                                                                                                         
        self.endpoint.device.lock_bus.listener_event("lock_event", 1)                                                                                                         
                                                                                                                                                                             
    elif args[41] == 68:                                                                                                                                                   
        self.warning("the lock is unlocked manually")                                                                                                                          
        self.endpoint.device.lock_bus.listener_event("lock_event", 2)                                                                                                         
                                                                                                                                                                            
    elif args[41] == 67:                                                                                                                                                    
        self.warning("the lock is locked manually")                                                                                                                         
        self.endpoint.device.lock_bus.listener_event("lock_event", 1)                                                                                                        
                                                                                                                                                                             
    elif args[52] == 72 and args[41] == 188:                                                                                                                                   
        self.warning("the lock is locked via auto lock")                                                                                                                      
        self.endpoint.device.lock_bus.listener_event("lock_event", 1)                                                                                                          
                                                                                                                                                                             
    if args[52] == 191 and args[41] == 175:                                                                                                                                 
        self.warning("the door is open")                                                                                                                                       
        self.endpoint.device.motion_bus.listener_event("motion_event", ON)                                                                                                
                                                                                                                                                                          
    elif args[52] == 191 and args[41] == 172:                                                                                      
       self.warning("the door is closed")                                                                                                                              
        self.endpoint.device.motion_bus.listener_event("motion_event", OFF)

I have the same problem, my log with ezsp coordinator and verbose logging enabled look like this.

[0x5136:1:0xfc00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=True is_reply=False disable_default_response=False> manufacturer=4698 tsn=23 command_id=0>
[0x5136:1:0xfc00] Unknown cluster-specific command 0
[0x5136:1:0xfc00] ZCL request 0x0000: b'O\xab@\x00E\xe4\x13\x80L\x00\x01\x06`\x1av\xb0\xa6%\x8eF\xf9\xf1\xccT\xd4\xadL\x0ez\x19\x8b]\xb0\xe6\x03*\x9d\xe72\xd8\x8c\xcf\xd8\xd5\xa2\xc7\x8c\x91\xfaQ\x0e\x0b\x91\x87\xc8\t.\x88\xd3b{\x1aK\xc8\xcff\x18T\xc2\x05b\x84\xfa\xceY'
[0x5136:1:0xfc00] No handler for cluster command 0
[0x5136:1:0xfc00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=True is_reply=False disable_default_response=False> manufacturer=4698 tsn=24 command_id=0>
[0x5136:1:0xfc00] Unknown cluster-specific command 0

I had a failure of my lock and after 2hrs with tech support they replaced it under warranty. Just received the replacement and I’m trying to go through the process of capturing the data for the quirk but something appears to have changed. I’m not sure if it’s the newer builds of Home Assistant but the debug logging no longer seems to capture the necessary information like it used to.

Ok, for all those that have been having issues getting the log to report the attributes, I found a solution that someone provided on the Github forums.

You need to modify your lock.py file. Find this section in the original file:

class WyzeCluster(CustomCluster, Basic):
“”“Wyze manufacturer specific cluster implementation.”“”

cluster_id = WYZE_CLUSTER_ID
ep_attribute = "wyze_lock_cluster"
attributes = {}
server_commands = {}
client_commands = {}

def handle_message(self, hdr, args):

and change the last line of this section so it looks like this:

class WyzeCluster(CustomCluster, Basic):
    """Wyze manufacturer specific cluster implementation."""

    cluster_id = WYZE_CLUSTER_ID
    ep_attribute = "wyze_lock_cluster"
    attributes = {}
    server_commands = {}
    client_commands = {}

    def handle_message(self, hdr, args, dst_addressing):
1 Like

Great, thank you

I am having problems getting the lock to use the quirk. For some reason the pycache folder is not being recreated after I put the quirk in the folder, delete the cache folder, and reboot. I am using a virtual machine. I have tried restarting HA, restarting the VM, and restarting the host. Nothing works. I have removed and added several zigbee devices and the folder never gets regenerated. Is that why my lock isnt using the quirk, or is that unrelated. I appreciate any help.

My lock apparently never sends more than 50 arguments.

Need help, got 2 locks, i do get logs for the manual lock and unlock but i don’t get logs for the open and close action.

any tips?