ZHA Lock setup

I must be missing something. I cannot find a way to tell Home Assistant that my lock is a lock.

I installed a Kwikset Convert zigbee lock on my door.
The lock is connected.

I have tried this in my config:

#zigbee
zha:
  usb_path: /dev/ttyUSB1
  database_path: /home/homeassistant/.homeassistant/zigbee.db
  device_config: 
    00:24:46:ff:fd:03:06:4e:
      type: lock

But that doesn’t seem to work.

I have tested the lock_door and unlock_door in the zha config screen.
image

I also check the lock state which seems to work as well.

If there isn’t a way to just say “Hey this thing is a lock.” Is there a good example of a Home Assistant script to make the zha calls.

Thanks for your help.

Okay it was a lot was a lot easier than i was making it out to be.

Turns out I just needed to add

lock:

to my config so that locks in general were available.

1 Like

WilliamRandol, can you get it to lock, open, show status and change keys? I have a Zigbee Module for Yale Assure and I want to attempt to make it work.

Thanks in advance.

I can lock, unlock, and show status. Assigning keys I would imagine is a function of the official app.

Thank you…

Are you using the App?

No. I don’t know if the same is true for the Yale, but for the Kwikset lock that I have the functionality of the kevo app is replaced with the Amazon Key app and requires a cloud cam with the key plug to work.

Well, I have a Yale YRD 226 Assure Lock that I got a Zigbee Module for and it is reconized as a lock in Integrations. I do have “lock:” in my configuration. When I attempt to lock it using the GUI or the integrations screen, I get this:

2019-07-14 17:51:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/bellows/zigbee/application.py", line 365, in request
    res = await asyncio.wait_for(req.send, timeout=APS_ACK_TIMEOUT)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
zigpy.exceptions.DeliveryError: [0x1425:0:0x8000]: message send failure: EmberStatus.DELIVERY_FAILED
2019-07-14 17:54:24 ERROR (MainThread) [homeassistant.components.zha.lock] Error with lock_door: [0x1425:1:0x0101]: message send failure: EmberStatus.DELIVERY_FAILED

Any ideas?

That error means that HA did not get an ACK, meaning the message or reply was lost along the way. It seems like it does not have enough signal strength.

Did you pair it first and then install it in the door? If so that would explain it. Maybe you need to add some repeater device to improve the strength.

I paired it where it is in the door:

nwk: 0x1425
ieee: 00:0d:6f:00:0e:85:89:3b
lqi: 255
rssi: -69
battery_size: AA
battery_quantity: 4
battery_level: 75
friendly_name: Yale YRD226/246 TSDB

I also get the messages when I turn the thumbscrew or lock the door with its buttons:

2019-07-14 18:25:51 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/bellows/zigbee/application.py", line 365, in request
    res = await asyncio.wait_for(req.send, timeout=APS_ACK_TIMEOUT)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
zigpy.exceptions.DeliveryError: [0x1425:0:0x8000]: message send failure: EmberStatus.DELIVERY_FAILED
2019-07-14 18:27:37 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/bellows/zigbee/application.py", line 365, in request
    res = await asyncio.wait_for(req.send, timeout=APS_ACK_TIMEOUT)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
zigpy.exceptions.DeliveryError: [0x1425:0:0x8000]: message send failure: EmberStatus.DELIVERY_FAILED

Is there any further debugging that I can enable?

In the case where the cluster ID is 0x8000, I think this means that the coordinator is trying to send a reply to the lock but the lock is not ACKing it for some reason. I would guess it’s not that important though, but is probably a symptom of some other problem.

In the case where the cluster ID is 0x0101 that means the lock is not ACKing the (likely) Door Lock command. That’s obviously a problem.

You can enable more debugging with something like this in your config file:

logger:
  default: warn
  logs:
    zha: debug
    zigpy: debug
    bellows: debug

I am using YRD210 and YRL220 and those are working fine. Do you have other Zigbee devices that are working with HA okay? What does it say on your Zigbee module? Like HA 1.2 or something?

I have a a few motion sensors (centralite) and a few power outlets (also centralite) and and Osram Lightify bulb that have been working and are all working just fine. I just added the lock today. I have this Zigbee module here https://shopyalehome.com/Products/Accessories/AYR202-ZB-HA-USA.aspx
It doesn’t say HA 1.2 or anything.

I did just get these two messages here:

2019-07-14 19:04:34 WARNING (MainThread) [zigpy.zdo] [0x463a:zdo] Unsupported ZDO cluster id 0x8038
2019-07-14 19:04:34 WARNING (MainThread) [zigpy.zdo] [0x463a:zdo] Unknown ZDO cluster 0x8038

That looks like a newer version of the module than the ones that I have. Your problem looks like a low level Zigbee communication issue. Have you tried to remove and re-add the device? I know it’s a pain but I guess you could also remove the lock and place it near the coordinator to see if it’s some kind of routing issue.

What kind of Zigbee adapter do you have on HA? I am using the HUSBZB-1.

@rpress from what I see on the website, not newer, just different module for a different model (say that 3 times fast).

I am using the HUSBZB-1/Nortek adapter. My other Zigbee devices work as usual. I will try to remove and re-add close to the adapter…but…I have two zigbee devices that are further away that work; one is battery powered and one is mains-powered. I also tried putting a zigbee powered outlet between the lock and the adapter and nothing changes. Thanks for answering… I will run through your suggestions and see if anything works.

Changing the batteries, made my problem(s) go away. It works now. Thanks for your time.

Is there a way to tell what code opened the door or if it was manually closed?

Yeah that should be technically possible if the lock supports it (it’s not a mandated feature.) This is not currently implemented in ZHA.

Looks like Zigbee “Operation Event Notification Command” 0x20 is the area of interest.

2 Likes

Did you ever found a way to do this with ZHA?

I got a Schlage Zigbee lock and can’t for the life of me see who unlocks the door.

I have not.

What a bummer, thanks for the info regardless!

Hey Everyone!

Having issues setting up my Lockwood T-Lock (similar to Yale) via ZHA.
Zigbee Compliance documents

Here is the ZHA logs and configuration for device in ZHA:

#HA Log
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.appdb] [0xc315:1:0x0000] Attribute id: 4 value: Yale
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.appdb] [0xc315:1:0x0000] Attribute id: 5 value: YDD-D4F0 TSDB
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for Yale YDD-D4F0 TSDB (00:0d:6f:00:10:8d:af:51)
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1}
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1}
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {11, 13} {1}
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.appdb] [0xc315:1:0x0000] Attribute id: 4 value: Yale
2021-05-10 09:56:34 DEBUG (MainThread) [zigpy.appdb] [0xc315:1:0x0000] Attribute id: 5 value: YDD-D4F0 TSDB

2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0020]: Couldn't set check-in interval: 
2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0020]: finished channel configuration
2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0019]: finished channel configuration
2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0001]: failed to set reporting for 'battery_voltage' attr on 'power' cluster: 
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy.device] [0xc315] Extending timeout for 0x10 request
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.zigbee.application] request (0xC315, 260, 1, 1, 1, 16, b'\x00\x10\x06\x00!\x00 \x10\x0e0*\x01', True, False)
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.api] --> SREQ AF dataRequest tsn: 16 {'dstaddr': 49941, 'destendpoint': 1, 'srcendpoint': 1, 'clusterid': 1, 'transid': 16, 'options': 0, 'radius': 30, 'len': 12, 'data': b'\x00\x10\x06\x00!\x00 \x10\x0e0*\x01'}
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.uart] Send: b'\xfe\x16$\x01\x15\xc3\x01\x01\x01\x00\x10\x00\x1e\x0c\x00\x10\x06\x00!\x00 \x10\x0e0*\x01\xf4'
2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0101]: failed to set reporting for 'lock_state' attr on 'door_lock' cluster: 
2021-05-10 10:03:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC315:1:0x0101]: finished channel configuration
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.SRSP subsystem=Subsystem.AF command_id=1 data=b'\x00' length=1 fcs=100>
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.api] <-- SRSP AF dataRequest tsn: None {'status': 0}
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=128 data=b'\xcd\x01\x10' length=3 fcs=27>
2021-05-10 10:03:34 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF dataConfirm tsn: None {'status': 205, 'endpoint': 1, 'transid': 16}


#ZHA Zigbee Device Signature
{
  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4125, maximum_buffer_size=82, maximum_incoming_transfer_size=255, server_mask=0, maximum_outgoing_transfer_size=255, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x000a",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0009",
        "0x000a",
        "0x0020",
        "0x0101",
        "0x0b05"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "Yale",
  "model": "YDD-D4F0 TSDB",
  "class": "zigpy.device.Device"
}

Any advice on how I can get this added?

1 Like