IOT PROJECT

i try to figure out the circuit with nodemcu for a smart lamp based on IOT. i found pulse width modulation method can be applied. i found that this method can adjust the brightness of led by adjusting potentiometer(voltage divider) manually. In my ioT project, i need to make the lamp automatic light up when rssi decreases (ppl pass by) but i have no idea how to make RSSI related to the voltage in order to control intensity of light.
wish someone can give me some advice.

but i have no idea how to make RSSI related to the voltage in order to control intensity of light.

What are you getting the Relative Signal Strength Indicator of? How are you getting it? What values are you getting? Do the values change as you expect?