esphome / esphome/feature-requests
`binary_sensor` onchange filter
- 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 am trying to create a template motion sensor that should be on for a couple of seconds whenever my door sensor (binary_sensor) changes state. I suggest adding a filter `onchange` or `derivative` or whatever name suits best:
```yaml
filters:
- onchange:
type: rising | falling | both
impulse_length: 10s
```
Whenever the `binary_sensor` has a rising/falling state the output will be high for 10 s (or whatever value `impulse_length` has)
**Please describe your use case for this integration and alternatives you've tried:**
Practical for all types of state change detection.
I tried to do it with templates, but I couldn't figure it out. Even though it is probably possible to do it that way it is very user unfriendly and is a great risk of bugs.
**Additional context**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.