Integration with ID Lock 150

Well, if you use my code and setup above, it will work.

I think what you need to do is check the second sensor. That is what fetches the slot used. I didn’t succeed in combining them in one EventSensor. Hence two. Which works really well.

But there are several ways to accomplish the same thing. If you want to do it in another way, please do.

hmm… i have to do some more tests then.
Men tack för bilderna =)

Ställt in allt som ditt nu, Med kod visar den rätt namn.
Men när jag testar med Tag så får jag “Upplåst av Home Assistant”
Vad missar jag?

          {% elif is_state('sensor.id_lock', 'RF unlock operation') %}
            Upplåst av Home Assistant

Ah I read it again, and now I think I see what you mean.
You do get the correct slot number, and the lock categorizes a tag unlock as a RF Unlock?

Then I guess you need to adjust the logic.
Maybe another EventSensor and include the tag translation as in the first case.
And probably a select case to differentiate between Z-wave and a tag unlock.

To test, you can listen to the events in Dev Tools > Events > Listen to events
Then lock with RF, unlock with code, lock with button, unlock with tag and so on - while documenting what you did in which order. Then I think you’ll find what I missed. It’s probably an easy fix.

Please report back if you solve it.

Ok, I took a look and I may remember wrong, but I am pretty sure the old integration handled all slots the same - but Z-wave JS obviously doesn’t. Anyway, the code looks like spaghetti, but it works:

First, set up like the example above.
Second, add a template sensor:

Sensor 1 - fetch the tag slot and convert to plain text:

    id_lock_last_tag_tmpl:
      value_template: >-
        {% if 'userId' in state_attr('sensor.id_lock', 'parameters') %}
          No tag used
        {% elif 'data' in state_attr('sensor.id_lock', 'parameters')%}
          {% if state_attr('sensor.id_lock', 'parameters').data[0] == 0 %}
            Home Assistant
          {% elif state_attr('sensor.id_lock', 'parameters').data[0] == 26 %}
            Tag slot 26
          {% elif state_attr('sensor.id_lock', 'parameters').data[0] == 27 %}
            Tag slot 27
          {% endif %}
        {% endif %}

And adjust the id_lock_last_action_tmpl from above:

    id_lock_last_action_tmpl:
      value_template: >-
        {% if is_state('sensor.id_lock', 'Keypad unlock operation') %}
          Unlocked by {{ states('sensor.id_lock_user')}} 
        {% elif is_state('sensor.id_lock', 'RF unlock operation') %}
          Unlocked by {{ states('sensor.id_lock_last_tag_tmpl')}} 
        {% elif is_state('sensor.id_lock', 'Manual unlock operation') %}
          Upplåst med knapp
        {% elif is_state('sensor.id_lock', 'Manual lock operation') %}
          Låst med knapp
        {% elif is_state('sensor.id_lock', 'RF lock operation') %}
          Låst av Home Assistant
        {% elif is_state('sensor.id_lock', 'Keypad lock operation') %}
          Låst utifrån
        {% elif is_state('sensor.id_lock', 'Auto lock locked operation') %}
          Låst automatiskt
        {% elif is_state('sensor.id_lock', 'Lock jammed') %}
          Låset har fastnat
        {% elif is_state('sensor.id_lock', 'All user code deleted') %}
          Alla koder har tagits bort
        {% elif is_state('sensor.id_lock', 'Single user code deleted') %}
          En kod har tagits bort
        {% elif is_state('sensor.id_lock', 'Single user code added') %}
          En kod har lagts till
        {% elif is_state('sensor.id_lock', 'New user code not added due to duplicate code') %}
          Ny kod kunde inte läggas till (inte unik)
        {% elif is_state('sensor.id_lock', 'Unlock By RF with invalid user code') %}
          Unlock By RF with invalid user code
        {% elif is_state('sensor.id_lock', 'Lock by RF with invalid user code') %}
          Lock by RF with invalid user code
        {% else %}
          Fel: Okänd status
        {% endif %}

…and so on.

Again, I’m sure there are better ways.
Please report back if you find one.

1 Like

I have switched to new Z-wave JS, but I cannot get my lock to work. I suspect I need to do the FW update… Have someone tried to do FW upgrade with ZWaveJSMQTT control panel? How can you find out what is the current FW?

Only way possible to update FW i know of is with Zwave PcControler from SiliconLabs. Haven’t tried it though.

edit: Found post regarding this.

Regards Andreas

So it is now possible to upgrade IDlock FW from zwaveJS? Do I need zwavejs2MQTT or the native zwaveJS addon? Can I install zwaveJS2MQTT addon as controlpanel to my existing native zwaveJS installation?
Big thanks!

/Martin

I tried to integrate the lock with zwavejs2MQTT, but I only get two entities, lock and door status and they do not work. I also cannot include it secure, judging from the control panel


Also when I tried to do FW upgrade, it said " Error while calling api beginFirmwareUpdate: Unable to extract firmware from file: Could not detect firmware format"
Any ideas?

What version of zwavejs2mqtt/zwavejs?? I can confirm it was working a while ago.

I am using the lastest zwajejs2mqtt (0.6.1) and integration in HA. I think my problem is that I cannot include my lock with secure inclusion. Without secure inclusion, fw upgrade is not possible I think. It is a real mystery why I cannot install with secure inclusion, tried severel times, also tried with new secure key. Any idea before I order a new zwave module…

Have you tried including it with your zwave stick close?

You mean close distance? Good point, perhaps I will give it a try. Need to decide to move my NUC or my door… :wink:

This doesnt match any version from github?

Sorry, 0.6.1 is the revision of the HA add-on. Looks like addon is using the latest 2.1.2.

idlock firmware testing was done on node-zwave-js 6.1.2 since early feb, so your version should be good. Try to get it securely included. The shorter distance between stick/idlock the better.

OK. I moved the stick closer and managed to include secure! Now I can operate the look and get some more sensors. However I receive some errors like “Nonce 0x01 expired, cannot decode security encapsulated command.” I also cannot do FW upgrade, “2021-03-09 13:10:03.185 INFO ZWAVE: The node did not respond in time beginFirmwareUpdate { success: false, message: ‘The node did not respond in time’ }”

Are you sure the interview is done yet? You may have to heal your network when moving your stick.

I have healed the network, but only get these four sensors.
image
I suspect it has to do with my FW 1.5 and it seems not successful to do fw upgrade.