Zigbee2mqtt: Adding Yale Lock on Hass.io

Created on 6 Feb 2019  Â·  80Comments  Â·  Source: Koenkk/zigbee2mqtt

I'm having trouble setting up my Yale lock with Hass.io and zigbee2mqtt. I can pair the lock, but I need to add it as an unsupported device. I get up to the point of trying to run a test function and trigger some functions, such as locking and unlocking the door but nothing happens. The guide says I need to add a "configure:" section to the devices.js but I can't find any similar devices to base it on, and there's no errors or messages in the debug log to work through it. I'm stuck without knowing what's going wrong. Any ideas to work through it?

https://hastebin.com/ejopevunil.makefile

All 80 comments

Hi !! I have the YMF40 lock from Yale. I could pair the lock too, but now I'm stuck on what doing for have some comunication with the lock. I'm trying to find the path to device.js on a zigbee-shepherd-converters folder, but I didn't find that folder...

@CanuckianOz we need to find out what to send, do you still have another gateway where the device worked with? We can use zigbee sniffing to find out what to send: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_sniff_zigbee_traffic.html

@Koenkk I unfortunately don’t. I specifically went with this method to avoid spending a lot on another hub, but also because most of the hub options aren’t available in Australia. ZWave is on a different frequency here so most hubs are half useless.

I do have a Xiaomi 1st gen gateway, but the lock only says “pairing successful”. It does not provide any confirmation on the hub side.

There is a github project for Smartthings hub... I think It's the same hub type that Yale uses.

(https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy)

I think that codes are:

private getDOORLOCK_CMD_LOCK_DOOR() { 0x00 }
private getDOORLOCK_CMD_UNLOCK_DOOR() { 0x01 }
private getDOORLOCK_CMD_USER_CODE_SET() { 0x05 }
private getDOORLOCK_CMD_USER_CODE_GET() { 0x06 }
private getDOORLOCK_CMD_CLEAR_USER_CODE() { 0x07 }
private getDOORLOCK_RESPONSE_OPERATION_EVENT() { 0x20 }
private getDOORLOCK_RESPONSE_PROGRAMMING_EVENT() { 0x21 }
private getPOWER_ATTR_BATTERY_PERCENTAGE_REMAINING() { 0x0021 }
private getDOORLOCK_ATTR_LOCKSTATE() { 0x0000 }
private getDOORLOCK_ATTR_NUM_PIN_USERS() { 0x0012 }
private getDOORLOCK_ATTR_MAX_PIN_LENGTH() { 0x0017 }
private getDOORLOCK_ATTR_MIN_PIN_LENGTH() { 0x0018 }
private getDOORLOCK_ATTR_SEND_PIN_OTA() { 0x0032 }
private getALARM_ATTR_ALARM_COUNT() { 0x0000 }
private getALARM_CMD_ALARM() { 0x00 }

This code are for specific locks model (Yale Touch Screen Lever Lock, Yale Push Button Deadbolt Lock,Yale Touch Screen Deadbolt Lock, Yale Push Button Lever Lock), but maybe works for all models.

@matisaul That’s an excellent start, thank you. My lock is listed in that document. My initial thought is after having a 10-15min glance at the code is that I don’t know or understand the devices.js or zigbee-shepherd-converter structure and elements yet to translate it. I’ll dive in and see where I get stuck and ask some questions here. I think I’ve got line of sight to at least get it responding and start troubleshooting... would love to fix this and contribute back.

@Koenkk sorry I'm not a developer and it's been a while since university programming. Can you help point me in the right direction per the below?

From @matisaul, we have these resources to help:

private getDOORLOCK_CMD_LOCK_DOOR() { 0x00 }
private getDOORLOCK_CMD_UNLOCK_DOOR() { 0x01 }
private getDOORLOCK_CMD_USER_CODE_SET() { 0x05 }
private getDOORLOCK_CMD_USER_CODE_GET() { 0x06 }
private getDOORLOCK_CMD_CLEAR_USER_CODE() { 0x07 }
private getDOORLOCK_RESPONSE_OPERATION_EVENT() { 0x20 }
private getDOORLOCK_RESPONSE_PROGRAMMING_EVENT() { 0x21 }
private getPOWER_ATTR_BATTERY_PERCENTAGE_REMAINING() { 0x0021 }
private getDOORLOCK_ATTR_LOCKSTATE() { 0x0000 }
private getDOORLOCK_ATTR_NUM_PIN_USERS() { 0x0012 }
private getDOORLOCK_ATTR_MAX_PIN_LENGTH() { 0x0017 }
private getDOORLOCK_ATTR_MIN_PIN_LENGTH() { 0x0018 }
private getDOORLOCK_ATTR_SEND_PIN_OTA() { 0x0032 }
private getALARM_ATTR_ALARM_COUNT() { 0x0000 }
private getALARM_CMD_ALARM() { 0x00 }

fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020,0B05", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD446 BLE TSDB", deviceJoinName: "Yale Assure Lock"

Maybe these can be used for configuring in devices.js? Here's where I'm up to:

zigbeeModel: ['YRD446 BLE TSDB'],
model: 'YRD426NRSC', 
vendor: 'Yale', 
description: 'Yale Assure Keyed Electronic Digital Deadbolt', 
supports: 'locking and status', 
fromZigbee: [], 
toZigbee: [],

All good up to here. I know I need to add a configure section:

What's ieeeAddr, shepherd, coordinator, callback? Some have all 4 variables in the function, others have 3.

configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);```

What is "direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0" and how do I determine these values?

const cfg = {
direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0,
        };

What's the difference between bind, foundation and report?

(cb) => device.bind('genLevelCtrl', coordinator, cb),
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb),

Thank you so much for your work on this project.

I found a interesting post about a smartthings hub connected to a Yale lock and HA.
https://www.reddit.com/r/homeassistant/comments/6lqkw3/yale_locks_zigbee_mqtt_home_assistant/

On this picture, there is a log from ST talking with a yale lock:
https://image.ibb.co/gSXzPa/Front-Door-Lock-ST.jpg

Let's do this in 2 steps:

  1. setup reporting for the device, this should allow us to have the unlock/locked status and battery percentage.
  2. allow to send lock/unlock commands.

For step 1.

{
        zigbeeModel: ['YRD446 BLE TSDB'],
        model: 'YRD426NRSC', 
        vendor: 'Yale', 
        description: 'Yale Assure Keyed Electronic Digital Deadbolt', 
        supports: 'lock/unlock, battery', 
        fromZigbee: [], 
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const device = shepherd.find(ieeeAddr, 1);

            const actions = [
                (cb) => device.report('closuresDoorLock', 'lockState', 0, 3, 0, cb),
                (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 3, 0, cb),
            ];
            execute(device, actions, callback);
        },
    },
  • Please check that on startup of zigbee2mqtt, Device successfully configured.. is logged for this device, if not, try again and wakeup the device before starting zigbee2mqtt (by pressing a few buttons on it).
  • This should spam us (each 3 seconds), with the locked and battery state. (should produce No converter available. messages). Don't worry about the spam, we will fix this later (it's for debugging).
  • If everything above is OK, when unlocking and locking, is the new state reported?

@Koenkk yep! Device configured and now getting device configured and status changes. Lock status changes when I turn the lock (2 is unlocked, 1 is locked). Battery status is coming in but obviously it isn't changing.

Here's the log.

https://hastebin.com/asovozeyey.js

@CanuckianOz

  • is this a full battery?
  • What does "lockState":2 mean? (when is it shown, on lock or unlock?)
  • What does "lockState":1 mean?

Sorry I wasn't clear.

  • It changes to lockstate 2 after I unlock.
  • changes to lockstate 1 after I lock
  • I just changed to new batteries and the state stays at 200. We've had the lock for a couple months and should last for over a year.

@CanuckianOz good, i've reduced the reporting interval, so spamming should be over, let's try to lock/unlock it.

Use the following files:

And send to zigbee2mqtt/0x000d6f0010f9f93f/set lock or unlock.

If that doens't unlock/lock the lock, try to add your pin here: https://github.com/Koenkk/zigbee-shepherd-converters/blob/YRD426NRSC/converters/toZigbee.js#L1127 (e.g. 'pincodevalue': '1234',)

@CanuckianOz good, i've reduced the reporting interval, so spamming should be over, let's try to lock/unlock it.

Use the following files:

And send to zigbee2mqtt/0x000d6f0010f9f93f/set lock or unlock.

If that doens't unlock/lock the lock, try to add your pin here: https://github.com/Koenkk/zigbee-shepherd-converters/blob/YRD426NRSC/converters/toZigbee.js#L1127 (e.g. 'pincodevalue': '1234',)

Hi @Koenkk ,

I'm using the Hassio add-on... To get this config working, I need to copy this 3 files into "/share/zigbee2mqtt/" folder? And use "zigbee-shepard-devices" : "true" option? Or I need to do something else?

Please, help me configuring this :(

I was looking into database.db, and I found this;

{"id":2,"type":"EndDevice","ieeeAddr":"0x000d6f00118c1895","nwkAddr":51588,"manufId":4491,"manufName":"ASSA ABLOY iRevo","powerSource":"Battery","modelId":"iZBModule01","epList":[1],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":10,"inClusterList":[0,1,3,4,5,9,10,32,257],"outClusterList":[10,25],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genPowerCfg":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genGroups":{"dir":{"value":1},"attrs":{}},"genScenes":{"dir":{"value":1},"attrs":{}},"genAlarms":{"dir":{"value":1},"attrs":{}},"genTime":{"dir":{"value":3},"attrs":{}},"genOta":{"dir":{"value":2},"attrs":{}},"genPollCtrl":{"dir":{"value":1},"attrs":{}},"closuresDoorLock":{"dir":{"value":1},"attrs":{}}}}},"_id":"14rCvKxH6MxiqK1Z"}

can I configure the lock with this data??

You should replace the files with the ones from: https://github.com/Koenkk/zigbee2mqtt/issues/1032#issuecomment-461991343

Files can be found under node_modules/zigbee-shepherd-converters.

@matisaul note, you're running on Hassio so you need to access the docker to change the toZigbee.js and fromZigbee.js in node_modules/zigbee-shepherd-converters to test. To be honest, it's a PITA unless you're comfortable with linux and the VI editor... I had to fumble around learning the commands, but I'm also just a hobbyist so you might find this easier than me.

https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices_on_hassio.html

OR, I've just finished changing the files per @Koenkk 's changes so if it works we can have it included in the next update, but I don't know how often changes are released or quality control reqs to do that.

@Koenkk I'm getting the following error when starting zigbee2mqtt:

2019-02-09T23:22:03.335Z zigbee-shepherd-converters:devices Configured '(cb) => device.report('closuresDoorLock', 'lockState', 0, repInterval.HOUR, 0, cb)' with result 'Error: request unsuccess: 16'
zigbee2mqtt:error 2019-2-10 09:22:03 Failed to configure 0x000d6f0010f9f93f (0x000d6f0010f9f93f) ('Error: request unsuccess: 16')

Edit: hold the phone, the changes I made to fromZigbee.js and toZigbee.js in the docker weren't retained so that's almost certainly why I'm getting errors on start. I'll have to troubleshoot.

@Koenkk Okay, so I've given up on trying to change in the Hassio host and zigbee2mqtt docker. Way too much effort and the changes aren't persistent to fromZigbee.js and toZigbee.js and were lost hours later.

Instead, and I know this breaks good structure, I took your functions in fromZigbee.js and toZigbee.js and merged them into devices.js under their own section for const converters with the zigbee2mqtt hassio addon configured to refer to devices.js in shared/zigbee2mqtt folder. That works and I can get the lock status and no errors in the log through sending zigbee2mqtt/0x000d6f0010f9f93f/#.

However, it's not responding to lock commands. I tried adding the PIN and nothing happens. Here's what the log says. Interesting that it says "offline", when I'm clearly getting lock & unlock status updates.

  zigbee2mqtt:debug 2019-2-10 20:22:07 Received zigbee message of type 'attReport' with data '{"cid":"genPowerCfg","data":{"batteryPercentageRemaining":198}}' of device 'YRD446 BLE TSDB' (0x000d6f0010f9f93f)
  zigbee2mqtt:info 2019-2-10 20:22:07 MQTT publish: topic 'zigbee2mqtt/0x000d6f0010f9f93f', payload '{"battery":99,"linkquality":113,"device": 
 '{"ieeeAddr":"0x000d6f0010f9f93f","friendlyName":"0x000d6f0010f9f93f","type":"EndDevice","nwkAddr":62892,"manufId":4125,"manufName":"Yale","powerSource":"Battery","modelId":"YRD446 BLE TSDB","status":"offline"},"state":"UNLOCK"}'

Additionally, no device is showing up in the hassio mqtt broker. Is that a separate change? I have mqtt set up to autodiscover unless I'm missing something.

@Koenkk Boom! It works now.

Thanks - I didn't diligently check the log. Because I moved the fromZigbee and toZigbee converters, I also had to include some dependencies in the devices.js. Specifically zclid and cfg.

So it physically works. I can make mqtt service calls to integrate it into my home assistant no problem. One item to note - it doesn't require the PIN to operate. I'm not sure if it's possible to force this requirement, but I will include my own authentication setup. I guess the next step is integrating for device support?

@matisaul if you aren't able to get yours working by my cryptic posts, let me know and I'll share my code and walk you through how to get it working.

@Koenkk Boom! It works now.

Thanks - I didn't diligently check the log. Because I moved the fromZigbee and toZigbee converters, I also had to include some dependencies in the devices.js. Specifically zclid and cfg.

So it physically works. I can make mqtt service calls to integrate it into my home assistant no problem. One item to note - it doesn't require the PIN to operate. I'm not sure if it's possible to force this requirement, but I will include my own authentication setup. I guess the next step is integrating for device support?

@matisaul if you aren't able to get yours working by my cryptic posts, let me know and I'll share my code and walk you through how to get it working.

Wow, that would be great! Thanks @CanuckianOz ! Please, if you could share files, and the path for using with hassio add-on! Thanks again !!

Great, I will soon integrate this into the dev branch (with Home Assistant auto discovery support).

Supported in the dev brach now! (with HA discovery support). For hassio use -edge.

@CanuckianOz Sorry for bother you, but could you share with me your code? Thanks again!

@matisaul Sorry bud I got stuck on some auto work then adding automations for the door! You can try with the hassio addon dev version zigbee2mqtt-edge from @Koenkk or use the below.

Firstly, add the below to the zigbee2mqtt addon settings in hassio so it defaults to the configuration.yaml. I had issues with it allowing permit_join in the addon settings but it worked once I defaulted to the zigbee2mqtt configuration.yaml.

{
  "data_path": "/share/zigbee2mqtt",
  "devices": [],
  "network_key": [],
  "zigbee_shepherd_devices": true,
  "zigbee_shepherd_debug": true,
}

Then write this into the configuration.yaml in share/zigbee2mqtt
https://hastebin.com/supiqobeju.coffeescript

Restart and make sure everything works. There should be a devices.js in the share/zigbee2mqtt folder. Replace the entire file with the below. I've just added the Yale lock functions and const cfg and const zclid definitions from the top of the tozigbee.js.

https://hastebin.com/masejuzaxo.coffeescript

Wow, thanks @CanuckianOz !! I'll test it tonight.

I forgot to ask you... Do you have this zigbee module?:

https://www.paris.cl/dw/image/v2/BCHW_PRD/on/demandware.static/-/Sites-cencosud-master-catalog/default/dw2e62a2ad/images/imagenes-productos/742/247579-0000-001.jpg?sw=1480&sh=2000&sm=fit

Just to know if we are talking about the same HW,

It works!!! I just change the name of of zigbeeModel attribute ('iZBModule01', that I think is the name of the Yale's Zigbee module) (My lock is a Yale Real Living YMF40). I can Lock/Unlock the door, but sometimes I get some errors (AF data request fails, status code: 240. MAC transaction expired.) , and the actual state of the lock don't seems to be ok...

https://hastebin.com/rutononizo.js

UPDATE: I get a message from the lock:

2019-2-13 10:09:31 - debug: Received zigbee message of type 'devChange' with data '{"cid":"closuresDoorLock","data":{"lockState":1}}' of device 'iZBModule01' (0x000d6f00118c1895)
2019-2-13 10:09:31 - warn: No converter available for 'YMF40' with cid 'closuresDoorLock', type 'devChange' and data '{"cid":"closuresDoorLock","data":{"lockState":1}}'

So, I changed 'type' to 'devChange' on lockstatus of converters (It appears that lockstate === 1 is LOCK):

const converters = {
  YMF40_lockstatus: {
      cid: 'closuresDoorLock',
      type: 'devChange',
      convert: (model, msg, publish, options) => {
          return {state: msg.data.data.lockState === 1 ? 'LOCK' : 'UNLOCK'};
      },
  },

And now I can read the status!

2019-2-13 10:16:31 - debug: Received zigbee message of type 'devChange' with data '{"cid":"closuresDoorLock","data":{"lockState":1}}' of device 'iZBModule01' (0x000d6f00118c1895)
2019-2-13 10:16:31 - info: MQTT publish: topic 'zigbee2mqtt/0x000d6f00118c1895', payload '{"state":"LOCK"}'

Nope... I don't get updated states from the lock. The only way to know the state, is calling: "zigbee2mqtt/0x00000/get"

I think that my error (AF data request fails, status code: 240. MAC transaction expired.) is causing problems to get actual status...

@Koenkk could you help me with this, please?

Wow, thanks @CanuckianOz !! I'll test it tonight.

I forgot to ask you... Do you have this zigbee module?:

https://www.paris.cl/dw/image/v2/BCHW_PRD/on/demandware.static/-/Sites-cencosud-master-catalog/default/dw2e62a2ad/images/imagenes-productos/742/247579-0000-001.jpg?sw=1480&sh=2000&sm=fit

Just to know if we are talking about the same HW,

Hey @matisaul yes that's the one! Standard zigbee module from Assa Abloy.

@matisaul you seem to have a different model, @CanuckianOz has zigbee model YRD426NRSC you have YMF40. Please open a new issue so we can also support this device.

@CanuckianOz can you confirm that this lock is working correctly now? If that's the case, please close this issue.

@Koenkk I was just going to mark this as closed but came across an issue. It mostly is and is receiving lock/unlock commands, but I noticed yesterday that it's no longer picking up the lock status changes in HASS (but changes are showing up in the log) and getting this "no converter available" message in the zigbee2mqtt-edge log when I turn the lock deadbolt. Thoughts?!

https://hastebin.com/birocuvahe.makefile

I'm using this to grab the state...

  • platform: mqtt
    name: Front Door
    state_topic: "zigbee2mqtt/0x000d6f0010f9f93f"
    value_template: "{{ value_json.state }}"

@matisaul you seem to have a different model, @CanuckianOz has zigbee model YRD426NRSC you have YMF40. Please open a new issue so we can also support this device.

@CanuckianOz can you confirm that this lock is working correctly now? If that's the case, please close this issue.

@Koenkk I opened a new topic about this #1118

@CanuckianOz when not receiving status updates do you see anything in the log?

@Koenkk I'm now running the standard zigbee2mqtt release as I can see the Yale Lock has been added. Here's the log when I reboot:

https://hastebin.com/idujuwusul.makefile

I noticed there's a mismatch with the zigbee model and model:

zigbeeModel: ['YRD446 BLE TSDB'],
model: 'YRD426NRSC',

Mine is definitely the YRD426NRSC.

I tried my hacked code, the -edge release and the standard release. Tried uninstalling both and removing the repository and re-adding. Just can't get it to recognize the lock again.

There were different errors earlier this week with other .js files but I can't troubleshoot as I'm using Hass.io and can't edit the files. Let's see what's up with this one?

@CanuckianOz are you sure you are running the latest -edge release, can you post your startup log?

@Koenkk Yes. Uninstalled all and removed the repository before reinstalling the edge version and ensuring my config is right.

Here ya go. Starts up all good then starts throwing errors around the closuresDoorLock function.

https://hastebin.com/aforocomol.makefile

By the way, thanks for all your work and help!

@CanuckianOz can you post the real beginning? The zigbee2mqtt version is logged there.

@Koenkk d'oh this must be frustrating for you...

https://hastebin.com/vibucokelo.makefile

Seems that with hassio, the commit version is not included, could you go inside the docker container (http://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices_on_hassio.html) and post the contents of node_modules/zigbee-shepherd-converters/devices.js here?

@Koenkk arg... I think the next line that I missed answers our question:

zigbee2mqtt:info 2/22/2019, 6:27:39 PM Coordinator firmware version: '20190109'

Which was before you revised. Any idea how I get Hassio to grab the latest?

That is the coordinator firmware version, which is up-to-date.

Somehow the lock cannot be reached, can you try re-pairing the device?

Just giving that a go now... The lock is unpaired but zigbee2mqtt is showing it is paired and I can't remove it. I can't re-pair the lock for whatever reason.

  • Stop zigbee2mqtt
  • Remove all entries of this device from database.db
  • start zigbee2mqtt
  • pair

@Koenkk Sorry, I worked a good chunk of my weekend to get this working again and finally got it. I tried your advice but it wasn't allowing any new devices to join, including some xiaomi zigbee sensors. An MQTT device was also publishing a constant lock command. So I copied my settings and uninstalled Mosquitto, Z2mqtt and re-flashed my CC2531 dongle.

Anyway, fresh install of everything including using the zigbee2mqtt-edge Hass.io add-on and it now works out of the box. Got the lock working in 2min once that was done.

I'll close this one out, thanks buddy!

Hey.

I have Yale Assure Bluetooth Lock, from New Zealand. Model number is YRD426NRSC. Supports optional zigbee or z-wave module.

Listed here (it's the one that also takes a key).
https://www.assaabloy.co.nz/en/local/nz/products/keyless-entry/electronic-digital-locking/assure-lock/

Is this lock working with zigbee2mqtt? I have the lock and am currently using zigbee2mqtt for all my Xiaomi gear. Is our safe to go ahead and buy the zigbee module?

PS. I don't use hass.io, I use home assistant in docker and zigbee2mqtt in a docker container as well.

Thanks!

Very excited to hear this might be working!

Hey, yep that’s the exact one I have and it’s now working on zigbee2mqtt (developer branch). You don’t need Hass.io, in fact using that made it harder for me to troubleshoot.

I’m also currently using a xiaomi device on z2m for testing and will be transitioning over from the Xiaomi Gateway for the rest of the devices.

Sweet this is brilliant news. I had been waiting for z wave support for this model, and was thinking of buying both a zwave stick and the zwave module. This will save me money.

Are you based in Australia?

The Xiaomi zigbee2mqtt is a bit painful to pair as when I did it I had to press the button many times over 2-5 minutes per sensor, but once it is paired there are no difficulties and everything works well and you can ditch the gateway.

Yep I’m in Oz and that’s why I did it, to save money and not have another bridge to manage. Plus Z-wave modules are hard to find here and ANZ-compatible bridges on our frequency are even more so.

Where did you buy the zigbee module in Australia from and how much was it. They are $150 here. I have a friend who regularly goes back and forth to Sydney, I might buy it in Au.

@CanuckianOz

Are you sure that is the right one?

On the auction description it has YRD-ZBM-1 listed as the model number.

But I thought our locks needed yrd-zbm-2

Can you confirm,
Thanks.

Yes it needs to be ZBM 2. The other one is Zwave. That’s the exact seller and and i got it from and it’s zigbee and works fine. I didn’t look at the model number... thats a typo.

Thanks, i bought the module from here: https://www.ebay.com.au/itm/Yale-Assure-Zigbee-Network-Module-integrate-your-Yale-Lock-to-home-auto-system/273430010317?epid=6023135796&hash=item3fa9b2d9cd:g:SuMAAOSwm~Fbhd4T

And it works with my Yale YRD 426 Assure Bluetooth Lock.

Thank you!

A touch late to the party. Another Aussie here.

I have added the Yale lock with the Zigbee module and it has picked up the device and I can Lock and Unlock via both MQTT and home assistant.

However, the state always shows as LOCKED.

Any suggestions?

@hvddrift I noticed that when first added then after a bit it was solid. I think the mesh just has to get stronger or something.

Me too - seems to come good after a while for some reason. @Koenkk is this a normal problem?

I'm not aware of such problem (but I also don't have this device).

I have an issue where the yale lock seems to be sending a lot of data in the zigbee log. It's updating it's status every 2 seconds.

Here is the pastebin of zigbee2mqtt log (all entries):
https://pastebin.com/DsM7uykb

Here is the pastebin of the zigbee2mqtt log with just the yale entries:
https://pastebin.com/0ZgN7jyt

And these is the entry in the database.db file for the yale lock:
{"id":27,"type":"EndDevice","ieeeAddr":"0x000d6f0010fe7f14","nwkAddr":63508,"manufId":4125,"manufName":"Yale","powerSource":"Battery","modelId":"YRD446 BLE TSDB","epList":[1],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":10,"inClusterList":[0,1,3,9,10,32,257,2821],"outClusterList":[10,25],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{"zclVersion":1,"appVersion":255,"hwVersion":2,"manufacturerName":"Yale","modelId":"YRD446 BLE TSDB","powerSource":3}},"genPowerCfg":{"dir":{"value":1},"attrs":{"batteryVoltage":53,"batteryPercentageRemaining":136,"batterySize":3,"batteryQuantity":4,"batteryAlarmMask":7,"batteryVoltMinThres":38,"batteryVoltThres1":39,"batteryVoltThres2":42,"batteryVoltThres3":44,"batteryPercentMinThres":6,"batteryPercentThres1":13,"batteryPercentThres2":20,"batteryPercentThres3":25,"batteryAlarmState":0}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genAlarms":{"dir":{"value":1},"attrs":{}},"genTime":{"dir":{"value":3},"attrs":{}},"genOta":{"dir":{"value":2},"attrs":{}},"genPollCtrl":{"dir":{"value":1},"attrs":{}},"closuresDoorLock":{"dir":{"value":1},"attrs":{}},"haDiagnostic":{"dir":{"value":1},"attrs":{}}}}},"_id":"5fmO8GPiC51J5ttC","hwVersion":2}

@kiwijunglist I'm very confused by this log

  • line 4: 5/1/2019, 10:15:21 PM
  • line 17: 5/1/2019, 10:16:15 PM
  • line 81: 5/1/2019, 10:15:08 PM

What happened to the order?

It's from portainer. I select all the lines individualy then click copy selected lines. I must not of clicked them all in order??

Here is a bigger dump of last 1000 log lines from zigbee2mqtt via portainer:
https://pastebin.com/ffw78Vms

And here is the same dump (400 lines) if i filter for "0x000d6f0010fe7f14" which is the yale lock:
https://pastebin.com/bprYAGjK

Let me know if you require more information, or if you would like the logs without the timestamps.

Could you try changing https://github.com/Koenkk/zigbee-shepherd-converters/blob/master/devices.js#L3484 to

(cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', repInterval.HOUR, repInterval.MAX, 0, cb),

I can't do that because I'm not sure how to do that.

The instructions state i need to add zigbee_shepherd_devices: true into my configuration, but they give an example for hass.io only.

I checked the documentation for guideance here:
https://www.zigbee2mqtt.io/configuration/configuration.html

But there is no mention of this option.

This is my configuration.yaml

homeassistant: true
mqtt:
  base_topic: zigbee2mqtt
  password: xxxxxxxxx
  server: 'mqtt://192.168.1.99'
  user: mike
permit_join: false
serial:
  port: /dev/ttyACM0
advanced:
  log_level: debug
  rtscts: false

do i use

zigbee_shepherd_devices: true

or

advanced:
  zigbee_shepherd_devices: true

Thanks

This is my compose

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:latest-dev
    restart: unless-stopped
    volumes:
      - ${DOCKERCONFDIR}/zigbee2mqtt:/app/data
    devices:
      - "/dev/ttyACM0"
    environment:
      - TZ=${TZ}
      - PGID=${PGID}
      - PUID=${PUID}
    depends_on:
      - mosquitto

I'm not sure how to map out the devices.cs so I can edit it inside the docker container, it's unclear as to where the location of the file is, i presume I have to mount a volume to make devices.cs outside the container so i can edit it?

I can't find devices.cs inside /app/data ...

Would this be the location of the file inside docker container /share/zigbee2mqtt/devices.cs ?

You should be able to find the file in the container under /app/node_modules/zigbee-shepherd-converters/devices.js

i only have: /app/node_modules/zigbee-herdsman-converters/devices.js

there is no: /app/node_modules/zigbee-shepherd-converters/devices.js

mike@server:~/.docker/config$ docker exec zigbee2mqtt find / -name devices.js
/app/devices.js
/app/node_modules/zigbee-herdsman-converters/devices.js

Excerpt from /app/node_modules/zigbee-herdsman-converters/devices.js

    // Yale
    {
        zigbeeModel: ['YRD446 BLE TSDB'],
        model: 'YRD426NRSC',
        vendor: 'Yale',
        description: 'Assure lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock, fz.generic_lock_operation_event, fz.battery_200],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },
    {
        zigbeeModel: ['YRD226 TSDB'],
        model: 'YRD226HA2619',
        vendor: 'Yale',
        description: 'Assure lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock, fz.battery_200],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },
    {
        zigbeeModel: ['YRD256 TSDB'],
        model: 'YRD256HA20BP',
        vendor: 'Yale',
        description: 'Assure lock SL',
        supports: 'lock/unlock, battery',
        fromZigbee: [
            fz.generic_lock,
            fz.generic_lock_operation_event,
            fz.battery_200,

        ],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },
    {
        zigbeeModel: ['iZBModule01'],
        model: 'YMF40',
        vendor: 'Yale',
        description: 'Real living lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock_operation_event],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },

/app/node_modules/zigbee-herdsman-converters/devices.js is the correct one (dev = herdsman, 1.6 = shepherd)

Thanks.

I couldn't figure out where to put/replace

(cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', repInterval.HOUR, repInterval.MAX, 0, cb),

@kiwijunglist with zigbee-herdsman-converters it is the same as: https://github.com/Koenkk/zigbee-shepherd-converters/blob/zigbee-herdsman-converters/devices.js#L923

    {
        zigbeeModel: ['YRD446 BLE TSDB'],
        model: 'YRD426NRSC',
        vendor: 'Yale',
        description: 'Assure lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock, fz.generic_lock_operation_event, fz.battery_200],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },

Change to:

    {
        zigbeeModel: ['YRD446 BLE TSDB'],
        model: 'YRD426NRSC',
        vendor: 'Yale',
        description: 'Assure lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock, fz.generic_lock_operation_event, fz.battery_200],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', repInterval.HOUR, repInterval.MAX, 0, cb),
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },

Is that correct?

Actually await configureReporting.batteryPercentageRemaining(endpoint); should already set up the battery reporting, can you share your database.db file?

Database.db -> https://pastebin.com/HqHSA3iK

I don't see a yale entry, is that because I've gone and taken out the zigbee module to stopbatteries running flat and I need to put it back in and then restart zigbee2mqtt container?

  • Yale is id 27 right?
  • In devices.js change the configure key to meta: {configureKey: 2},
  • Update to the latest dev branch (just fixed a bug which prevented reporting from being set-up)
  • Start zigbee2mqtt, you should see a Succesfull or Failed to configure for your device.
  • If battery reporting doesn't work after that (can take up to a day); please share the log of the startup from the previous step (first 1 minute of zigbee2mqtt starting) and your database.db.

I'm not sure how to find the ID.
I have updated to latest development branch
I edited the devices.js as instructed

    // Yale
    {
        zigbeeModel: ['YRD446 BLE TSDB'],
        model: 'YRD426NRSC',
        vendor: 'Yale',
        description: 'Assure lock',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.generic_lock, fz.generic_lock_operation_event, fz.battery_200],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },
    },

I added the zigbee module back to the yale lock
I tried to repair
I get this error:

zigbee2mqtt:error 2019-09-29T00:03:28: Failed to interview '0x000d6f0010fe7f14', device has not successfully been paired

7f14'


zigbee2mqtt:info  2019-09-29T00:03:14: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_started","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'


zigbee2mqtt:debug 2019-09-29T00:03:18: Device '0x000d6f0010fe7f14' announced itself


zigbee2mqtt:error 2019-09-29T00:03:28: Failed to interview '0x000d6f0010fe7f14', device has not successfully been paired


zigbee2mqtt:info  2019-09-29T00:03:28: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_failed","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'


zigbee2mqtt:debug 2019-09-29T00:04:02: Received MQTT message on 'zigbee2mqtt/0x000d6f0010fe7f14/set' with data 'UNLOCK'


zigbee2mqtt:debug 2019-09-29T00:04:02: Publishing 'set' 'state' to '0x000d6f0010fe7f14'


zigbee2mqtt:error 2019-09-29T00:04:03: Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'


zigbee2mqtt:info  2019-09-29T00:04:03: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"zigbee_publish_error","message":"Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'


zigbee2mqtt:debug 2019-09-29T00:04:05: Received MQTT message on 'zigbee2mqtt/0x000d6f0010fe7f14/set' with data 'UNLOCK'


zigbee2mqtt:debug 2019-09-29T00:04:05: Publishing 'set' 'state' to '0x000d6f0010fe7f14'


zigbee2mqtt:debug 2019-09-29T00:04:05: Received MQTT message on 'zigbee2mqtt/0x000d6f0010fe7f14/set' with data 'UNLOCK'


zigbee2mqtt:debug 2019-09-29T00:04:05: Publishing 'set' 'state' to '0x000d6f0010fe7f14'


zigbee2mqtt:debug 2019-09-29T00:04:05: Received MQTT message on 'zigbee2mqtt/0x000d6f0010fe7f14/set' with data 'UNLOCK'


zigbee2mqtt:debug 2019-09-29T00:04:05: Publishing 'set' 'state' to '0x000d6f0010fe7f14'


zigbee2mqtt:error 2019-09-29T00:04:05: Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'


zigbee2mqtt:info  2019-09-29T00:04:05: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"zigbee_publish_error","message":"Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'


zigbee2mqtt:error 2019-09-29T00:04:06: Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'


zigbee2mqtt:info  2019-09-29T00:04:06: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"zigbee_publish_error","message":"Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'


zigbee2mqtt:error 2019-09-29T00:04:07: Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'


zigbee2mqtt:info  2019-09-29T00:04:07: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"zigbee_publish_error","message":"Publish 'set' 'state' to '0x000d6f0010fe7f14' failed: 'Error: Data request failed with error: 'No network route' (205)'","meta":{"friendly_name":"0x000d6f0010fe7f14"}}'

Can you start zigbee2mqtt with DEBUG=zigbee-herdsman* npm start when pairing the device? First the interviewing has to be fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

z4rn0x picture z4rn0x  Â·  3Comments

CodeFinder2 picture CodeFinder2  Â·  4Comments

ophilips picture ophilips  Â·  4Comments

andreasbrett picture andreasbrett  Â·  3Comments

Koenkk picture Koenkk  Â·  3Comments