esphome / esphome/feature-requests

Add `restore_mode:` option for locks

Open
#2,006 1 comment 1 reaction 0 assignees View on GitHub
component: lock
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

I want to be able to configure a lock like this:
```yaml
output:
- platform: gpio
pin:
number: 20
mode: output
id: PB
inverted: true

lock:
- platform: output
name: "Shared Door"
output: 'PB'
restore_mode: ALWAYS_OFF
```
I have to invert the output to get 'locked' and 'unlocked' right showing up in the UI (I use a relay to close a circuit which powers the solenoid that opens the door) so a GPIO output 'ON' opens the door, and 'OFF' locks it. However the result is that on reboot of the device the door unlocks itself (unsafe). So having a restore mode on the lock (or Output) could help me make this safe by default.

**Please describe your use case for this integration and alternatives you've tried:**

Considered using a switch which does support `restore_mode` and then using that as the platform for the lock as a middleman but lock does not support the switch platform
**Additional context**

ESP on PicoW, running a custom circuit.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.