Yale Connexis Lock Automation - lookup value from external file

Hi,
I am trying to integrate a Yale lock into home assistant. So far all is good and I get a pushbullet notification when the lock is unlocked indicating the id number of the passcode used. What I would like to do is lookup that id in an external file to get the name of the person using that passcode.

Currently my notification message is:
14:15 - Unlocked with Keypad by user 2

I would like:
14:15 - Unlocked with Keypad by Bob

To do this I would like a separate (csv?) file to maintain mappings of user id’s to names such as:
method, user id, name
keypad, 2, Bob

I would prefer not to have this mapping in the code itself. I’m not sure if this is doable?

My existing code is below.

- id: 'front_door_unlocked'
  alias: Front Door Unlocked
  trigger:
    - platform: state
      entity_id: lock.assa_abloy_keyless_connected_yd_01_con_locked
      to: unlocked
  action:
    #delay 1 second to give the attribute a chance to update.
    - delay: '00:00:01'
    - service: notify.pushbullet
      data:
        message: "{{ now().strftime('%H:%M') }} - {{states.lock.assa_abloy_keyless_connected_yd_01_con_locked.attributes['lock_status']}}"

Thanks!

1 Like

This is another I use to notify if it gets jammed


- alias: Notify if Front Door Lock is jammed
  trigger:
    - platform: state
      entity_id: sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type
      to: '9'
    - platform: state
      entity_id: sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type
      to: '17'
    - platform: state
      entity_id: sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type
      to: '23'
    - platform: state
      entity_id: sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type
      to: '26'
  action:
    - service: notify.pushover
      data:
        message: The front door lock is jammed
        title: Home Automation
    - service: notify.alexa_media
      data:
        target:
          - media_player.living_room
        data:
          type: tts
1 Like

This is what I use now, just edit the “Name1” etc with names you want to use for each tag/card

    front_door_lock_status:
      friendly_name: "Front Door Lock Status"
      value_template: >-
        {%- if is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "144") -%}
          {%- if is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "0") -%}
            Unlocked by Master Code
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "1") -%}
            Unlocked by Master Card
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "3") -%}
            Unlocked by Name1
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "4") -%}
            Unlocked by Name2
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "5") -%}
            Unlocked by Name3
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "2") -%}
            Unlocked by Name4
          {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level", "6") -%}
            Unlocked by Name5
          {%- else -%}
            Unlocked by User {{ sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level }}
          {%- endif %}
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "27") %}
          Auto Re-locked
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "21") %}
          Manually Locked
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "22") %}
          Manually Unlocked
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "24") %}
          HA Locked
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "25") %}
          HA Unlocked
        {%- elif is_state("sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type", "161") %}
          Tamper
        {%- else -%}
          Unknown Level {{ states.sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_level.state }} Type {{ states.sensor.assa_abloy_yale_conexis_l1_sd_l1000_ch_alarm_type.state }}
        {%- endif %}

You could consider using a file sensor which can read in json files with multiple values in a dictionary. Then you should be able access the keys and values in the automation.

Thanks!
I will give both a try!

Do you have any issue when unlocking your door by any card and the alarmlevel sets to 1 first every time, before setting to the alarmlevel to show the user name?

Because of this, im having a duplicate entry whenever the door is opened by a card (not by fobs though) so my sensor will go

Unlocked by Master Card > Unlocked by Name1

Im unsure how to deal with this

Seems strange, I don’t use any cards, only fobs and sticky rfid tags and have not seen this issue.

Maybe comment out the master card line and see if that works ?

Yeh, that’s what I’ve tried to do but then my sensor gets an “unknown” state, for a split second. Which wasn’t an issue if I wasn’t showing the last 5 accesses. However I’ve just set it to ignore from my log card, so I’m all good now. Thank you.

As a side note, are you using the Conexius app to add the cards etc? Whenever I try and add a sticky rfid tag it doesn’t accept it and then just doesn’t add anything further until I delete and reinstall the app… And don’t talk to me a out trying to delete keys from the app…!!

Not used the app for a long time, only when I first set up all the keys. It’s a crap app and I’ve contacted them about a few issues in the past and they still aren’t fixed.

One of my Schlages BE469s used to do this so I skipped code slot 1 and started my codes at 2… I’m not sure if the BE469ZPs still did that also because I still at this point just skip code slot 1.