HTTP binding - set payload/body

Hi

If I understood right, you want to send a HTTP request with a body part. I did something similar, in my case I sent a PUT request containing a JSON payload.

There is no openHAB transformation that allows to send a HTTP body, you need to create a map. To do so place a file in your transformations folder (usually /etc/openhab/transformations) with the name of your choice and the .map extension. As an example let’s use light.map. Then put some content where you map the command to an output. i.e.:

ON: { LIGHT=1 }
OFF: { LIGHT=0 }

In the command transformation put the value MAP:light.map
Once your channel gets the command ON, the HTTP call with body { LIGHT=1 } will be sent to your device. If the command is OFF, the body will contain { LIGHT=0 }