FutureTense / keymaster

Home Assistant integration for managing Z-Wave enabled locks
MIT License
218 stars 44 forks source link

[Feature Request] Notification Sound before locking #370

Open jeaberman opened 3 weeks ago

jeaberman commented 3 weeks ago

Smartlocks are fairly loud when they lock and it can be surprising when they lock all of the sudden.

An option to broadcast a media file to speakers before the lock happens would be awesome! A simple tone, custom file or TTS maybe.

I am going to try and add this on my own for my setup but I think this would be a nice option for others.

firstof9 commented 3 weeks ago

Setup your own autolock automation and call your TTS service.

jeaberman commented 3 weeks ago

Just want to make sure I am on the right track. I would add this in my packages/keymaster/LOCKNAME_common file? I was planning to edit the keymaster_frontdoorlock_timer_finished and add the action before the lock action. As well as a wait template to wait for it to finish playing before locking. I know this could get wiped out on an update so I wasn't sure if there is a better place to do this

firstof9 commented 3 weeks ago

I'd disable the autolock and create your own automation for it.

Here's how I automated mine:

- alias: Auto Lock Front Door
  id: auto_lock_front_door
  trigger:
    platform: state
    entity_id: lock.front_door
    to: unlocked
    for:
      minutes: 15

  condition:
    condition: state
    entity_id: binary_sensor.frontdoor
    state: "off"

  action:
    - service: lock.lock
      entity_id: lock.front_door

    - service: script.house_announcement
      data:
        this_message: "Front door left unlocked, locking it now."
        volume: 0.9

    - service: script.notifications_handler
      data:
        notify: notify.phones
        this_message: "Front door left unlocked."
        channel: Security