This is a great idea if you want to keep track of the value over time. Ady has an excellent piston for tracking power usage over the course of the day, week, and month that uses an approach contained entirely within webCoRE.
The basic idea is to use two triggers - when the brightness changes to your target you set a local variable dimStartTime = $time. Then when the brightness leaves that target value or range you set a local variable that keeps track of the total over time dimDuration = dimDuration + $now - dimStartTime.
You can then set up a timer to daily, weekly, or whatever makes sense reset that dimDuration back to zero. Tracking over the course of a week or month takes quite a bit more effort, but the basic running-sum-then-clear approach is pretty simple.
The dimDuration value is going to be the number of milliseconds that the bulb was at that brightness. You can display it in a format like “12:04:02” or “12 hours 4 minutes and 2 seconds” with the formatDuration function