Except... With motion detection I let the cam alone for x hours, and sometimes I have enough light, then a cloud passes by etc. It is annoying that the few moments when 1/1250s isn't fast enough you get burnt shots. It's also the case when I shot in Av mode (I do most of the time), and I don't notice the cam shows a red 1/1250s (especially on sunny days, I don't see the screen so well...).
And well reyalp I'm not sure I can calculate all the component of the exposure myself. :/
Isn't there a possiblity to get the exposure the cam calculates right before the shot and use it ? Then it's possible to compensate with a script.
Would be easier to break canon's firmware limit though (easier not including the coding/hacking part).
Ah you are describing a slightly different problem... you want to extend Canon's autoexposure range, not just change its preference of not ruining the photo by using a ridiculously narrow aperture.
If I understood you correctly, your problem is that ISO is already minimal, ND filter is active and/or aperture is as narrow as it goes without override and Tv is as short as it goes without override but you still have too much light.
If you find a way to decide how much to speed Tv up, things are easy since you are using a script. I'm assuming you use MDFB in fast mode (or similar script), meaning your camera sits waiting for motion with shutter half pressed. That means exposure is determined after each shot (and at start, and after timeout if there is no motion). This means any code you add to override Tv will not slow MD reaction time down at all and the override code needs to be put right before the md_detect_motion command.
Your problem is that the camera exposure is incorrect -- you can't just e.g. make tv faster and compensate with av and sv (ISO). If you're lucky the camera may how much it is overexposing. Read the bv (brightness value) propcase (34 or 74 depending on camera model). If it changes even though exposure doesn't, you should be able to calculate tv for your override from the apex formula tv=bv-av+sv. So your code could do something like this:
...
read tv96
read av96
read sv96
read bv96
if tv is as fast as it goes in your camera, then set tv96=bv96-av96+sv96
md_detect_motion ...