esphome / esphome/feature-requests

Interlock for all switches

Open
#1,709 1 comment 9 reactions 0 assignees View on GitHub
enhancement
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**

The interlock feature is useful, but it is not something that shall be limited to the GPIO platform only (so different switches can be synchronized). From the code point of view, I think the best is to move the interlock feature in the Switch class.

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

I have four relays connected to four GPIOs. For better understanding I wanted to add another level of abstraction, so I wrote

```
output:
- platform: gpio
pin: D5
id: relay_ch1
switch:
- platform: output
name: "My output 1"
output: 'relay_ch1'
```

This, however, does not allow the interlock feature to be used. Consequently I had to modify my configuration in:

```
switch:
- platform: gpio
pin: D5 # relay_ch1
name: "My output 1"
```

This is, in my opinion, less clear (and does not allow to interlock different types of switches)

**Additional context**

I don't know if this is actually feasible for all types of Switches, so I don't know if it can be directly included in the Switch base class.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Switch class and the existing interlock implementation in the GPIO and output switch entry points. Check how switch platforms are configured and whether interlocking can span them; done means supported switch types can use the feature while the documented GPIO and output configurations behave consistently.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.