Brightness of the light depending value of the brightness sensor

Hello,

I have a brightness sensor and two light. My brightness sensor have an entity named sensor.light_luminosite and I would like to use it to control my two light (L.C.D and L.C.G).

So I want :

When my brightness sensor is above 701 lux, it control light brightness to 1% at 20% ( to 700 lux at 0 lux → brightness go to 1% at 20%). I imagine use a calcul like to control the brightness of a light when bright sensor value change :

Curent brightness value*max light brightness’s percentage / max values lux

→ curent brightness value*20/700

But i dont know where and how integrate the calcul so thanks for the help