When your cursor is in the input for editing, you’ll notice the expressions (for the variable reference) are wrapped in double squigglys. And when you’re tabbed out of the input field, they should show as parsed expression fields with the small grey pill button style shown in the above screenshot. And make sure to use straight double quotes " for the quotes.
The JSON data format currently does not support inserting a variable. If your original screenshot showing the logs was for JSON argument, then it makes sense that it showed the raw {{$context.response.data.result}} string as it is not currently translated. I can look into what it would take to support that, but it’s not something I’ll be able to get to immediately.
In the follow-up reply that showed a string argument that has a variable in it, that should be handled fine from the SharpTools side of things and your SharpTools logs should show the context variable being parsed and injected as expected. From what I understand, the driver doesn’t seem to handle that format though?
Have you tested the exact same format that worked as a JSON argument type {} (from the second part of the second screenshot) as a string Aa to verify that the driver isn’t handling the JSON data formatted as a string?
Have you watched the driver logs to see how it is handling the arguments that are being passed to it? Considering the string format of an object has worked for other device types, I suspected that maybe the SmartThings API was inherently handling the parsing of these requests, but it’s possible that the parsing is something they coded into specific drivers. In which case, I wonder if Mariano would entertain parsing a string formatted JSON object. I think the first step here is identifying what the driver is actually seeing though.
Thanks for the clarification. You could also just try floating the question to Mariano. He might know off the top of his head why it would work with one driver but not another.
I suspected the SmartThings REST API was handling the parsing, but it’s possible they were doing it within all the drivers that I’ve tested with so far. Without knowing why the JSON as a String format is failing with his driver (eg. no logs), I don’t have a lot of insight as to why it doesn’t work with his driver. It’s certainly possible that it was a per-driver thing with the parsing and maybe Mariano would be open to adding that to his driver.
Otherwise, I will take a look at what it would take to add the context variable parsing to the JSON argument format, I just won’t be able to get to it right away.
As I’m reading through this, am I understanding correctly that SmartThings isn’t parsing the setColor() parameters? I’m using the stock Zigbee RGBW Bulb DTH and passing the input argument {“hue”:83,“saturation”:100,“level”:7} and it isn’t working.
If I am understanding correctly, I should just sent those one at a time with setHue, setSaturation, and setLevel?