From plugin to virtual variables?

Hi forum,
I am new to this group and I stuck in my project.
After reading that this forum is on the way to die I keep on having positive standing…

What I want to achive:
my goal is to have the THR on different devices to control home eqquipment (mostly lights)
on the UI there should be a visible response if the light is on or off.
I have mostly devices controlled by Tuya with no response (433Mhz) but I will be sattisfied if the response is “clicked On/Off”.

The Problem:
as I understood THR is a local process on the appropriate device.
till now I have not found a way, how to synchronize the action through different devices.

I set up the following scenario:
when a device acts a button this action starts a process that uploads this information to a web based txxt file (device, colorinformation) via a plugin.
As this plugin is called the txt file is read back with the stored information of the status of the switches.

At this point I have all the information ready I need to set the right status on any device…but how do I do this?
At this point I need to control the virtual variables and do not know how?

Call for help…

Pair the THR with a Hubitat, especially for lighting controls. Hubitat runs locally, so no internet needed for commands. Hubitat also sends light status, on or off, and dim level if dimmable.