As someone with such extensive experience you should understand how important semantics are. Persisting with incorrect terminology, when you’ve been afforded some grace, is just stubborn, and now you’re blaming the (incredibly knowledgeable) people that tried to help. Your initial post was confusing and lacked vital information.
The entity domain is a vital concept in HA to understand. A sensor is by definition not something you can change directly, because it’s supposed to (roughly speaking) be a measurement of something. You change the speed of your car via the accelerator pedal, not by moving the dial with your finger. If you keep using incorrect terminology, it will be hard to know if you understand what you’ve been told and will just further confuse those trying to help.
There is also no concept of a variable in the sense you’re trying to use it (HA scripts and automations do have them, but it serves a specific purpose). Those variables you have are specific to a 3rd party component: the custom button card. Its value only exists within the scope of the card. With 50 years experience I would expect you to understand what scope means. You can change the variable within that scope, but it will have no bearing on anything else. Either you have actuating entities like a switch, one of the helper entities or such, or you call services/use actions to affect something.
I read through everything again and you really got all the answers. It’s up to you to invest the time to understand what you’ve been told.
Prove it.