Hi everyone,
i would like to ask something about curl and how to implement it.
I just set up my new boiler controller that has also an internet module. After some research i found out tha i can receive data from it with some curl commands and also post to it changes that i want.
When i type the command below from linux shell
i get a response " 501_67" where 67 is the current water temp in the boiler.
How i can make that appear in my openhab as an item and refresh every 5 minutes?
Thank you in advance
did you get the http binding to work with a string item?
to transform the result (from 501_67 to 67) you need to use a transformation service (e.g. regex)
Thanks vzorglub!!! It seems to be working.
Another thing i missed to mention, is that in the data i receive, the format is 501_670 and not 501_67 so is there any way to discard the last zero? Thank you once more.
No that won’t work if the temperature is 60 then it will return 6 only
So:
rule "Text to Temperature"
when
Item stringItem changed
then
var temperature = (Float::parseFloat(stringItem.state.toString.split("_").get(1)) as Number) / 10
temperatureItem.postUpdate(temperature)
end