Raspberry Pi 3 / openhabian 1.5 and OH2 2.4 stable.
I am trying to realize a http POST and have read all threads here.
Unfortunately it did not help.
This is my item to activate and deactivate my alarm system (currently by execute commandline and curl).
I don’t use caching this in http.cfg (but tried this before as well)
I have tried also Basic authentication with a generated key.
Furthermore it work with requesting the state of the alarm system: String Abus_Status "Abus State [%s]" (G_jdbc) {http="<[cache-Abus-Status:20000:REGEX(Mode=(.*))]" }
The log shows: 2019-08-22 13:08:52.102 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://root:xxx@192.168.178.24:8060/setMode.cgi?Mode=Set' via method POST
Does your mystery alarm system require any content for the POST?
Is there no security or password for this?
You may get more feedback using the HTTP action in a rule, while investigating.
rule "test http"
when
testSwitch received command
then
var results = sendHttpPostRequest("http://root:xxx@192.168.178.24:8060/setMode.cgi?Mode=Set")
logInfo("httptest", "result " + results.toString)
end
I think that’ll work, defaulting the content type etc.
curl with the exact same command does the job (user:password@…)
However, I have time out issues every now and then with executeCommandLine curl + timeout period.
So I would like to move as many as possible to the http binding.
I am concerned about the timeouts because according to other posts, this might lead to cron rules not working anymore.
This is the original issue I face every now and then.
This does not work: var results = sendHttpPostRequest("http://root:password@192.168.178.24:8060/setMode.cgi?Mode=Set", 3000) 2019-08-22 15:30:23.008 [INFO ] [ipse.smarthome.model.script.httptest] - result ERROR
but this does switch the state correctly: executeCommandLine("curl -s http://root:password@192.168.178.24:8060/setMode.cgi?Mode=Set", 3000)
I am not sure what you mean, but this does not work (rule not loaded):
2019-08-22 16:11:24.468 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'abus.rules' has errors, therefore ignoring it: [36,108]: no viable alternative at input ','
[36,110]: no viable alternative at input ','
[46,106]: no viable alternative at input ','
[46,108]: no viable alternative at input ','