Ok, I think I get where you’re trying to go now. Save the current level of the light to another attribute of the light’s entity itself. Then, at some later time, maybe use it to restore the light back to that saved level? Something like I did in the python_script, but instead of to another, temporary entity, to the light entity itself, but in a new attribute.
If I got that right, the main issue will be, when the light changes by itself (maybe someone physically/manually changes the physical light), and the HA entity updates itself, that attribute you added (assuming you did it without losing the other attributes) will be gone, since the code knows nothing about it.
I think you’re going to either have to change the python code, or maybe do something like I did - i.e., create a temporary entity to store the information in. Of course, that could be an input_number, like you mentioned earlier. Or, if you do it via the REST API, you can create an entity (that does not have any physical device or component code associated with it, similar to what I did in my python_script.)
Sorry if I misunderstand your ultimate goal.