noushadali / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

Parameters for http-binding #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sending the actual value of SetPoint (and maybe also for the Slider) as a 
parameter to the http-binding.

Example: Number Temp_OG_Bath_soll   "Badezimmer [%.1f °C]"         <temperature>   (og) 
{ http=">[ONCHANGE:GET:http://192.168.0.22\set.htm?temp1=VALUE]"}

Where "Value" is replaced with the actual value of the element.

Original issue reported on code.google.com by quellt...@gmail.com on 19 Nov 2012 at 7:02

GoogleCodeExporter commented 9 years ago

Original comment by kai.openhab on 19 Nov 2012 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by teichsta on 22 Nov 2012 at 9:44

GoogleCodeExporter commented 9 years ago
The HttpOutBinding now utilizes the String.format() method. The current date is 
the first parameter and the current value (command or state) is passed in as 
second parameter. So an url can be formatted like this 
"http://host:port/resource?value=%2$s" when expected a string.

See java.util.Formatter for further details how to format String appropriately.

The complete binding String would look like (since the value is passed as 
second value):

{ http=">[GET:http://192.168.0.22\set.htm?temp1=%2$.1f] }

Original comment by teichsta on 26 Nov 2012 at 4:56