Quantifying the brightness outside

Currently my motion-based light automations turn on 30 minutes before sunrise, but I would like to have them come on earlier on overcast days, etc. Has anyone found an accurate way of doing this?

Optimally I would quantify the brightness as a number, and then have the value of that number be a condition to said automations. This would also help for rooms that get different amounts of light. E.g. the living room automations come on when brightness is below 80, but kitchen automations don’t come on until outside brightness goes below 50, because it has big open windows.

You could try this:

I have yet to get this working as it doesn’t work with hassio but I hope to eventually get the data into hasio via mqtt from another raspi.

There are cheap modules available on eBay and elsewhere.