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?
Interesting. Iām also using the āZigbee RGBW Bulbā DTH with a Sengled Multicolor bulb and that format works (though the device ignores the level parameter within the object).
Iād be curious if the issue persists once the device gets moved over to an Edge Driver. Kind of concerning that these devices havenāt been moved to Edge Drivers with only 26 days until the expected Groovy shutdown.
You could try using the advanced toggle and changing the argument type to a string and using the same format, but I suspect that may only work for Groovy devices and might stop working when the device cuts over to an Edge driver.
As you noted, the individual setHue() and setLevel() commands could be an option for you as well.
Just to confirm, are you actually having an issue with those commands or you were just curious based on reading through the thread?
If youāre having issues, what do the rule logs say? Iām curious if the commands are going through successfully and theyāre just being dropped or if thereās an error reported.
The hue and saturation values do match, but they were already that before the device turned on. Itās the level that I saw that didnāt change, so I just assumed all of it didnāt work. Looks like my behavior is the same as what you are seeing then.
My thoughts exactly, but Iāll keep my fingers crossed