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.

4 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

Somebody know how to integrate in Google Home with voice activation ?
i’ve add the lock integration in matter hub. (i’ve created an unique id for the lock and after i added on matter).
I added the lock on google home with matter qrcode ( so now it work with google home) but i can’t activate with voice, i’ve tried to create an automation with voice activation, but when i try to use it , GH respond me that the lock not support that functionality.
Sry for my english i’ll hope somebody can help me.
have a good day

Hello, first of all a happy new year!

Can you use the ringing of the doorbell as a trigger using the official Ring integration? For me it doesn’t work and I found in a German forum, that it worked and after an update it doesn’t work anymore.

Thanks and best regards, Müsli

Happy new year!

Sure, see the automation. It is important that you add a delay in example 2sec in the end of your automation

1 Like

Thanks for your reply!

OK, then I will keep on trying. At the moment the trigger (doorbell ringing) isn’t recognized at all, but probably due to a mistake, I use Home Assistant for only one week now…

If it works for you, I know that the problem is on my side, whereas in the German forum it looked like it is a bug in the official integration which at the moment only cannot be solved by using the unofficial Ring MQTT integration.

Even with this automation nothing happens when I ring the doorbell.

alias: Test Ring 1
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.vordereingang_klingeln
conditions: []
actions:
  - action: notify.mobile_app_pixel_8_pro
    metadata: {}
    data:
      message: Test Ring 1
mode: single

Any ideas? Even no traces are available…

In case someone gets the same problem: I deleted in my Ring account under Authorized Client Devices the only entry by home assistant, then deleted the integration and re-installed it, now everything works fine.

Hi,
I have the problem that the trigger is fired again and again…it doesn’t stop

what can cause this?

alias: Test Ring 13
description: “”
triggers:

  • trigger: state
    entity_id:
    • event.vordereingang_klingeln
      conditions:
      actions:
  • target:
    entity_id: button.vordereingang_tur_offnen
    action: button.press
    data: {}
    mode: single

You need an delay in example 1 sec. after your action at the end of your automation.

1 Like

I solved it a little differently than in the OP. I have a simple lock template and automation and it works very reliably.

Lock Template

lock:
  - platform: template
    name: Haustur Ring to Open
    value_template: "{{ is_state('automation.haustur_ring_to_open', 'off') }}"
    optimistic: true
    lock:
      action: automation.turn_off
      target:
        entity_id: automation.haustur_ring_to_open
    unlock:
      action: automation.turn_on
      target:
        entity_id: automation.haustur_ring_to_open

Automation

alias: Haustür Ring to Open
description: 1s nach Klingeln öffnet Haustür
triggers:
  - trigger: state
    entity_id:
      - event.vordereingang_klingeln
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
    enabled: true
  - action: button.press
    metadata: {}
    data: {}
    target:
      entity_id: button.vordereingang_tur_offnen
  - action: lock.lock
    target:
      entity_id: lock.haustur_ring_to_open
    data: {}
mode: single