Ring Intercom Integration (Lock Template) and automations

Hello everyone,

I want to share my solution for using a Ring Intercom integration as a lock. The integration only supports the button to open the door, which works, but the entity is not usable, for example, in a Mushroom lock card. The state of the button only shows when it has been pressed. I searched for a solution but couldn’t find a good one.

Lock Template: (replace your button in the lock template card)


# Ring Intercom Lock Template
lock:
  - platform: template
    name: "Haustür"
    value_template: >
      {% set last_pressed = states.button.haustur_tur_offnen.last_changed %}
      {% if last_pressed and (now() | as_timestamp - last_pressed | as_timestamp) <= 1 %}
        false
      {% else %}
        true
      {% endif %}
    lock:
      service: script.no_op  # Platzhalter, da keine Sperrfunktion benötigt wird
    unlock:
      service: button.press
      target:
        entity_id: button.haustur_tur_offnen

I noticed that Home Assistant is relatively slow in detecting a change in entities, so I had to create an automation that triggers after pressing the Ring Intercom button to check the status of the entity. I added a 2-second delay, which I believe is sufficient, but it can be adjusted if needed.


alias: Haustür Status aktualisieren
description: ""
triggers:
  - trigger: state
    entity_id:
      - button.haustur_tur_offnen
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - action: homeassistant.update_entity
    data:
      entity_id:
        - lock.haustur
mode: single

With this automation, the door opens when the doorbell is pressed.


alias: Haustür öffnen wenn Klingel betätigt wird
description: Auslösen, wenn die Haustürklingel betätigt wird
triggers:
  - trigger: state
    entity_id:
      - event.haustur_klingeln
conditions: []
actions:
  - action: lock.unlock
    metadata: {}
    data: {}
    target:
      entity_id: lock.haustur
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
mode: single

And the last automation is designed so that when I enter my home zone and ring the doorbell within a certain period of time, the door opens.


alias: Haustür öffnen Ein- und Ausschalten wenn Home zone betreten oder verlassen
description: ""
mode: restart
triggers:
  - entity_id: person.xxx
    zone: zone.home
    event: enter
    trigger: zone
  - entity_id: person.xxx
    zone: zone.home
    event: leave
    trigger: zone
conditions: []
actions:
  - choose:
      - conditions:
          - condition: zone
            entity_id: person.xxx
            zone: zone.home
        sequence:
          - data: {}
            target:
              entity_id: automation.haustur_offnen_wenn_klingel_betatigt
            action: automation.turn_on
          - delay:
              hours: 0
              minutes: 15
              seconds: 0
              milliseconds: 0
          - data: {}
            target:
              entity_id: automation.haustur_offnen_wenn_klingel_betatigt
            action: automation.turn_off
    default:
      - data: {}
        target:
          entity_id: automation.haustur_offnen_wenn_klingel_betatigt
        action: automation.turn_off

If anyone has suggestions for improvement, I would be very happy to receive feedback.

2 Likes

It should be a lock, currently can’t share via HomeKit bridge to IOS home, and automations are hard to make since they need to hear for events, doesn’t make too much sense to mee, they need to work this out.

I don’t know what you mean. As you know, the Ring integration does not offer a lock, which is why I created a template. I don’t use HomeKit, but since it’s a lock template, I assume it should be usable there as well. Or do you mean that the developers of the integration should implement it as a lock?

Hey Isibizi,
I am looking for exactly what you did with your Ring Intercom. However I haven’t uderstood where to paste the code to make it function.

Any help would be highly appreciated.

Update (works for me):

  1. check and update the code to your device names
  2. install the file editor
  3. paste it inside of the configuration.yaml file at the bottom
  4. Reload the YAML-Configuration and Restart Home Assistant
  5. (for Apple Users/ HomeKit Bridge users) use the accessory mode and include locks
  6. use the Automation of Ismail and update your personal delay