WYZE LOCK - Zigbee - Home Assistant - HassIO - HassOS - ZHA integration - Working as expected - remove cloud control

Hello
After spending a few days for understanding why there is no door lock state updates(manually lock, manually unlock, door is open, door is closed) for WYZE LOCK, I got the solution

  1. Enable logging by adding this lines in configuration.yaml
    logger:
    default: info
    logs:
    asyncio: debug
    homeassistant.core: debug
    homeassistant.components.zha: debug
    zigpy: debug
    bellows: debug
    zigpy_xbee: debug
    zigpy_deconz: debug
    zigpy_zigate: debug

  2. By looking for the logs manually lock, unlock, open and close the door. There should be updates in logs like
    Interesting attributes - 52: some number, 41: some number, 56: some number 57: some number
    We interested in 52 and 41
    According door state, “some number” should be different
    We need to change those numbers in lock.py file.

  3. Download " zigpy/ zha-device-handlers" from https://github.com/zigpy/zha-device-handlers/tree/dm/wyze-lock/zhaquirks

  4. Connect to HA via portainer and connect to console

  5. Copy wyze folder to /usr/local/lib/python3.8/site-packages/zhaquirks (there should be lock.py file
    inside wyze folder)

  6. Edit lock.py file with vi editor
    My lock.py file looks like shown below, and it works

        "Interesting attributes - 52: %s, 41: %s, 56: %s, 57: %s",       
         args[52],                                                          
         args[41],                                                                 
         args[56],                                                    
         args[57],                                                          
     )                                                                             
    
     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[52] == 69 and args[41] == 187:                                      
         self.warning("the lock is unlocked manually")                    
         self.endpoint.device.lock_bus.listener_event("lock_event", 2)      
                                                                                   
     elif args[52] == 69 and args[41] == 188:                                      
         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)
7 Likes