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.