Hi, I need some help getting started with the http binding and transformations. I’m using the Slide curtain system, it has a local API to (amongst others) get / set the position of the Slide. The pos is reported as a 2 digit decimal ranging from 0.00 (open) to 1.00 (closed), I want to map this to a Dimmer Item (* 100). I’ve got some of it working but could use a hint on transforming the values.
this is my thing definition, I need some help for the parts between << and >>:
Thing http:url:slideCurtainLeft "Curtain Left" [ baseURL="http://<localip>/rpc/" , authMode = "DIGEST", username="user", password="<pwd>", stateMethod="POST", commandMethod="POST" ]{
Channels:
Type number : position "Position" [
stateExtension="Slide.GetInfo",
stateTransformation="JSONPATH:$.pos << * 100 >>",
commandExtension="Slide.SetPos",
commandTransformation="REGEX:(s/.*/{\"pos\": << $1 / 100 >>})/g"
]
}
- I want the stateTransformation to get the json path value and multiply by 100;
- I want the commandTransformation to divide the channel’s Dimmer value by 100 and put it in a fixed json structure.
A hint is appreciated.