Http get?

sendhttpgetrequest
Tags: #<Tag:0x00007fe04f51da38>

(atle) #1

This item used to work:
Switch x300_rele_1_1 “Varmer kontroll” { http=">[ON:GET:http://10.0.10.15/state.xml?relay1State=1&noReply=1] >[ON:GET:http://10.0.10.15/state.xml?relay1State=0&noReply=1]" }

Is the formatting changed?
I can switch the relays using http://10.0.10.15/state.xml?relay1State=1&noReply=1


(Vincent Regaud) #2

Do you mean?
Because both binding definition are for ON
And I believe there should be a coma between each

Switch x300_rele_1_1 “Varmer kontroll” { http=">[ON:GET:http://10.0.10.15/state.xml?relay1State=1&amp;noReply=1], >[OFF:GET:http://10.0.10.15/state.xml?relay1State=0&amp;noReply=1]" }

(atle) #3

Sorry, copy error.
The item that used to work:
Switch x300_rele_1_2 “Overstyr lokal termostat” { http=">[ON:GET:http://10.0.10.15/state.xml?relay2State=1&noReply=1] >[OFF:GET:http://10.0.10.15/state.xml?relay2State=0&noReply=1]" }

And I have tried to change GET with POST…

According to binding doc, its no coma…:
Switch MyItem1 { http=">[ON:POST:http://sample.com/myitem1:on] >[OFF:POST:http://sample.com/myitem1:off]" }


(Vincent Regaud) #4

Does your item accept POST requests?


(atle) #5

It says GET and therefor I have used that, but now I got no respons…


(Josar) #6

Please try to use code fences it makes reading easier and avoids smart quotation.

Is there a blank between > and [ I remember that the binding was a bit picky with the blanks and so on. Also, there has to be a single blank between the two commands only.


(atle) #7

Thanks, I did not know…
Here’s the item:

Switch x300_rele_1_2 "Overstyr lokal termostat" { http=">[ON:GET:http://10.0.10.15/state.xml?relay2State=1&noReply=1] >[OFF:GET:http://10.0.10.15/state.xml?relay2State=0&noReply=1]" }

So when I put: http://10.0.10.15/state.xml?relay2State=1&noReply=1 in a browser the relay switch…


(Josar) #8

Used to work, did you change any other items in the file? Sometimes it happens when there is a error that the file is not processed anymore, but I have had this only with rule files until now.

Question is what did you change?


(atle) #9

Yes, I didnt use this these items since last summer because its for my poolcontrol. In the mean time I’ve installed OH 2.2 and can’t remember which version OH I had…
These items has just been in the items file…All the read items (temperatures) from this device are working…