Revise "battery level", starting with Generic Zigbee Shades

You suspect wrong.

The Generic Zigbee Shade driver just gets the battery (half-)percent remaining as reported over Zigbee, then divides it by two to get the percent. That is rounded to an integer, then passed as the value of the event by the driver. There is no real calculation going on.

This is standard behavior of Zigbee cluster 0x01 attribute 0x0021, battery percentage remaining.

Some Zigbee devices also report voltage using attribute 0x0020. This only gives you 0.1 V resolution, so it might not help as much as you want either. Some devices might do both, and some may do neither, as both attributes are optional per the spec. Voltage is used in some drivers that don't report percent directly, but most generic drivers use the device's own percentage calculation (and I can't imagine ones that support both would use radically different data for either), including the one you're asking about.

FWIW, I'd guess Matter does the same as Zigbee (I haven't looked but that's basically the inspiration for the application layer of the spec), Z-Wave normally does percent from the device, and other protocols may vary -- so you probably won't find much different elsewhere either.

This comes up from time to time, and it while it would be great to do, many who try end up concluding that obsessing over battery levels is not worth it. This is one of the reasons I wrote Device Activity Check, which you can use to look at hints that a device might actually have some problem, perhaps a dead battery that prevents it from talking to your hub (or battery reports if you really want to, though that's not what I'd start with). There are or were similar options, as well, though I'm not sure if any are still maintained. But in general, this approach is more likely to work better for most devices.