How to control bulb brightness using potentiometer

Hi,

I want to make a dimmer switch using esphome to control the bulb (Yeelight).

I still don’t understand Analog To Digital Sensor. It shows about 0.02 to 3.2v

What should I do to get it to control the brightness?

This is my source code.

esphome:
  name: $devicename  

esp32:
  board: m5stack-atom
  framework:
    type: arduino
    version: latest

ota:
  password: !secret esphome_pass

logger:

api:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

web_server:
  port: 80

sensor:
  - platform: adc
    pin: GPIO33
    name: ${upper_devicename} Dimmer
    update_interval: 500ms
    attenuation: 11db
    accuracy_decimals: 2
    filters:
    - lambda: |-
          return (x);
    id: potentiometer
    on_value:
      then:
          - homeassistant.service:
            service: light.turn_on
            data:
              entity_id: light.garage_light
              #brightness: !lambda { return (x - 225.0) * 2 }

Thank :grinning: