Got this going with @Jpsy and @tom_l 's help. Thanks, working well with a WemosEsp $3 and a rotary encoder $2. Need to come up with an enclosure…
YAML:
alias: Small Volume Knob
description: ''
trigger:
- platform: state
entity_id: sensor.rotary_encoder5
id: sensor.rotary_encoder5
condition: []
action:
- service: media_player.volume_set
target:
device_id: 5a3838ba2c012cf630bbddda0b307ee8
data:
volume_level: '{{ ( states(''sensor.rotary_encoder5'')|float(0) * 0.01 )|round(2) }}'
mode: parallel
max: 10
ESPHome YAML:
esphome:
name: small-esp
platform: ESP8266
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "ef4dbb1586c342eaf9512a110bf94e42"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.3.153
gateway: 192.168.3.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Small-Esp Fallback Hotspot"
password: "SqioPkLZTB80"
captive_portal:
sensor:
- platform: rotary_encoder
name: "Rotary_Encoder5"
pin_a: GPIO5
pin_b: GPIO4
switch:
- platform: gpio
pin: GPIO2
name: "High"
restore_mode: RESTORE_DEFAULT_ON
