Is it possible to create a Global Variable that changes its output piston to piston based on a device? For example, let’s say 1) I want to read out a thermostat’s heat set point, 2) I have 2 thermostats in separate pistons, 3) I have a Global Variable @ThermoHeat. I was hoping to set the value to [$device : heatsetpoint] then simply call @ThermoHeat in the piston (I KNOW you can simply call the device in the piston - this is only an example - pretend I need to do this dozens of times on multiple attributes).
With the above example, all I get as output is the literal ‘$device : heatsetpoint’ rather than an actual setpoint. Is there a magic way to write that that I have overlooked to make it work?
I have tried as expression, as value; with { or ( or [; as $device, @device; I have even set the value into a local variable then simply tried to get the global variable to call that local - all to no avail.
Feels like this is ‘a no’, but I figured I’d ask!
To take it a step further, it would be cool if the global variables can do things when they get called. IE today I find that they can be a value (blue). But I’d like them to expressions that change based on the rest of the piston’s attributes.
@TempBasedSelection: ThermoTemp == 40 ? ‘blue’ : (ThermoTemp == 50 ? ‘green’ : (ThermoTemp == 60 ? ‘Red’ : ‘Yellow’)))
*please understand this is an example only!
Thanks for reviewing.