I'm migrating an HTTP driver that I wrote on Smartthings over to HE. In Smartthings you are not allowed to have a Global variable (global being global within the DH) but there was an easy workaround. Instead you would just define some extra tiles that did not show on the interface and change their values which could be referenced from anywhere. A little clumsy but it worked well.
So now I'm on HE and tiles are ignored, they simply don't exist. I thought I would use attributes instead but the updates to these are asynchronous rendering them unsuitable for this purpose. FYI you also can't use state for this purpose.
I'm sure someone will say well why do you need a global variable so here is the use case. The device handler sends commands via HTTP to Tasmota devices. The response from the Tasmota device comes back to the parse() function asynchronously. If you know the commands that were sent to Tasmota you can then compare those to the results received and thus you have positive confirmation that a command was successfully executed. So the global variable is used to store the sent commands and allows this comparison to happen. So it is basically a transacted operation that keeps the UI in sync with the actual device.
I'm new to HE so I'm hoping there is some difference in the Groovy implementation\restrictions or some other mechanism that will let me achieve this same result. Perhaps including some library or something. Any help very much appreciated.