Battery level as a macro

I am trying to implement the battery usermod, and want to have my LED strip display a color that represents the percentage of battery left when I hold down a button. I understand how to add usermods, and also how to bind macros to buttons. What I am struggling on, is how to use the JSON API.

When I look at the JSON API documentation page, I see at the very bottom that battery level has its own sensor type ID string (marked as “BL”). But when I start to look through the battery usermod code, I see no reference to that variable (or at least I dont know what I am looking for…). From my understanding, I believe I could just write a lil snippet in the JSON API box that says "if BL low, turn red for a second, else, turn green for a second.

Is this the wrong approach/how would I “export/create” that value to be able to access it? I hope this isn’t too far winded of a question.