How to detect the brightness of the render or auto adjust the brightness of the render?

Hi,
I’m working on cloud render automation.
I’ve set up some necessary lights for rendering
Basically, in the worst case, if the room interior is darker, I want to increase the exposure the image from Render settings>> color management>> exposure.

Basically, would love to know, How to detect the brightness of the render. based on this, I’m thinking to adjust the exposure.
Can anyone help me do this? possible in compositing? or any other way?
Can Histogram or something become a help?

The only way to access the pixels of a render is through the viewer node in the compositor.

Create a link to the node whose pixels you want and then access the pixels through: bpy.data.images['Viewer Node'].pixels
Load them into a numpy array, probably with the for_each method. I don’t recall the most efficient way to handle reading.

Not the appropriate place to make adjustments. Use compositing nodes.

There is an add-on ‘Real Camera’

https://3d-wolf.com/products/camera.html