Using ZWave JS integration (switched from deprecated ZWave integration) for a Yale door lock.
Having trouble setting usercodes on both Scripts and through Services.
Script as below
set_front_door_usercode:
alias: Set Random Usercode
icon: mdi:key
mode: single
sequence:
- data_template:
entity_id: input_number.guest_code
value: '{{ states.sensor.first_set.state | int }}{{ states.sensor.second_set.state
| int }}{{ states.sensor.third_set.state | int }}'
service: input_number.set_value
- service: zwave_js.set_lock_usercode
target:
entity_id: lock.front_door_lock
data:
code_slot: '5'
usercode: '{{ states.input_number.guest_code.state | int }}'
Error logs:
[548038229536] Error handling message: Unknown error
[547894828720] userCode for code slot 5 not found
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 21, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 482, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1209, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 345, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 563, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 630, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 726, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/zwave_js/lock.py", line 127, in async_set_lock_usercode
await set_usercode(self.info.node, code_slot, usercode)
File "/usr/local/lib/python3.8/site-packages/zwave_js_server/util/lock.py", line 89, in set_usercode
value = get_code_slot_value(node, code_slot, LOCK_USERCODE_PROPERTY)
File "/usr/local/lib/python3.8/site-packages/zwave_js_server/util/lock.py", line 32, in get_code_slot_value
raise NotFoundError(f"{property_name} for code slot {code_slot} not found")
zwave_js_server.exceptions.NotFoundError: userCode for code slot 5 not found