ETA Boiler: set a switch via http binding


I try to set some values for my ETA Boiler using http binding.
In the particular case I like to have switch of the heating loop. Here is the item:

Switch swHeatingLoopOnOff “Heating Loop” { http=">[ON:POST:http://etaboilderurl:8080/user/var/120/10101/0/0/12080:value=1803] >[OFF:POST:http://etaboilderurl:8080/user/var/120/10101/0/0/12080:value=1802]"}

Seems to be ok.
But I just get “Method failed: HTTP/1.1 400 Bad Request” :frowning:

Here the debug message from the binding:
2018-09-23 18:45:16.414 [DEBUG] [.o.b.http.internal.HttpBinding] - Executing url ‘http://etaboilderurl:8080/user/var/120/10101/0/0/12080’ via method POST, with body content ‘value=1803’
2018-09-23 18:45:16.423 [WARN ] [] - Method failed: HTTP/1.1 400 Bad Request

“same” vie curl works flawlessly:
curl -d value=1802 http://etaboilderurl:8080/user/var/120/10101/0/0/12080
<?xml version=“1.0” encoding=“utf-8”?>

<eta version=“1.0” xmlns=“”>

<success uri="/user/var/120/10101/0/0/12080"/>


1 Like

Does it work for the value 1803 like posted above in your items?
ON:POST value=1803
OFF:POST value=1802


Yes, if I send the http requests via curl command on terminal, if works.
I got positive response and the boiler switches the switch accordingly.

Looks like the MAP transformation binding and a map file with the values will be needed. If you have already created the map file please post.

If not create the map file in /etc/openhab2/transform and name it something like

Inside place the following:

Make sure you have the binding install via PaperUI >addons>transformations>MAP

In your items add map on the end like:

Switch swHeatingLoopOnOff “Heating Loop” { http=">[ON:POST:http://etaboilderurl:8080/user/var/120/10101/0/0/12080:MAP(] >[OFF:POST:http://etaboilderurl:8080/user/var/120/10101/0/0/12080:MAP(]"}

If this doen’t work, in your items, try replacing POST with GET.

1 Like

I solved it as:
Put the http POST request into a rule as:

rule heatingLoopSwitch
Item swHeatingLoopOnOff changed or
System started
var String sHeatingLoopSetState

if ((swHeatingLoopOnOff.state == OFF) || (swHeatingLoopOnOff.state == Uninitialized)) {
	// sendHttpPostRequest(String url, String contentType, String content)
	sHeatingLoopSetState = "value=1802" // off
else {
	sHeatingLoopSetState = "value=1803" // on

sendHttpPostRequest("http://etaheaterurl:8080/user/var/120/10101/0/0/12080", "application/x-www-form-urlencoded", sHeatingLoopSetState)


The missing bit was the content type “application/x-www-form-urlencoded”.
By using the action sendHttpPostRequest with this content type, the request was accepted and executed correctly.

val String url	= "http://eta_pu_11:8080/user/var/40/10021/0/0/12080"
val String typ	= "application/x-www-form-urlencoded"
val int timeout = 5000	// ms
val wert = "value=1802"

val result = sendHttpPostRequest (url, typ, wert, timeout)

if (!result.contains("success")

This works for me in most cases, but sometimes, I get:

Method failed: HTTP/1.1 400 Bad Request

<?xml version="1.0" encoding="utf-8"?>
<eta version="1.0" xmlns="">
  <error>Parameter 'value' is missing for this request</error>

I couldn’t find out, why. I will turn to curl, if this happens a lot, although curl does not allow the result to be analyzed, does it?


Has anyone had success to set it like H102 mentioned inside the item definition without any rule?
I tried but nothing happens, also no log entry that it was not successful?

Directly via CURL works fine.

Many Thanks, Norbert

Have a look at the EXEC binding.

Hi i just checked the exec binding, but i do not see how this would help ?
Do you have any example you could kindly post so its easier to dig into this material.

My intention is to not require to setup rules,…if its possible it would be great within a switch item to set states of the ETA heater.

Disregarding if the solution works in general, I think the file has the values swapped.

Correct would be:


With the solution presented by @H102, I am only getting one of the following errors:

Could not find a mapping for 'ON' in the file ''.
Could not find a mapping for 'OFF' in the file ''.

As recommended, I tried with POST and GET, several forms of the URL, with and without mapping file, but in the best case, I only got this error:

Method failed: HTTP/1.1 400 Bad Request