mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 16:37:52 +01:00
26 lines
576 B
YAML
26 lines
576 B
YAML
|
sensor:
|
||
|
- platform: rotary_encoder
|
||
|
name: Rotary Encoder
|
||
|
id: rotary_encoder1
|
||
|
pin_a: 3
|
||
|
pin_b: 4
|
||
|
pin_reset: 5
|
||
|
filters:
|
||
|
- or:
|
||
|
- debounce: 0.1s
|
||
|
- delta: 10
|
||
|
resolution: 4
|
||
|
min_value: -10
|
||
|
max_value: 30
|
||
|
on_value:
|
||
|
- sensor.rotary_encoder.set_value:
|
||
|
id: rotary_encoder1
|
||
|
value: 10
|
||
|
- sensor.rotary_encoder.set_value:
|
||
|
id: rotary_encoder1
|
||
|
value: !lambda "return -1;"
|
||
|
on_clockwise:
|
||
|
- logger.log: Clockwise
|
||
|
on_anticlockwise:
|
||
|
- logger.log: Anticlockwise
|