I use http binding with JINJA transformation. (maybe an easier approach is possible?)
Unfortunately I don’t get this to work.
With the follwing configuration, only the baseURL + commandExtension is sent.
The parameters used in the commandTransformation are not added to the URL.
i wouldnt do this with the http binding…
i do something similar and do this via RulesDSL, the only rules i can
create a Switch Item i.e. HDR_Instance_1_ON_OFF.
create a ruleDSL with:
rule "HDR Instance ON OFF"
when
Item HDR_Instance_1_ON_OFF changed
then
if (newState == ON)
sendHttpGetRequest ('http://<IP_ADDRESSE>/json-rpc?request={"command":"instance","subcommand":"startInstance","instance":1}')
else sendHttpGetRequest ('http://<IP_ADDRESSE>/json-rpc?request={"command":"instance","subcommand":"stopInstance","instance":1}')
end
However, I use the http binding already to retrieve other LED parameters from HyperHDR.
The idea was to have all the parameters covered by the same binding and Thing, without an extra rule.
If I don’t get this to work, I will keep using the workaround using the rule.
The docs say thetransformed command is referenced in the commandExtension as %2$. So your command extension should be json-rpc?request=%2$ so that the result of the Jinja transformation is appended to the URL. Otherwise it’s included as the body of the HTTP request.