This page last changed on Sep 20, 2015 by homecontrol.

It's easy to give a command to a device (in my case a beckhoff CX8090 plc) with HTTP protocol, by making a HTTP command like "http://xxx.xxx.xxx.xxx/or_debug.asp?set=.variable:1"
But its not working for me to read a status of a variable with the HTTP protocol, not even boolean.
What do i do wrong:
I make a new command with HTTP protocol, name: variable1, "http://xxx.xxx.x.xxx/or_debug.asp?get=variable1", HTTP methode: GET, polling interval: 1s.
I make a sensor, name: status, command: variable1, type: switch.
In designer i make a label and select the right sensor, 1: on, 0: off.
On my iphone the label says: N/A.
Can someone correct me when this is not the way to load a status of a variable.

Thanks!
Kenny

In the LOG i can see the controller receives the messages, i believe of the polling interval of the sensors:

INFO 2015-09-20 11:54:02,517 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:03,692 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:04,669 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:05,000 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:06,152 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:06,820 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:07,340 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:07,580 (HTTP): received message: .RI_Temp_slk2_actief=1<br><br><br>Complete
INFO 2015-09-20 11:54:08,512 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:08,968 (HTTP): received message: .Temp_slk2_actief = true<br><br><br>Complete
INFO 2015-09-20 11:54:09,717 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:09,773 (HTTP): received message: .RI_Temp_slk2_actief=1<br><br><br>Complete
INFO 2015-09-20 11:54:10,921 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:11,144 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:12,068 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:13,264 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:13,323 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:14,404 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:15,561 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:15,603 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:16,770 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:17,702 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:17,938 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:19,080 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:19,847 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:20,374 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:21,519 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:21,991 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:22,588 (HTTP): received message: .RI_Temp_slk2_actief=1<br><br><br>Complete
INFO 2015-09-20 11:54:22,790 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:23,992 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:24,170 (HTTP): received message: .Temp_slk2_actief = true<br><br><br>Complete
INFO 2015-09-20 11:54:25,191 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:26,437 (HTTP): received message: .Temp_slk2_actief = true<br><br><br>Complete
INFO 2015-09-20 11:54:26,454 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:27,652 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:28,582 (HTTP): received message: .Temp_slk2_actief = true<br><br><br>Complete
INFO 2015-09-20 11:54:28,852 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:30,051 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:30,451 (HTTP): received message: .RI_Temp_slk2_actief=1<br><br><br>Complete
INFO 2015-09-20 11:54:30,729 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:31,352 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:32,549 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:32,887 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:33,749 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:34,973 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:35,057 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:36,168 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:37,227 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:37,391 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:38,582 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:39,367 (HTTP): received message: .Temp_slk2_actief = false<br><br><br>Complete
INFO 2015-09-20 11:54:39,750 (HTTP): received message: .Temp_slk3_actief = false<br><br><br>Complete

But does it mean it send a message or it receives the message?
it looks for me the controller only can send command to my PLC, but does not receive commands?

I'm running the controller "Controller-2.1.0_SNAPSHOT-2013-06-17" back on my PC now

Still on my iphone i can see N/A on the label the sensor (type switch mode) is linked to.
i can see the label text on the other label the sensor (type custom) is linked to.

Can someone help me out?
thanks,
regards

a question i'm asking myself is:
Do i have to filter out the boolean "False" or "True" out of the received message When i use a switch sensor?

when typing in the HTTP command in an explorer, the source telse me:
".Temp_slk2_actief = false<br><br><br>Complete"

If the "switch" sensor cannot handle the complete string, how do i filter out the value 'false' or 'true' out of the string?
maybe by using the XPath Expression or RegularExpression?
And what should i enter?

i'm just searching, don't know or it makes sense.
let me know if so.
thanks

Posted by homecontrol at Sep 23, 2015 13:43

Do use a sensor type:custom which allows you to map True/False to on/off See: http://www.openremote.org/display/docs/Designer+2.0+-+Create+Custom+Sensor

Posted by pz1 at Sep 23, 2015 14:47

Thanks for the replay PZ1,
It seems i just have to fill in the complete retrieved message: ".Temp_slk2_actief = false<br><br><br>Complete" as the value.
it works this way.

I read the link above many times, and never saw different exaples.
i always thought i had to filter out the word false or true out of the string before the sensor could read it.
But now i get it

thanks

Posted by homecontrol at Sep 24, 2015 13:59

I wasn't aware of this long string. So you could make a ReGeX filter as well in the command specification

false|true

And use only false and true in your custom sensor. That may be more rigid and easier to maintain in the end

Posted by pz1 at Sep 24, 2015 14:33

PZ1, this works also just fine! and is much easier.

related:
I also have temperatures which i whant to read out.
they give me for example the string: ".CEL_slk2 = 19.2<br><br><br>Complete"
of course 19.2 changes all the time, how can i filter out these temperature the best way?
(whithout filling in all posibilities in the custom sensor ...)

If i could this, i'm happy

Thanks again!

Posted by homecontrol at Sep 25, 2015 16:48

Try with regex

[0-9]{2}.[0-9]{1}

There are online regex testers where you can try things out (e.g. https://regex101.com/

Posted by pz1 at Sep 26, 2015 09:06
Document generated by Confluence on Jun 05, 2016 09:31