An update of the script :
- Little correction
- Add a virtual switch : to enable/disable easily this script (go to manual mode )
- Add an "offset" : in case of the luminance raise by the controled light (that permit to avoid on-off-on-off-on), in my case, i adjust tha value to the difference : luminance with light on - luminance with light off
After some months, of use, it's nearly perfect for me !
ToDo : When this control is going off to on by the virtual switch, it's doesn't work very well (not goes up) => Think to a better management of this part.