LDR Brightness using adc

I’m trying to configure an ESPHome device (ESP8266) to sense brightness level in a room using a simple LDR connected to the ADC pin. ESPHome config as follows. What additional configuration is required to scale the input voltage please? Is this done with a filter, or lambda perhaps?

Many thanks in advance

sensor:
  # ADC LDR Brightness
  - platform: adc
    pin: A0
    name: "PIR Brightness"
    update_interval: 60s
    unit_of_measurement: "%"

This link should help you with your endeavour :point_down:

Easiest in your case might be use a filter with calibrate_linear :point_down:

Thank you very much. I’ll take the approach of collecting readings for my lower and upper limits as voltages, mapping them to 0% and 100% and then rely on linear translation.

Very useful, thank you.