Skip to content

Instantly share code, notes, and snippets.

@tkroo
Last active April 12, 2023 12:39
Show Gist options
  • Save tkroo/eb4f6e7fa84f5690679c5f7ce5e070f8 to your computer and use it in GitHub Desktop.
Save tkroo/eb4f6e7fa84f5690679c5f7ce5e070f8 to your computer and use it in GitHub Desktop.
esphome:
name: rotarybutton
friendly_name: rotarybutton
# other configuration snipped...
binary_sensor:
- platform: gpio
name: "Button 1"
id: "button_1"
pin:
number: 0
mode: INPUT_PULLUP
sensor:
- platform: rotary_encoder
id: my_rotary_encoder
name: "Office Dimmer Knob"
pin_a:
number: 4
mode: INPUT_PULLUP
pin_b:
number: 5
mode: INPUT_PULLUP
max_value: 100
min_value: 0
resolution: 2
filters:
debounce: 0.025s
- platform: homeassistant
name: Actual Light State
id: actual_light_state
entity_id: input_number.office_brightness
on_value:
then:
- sensor.rotary_encoder.set_value:
id: my_rotary_encoder
value: !lambda 'return id(actual_light_state).state ;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment