--- - alias: "[Lock] Lock A Lock if Unlocked for 3 Minutes" id: "X7P04E2U6FABYRSZ" initial_state: "true" trigger: - platform: state entity_id: lock.lock_01 to: "unlocked" for: hours: 0 minutes: 3 seconds: 0 condition: - condition: template value_template: "{{ states('binary_sensor.door_entrance_01') == 'off' }}" action: - service: lock.lock data: entity_id: lock.lock_01 - service: telegram_bot.send_message data: target: "-1002338954143" message_thread_id: 3 message_tag: night_mode_finished title: "[Home Assistant] Security" message: 'Lock is being locked by automation' # - service: persistent_notification.create # data: # message: "Lock is being locked by automation" # - service: notify.telegram_alex # data: # message: "Lock is being locked by automation"