Как сделать термостат? How to make a thermostat?

Приведите пожалуйста пример как сделать термостат включения реле на arduino
То есть я выставляю нужную мне температуру в openhab
и включается реле на ардуино
а датчик 18b20 контролирует текущую температуру и выводит показания в opebhab

Please Bring an example of how to make the thermostat relay to arduino
That is, I put my desired temperature in openhab
and the relay on the Arduino
18b20 and the sensor monitors and displays the current temperature readings opebhab

Someone else may be able to provide more help than I can. I did a quick search for Arduino 18b20 and it seems to support OneWire so look to use the OneWire binding. All of this assumes you actually have the Arduino connected to the openHAB server somehow. I’veno experience with OneWire so I’ll be little help with that.

i use arduino + ethernet sheild and installed web interface on ardiuno all the code you need is on arduino example lib you have to modyfy e little bit.
conection to openhab is wiht HTTP binding
Swich relay1 {http=">[ON:POST:http://192.168.3.7/?L2] >[OFF:POST:http://192.168.3.7/?H2]"}
Number sensor1 {http="<[http://192.168.3.5:10000:REGEX((.*))]"}
Number termostat

but in my case sensors and relays are on the diferent pairs arduino+ethernet sheild

you need a rule

rule “termostat”
when
Item sensor1 recieved update
then
if(sensor1.state>=termostat)
sendCommand(relay1, OFF)

else
sendCommand(relay1, ON)
end

rule not tested but have to be something like that

Сделал так
to do so

// This rule file is autogenerated by HABmin.
// Any changes made manually to this file will be overwritten next time HABmin rules are saved.

// Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule "myhome"
when
Item temper recieved update
then
if (temper.state != 30) {
sendCommand(led, ON)
}
end

но не работает
Подскажите как правильно?

but does not work
Prompt how correctly?