I have a Yale Doorman lock that’s integrated with my Homeassistant. Previously, I was able to control the lock through my Veirsure alarm system without any issues. However, after a recent update a couple of months ago, the integration stopped working.
It appears that the problem lies in the number of digits in the Yale Doorman code. Homeassistant now expects a maximum of 4 digits, while the Yale Doorman requires at least 6 digits.
Initially, I had the following code, which functioned correctly:
lock:
- platform: template
name: 'Head Entry Lock'
value_template: "{{ states('lock.entre') }}"
lock:
service: lock.lock
data:
entity_id: lock.entre
code: 123456
unlock:
service: lock.unlock
data:
entity_id: lock.entre
code: 123456
Since the update, the following error message is displayed:
“Failed to call service lock/unlock. Code ‘123456’ for unlocking lock.entre doesn’t match pattern ^\d{4}$”
To resolve this issue, I attempted to modify the code as follows:
lock:
- platform: template
name: 'Head Entry Lock'
value_template: "{{ states('lock.entre') }}"
lock:
service: script.lock_with_code
data:
entity_id: lock.entre
code: 123456
unlock:
service: script.unlock_with_code
data:
entity_id: lock.entre
code: 123456
script:
lock_with_code:
sequence:
- condition: template
#value_template: "{{ trigger.event.data.event == 6 }}"
value_template: "{{ trigger.event.data.new_state.attributes.code | length == 6 and trigger.event.data.new_state.attributes.code | regex_match('^\\d{6}$') }}"
- service: lock.lock
data_template:
entity_id: "{{ trigger.event.data.new_state.entity_id }}"
unlock_with_code:
sequence:
- condition: template
#value_template: "{{ trigger.event.data.event == 6 }}"
value_template: "{{ trigger.event.data.new_state.attributes.code | length == 6 and trigger.event.data.new_state.attributes.code | regex_match('^\\d{6}$') }}"
- service: lock.unlock
data_template:
entity_id: "{{ trigger.event.data.new_state.entity_id }}"
Although this modification eliminates the error message, the Yale Doorman lock no longer responds to lock/unlock commands. It seems as if nothing happens when I attempt to operate it. I have checked the logs, but there is no relevant information available.
Do any of you have insights into what might be causing this problem? Or perhaps you have suggestions on how I can get the integration to work again as it did before? Any help would be greatly appreciated.
Thanks in advance.