Rule is not working

Hello everyone,

I am trying to create a reule based on a onewireGPIO Temperture sensor.

The Rule is as follows:

Blockquote

when
Item TemperatureSensor_Temperature changed
then
if (TemperatureSensor_Temperature.state < 10) {
Relais8.sendCommand(OFF)
}
if (TemperatureSensor_Temperature.state > 25) {
Relais8.sendCommand(ON)
}
end

Blockquote

However i recieve the follwoing errormessage in the log:

Configuration model ‘Temp.rules’ is either empty or cannot be parsed correctly!

Hope you can get me a hint where i might have to look for the error.

Need the add “rule” to the top.

Example

rule "Your Rule"
when
Item TemperatureSensor_Temperature changed
then
if (TemperatureSensor_Temperature.state < 10) {
Relais8.sendCommand(OFF)
}
if (TemperatureSensor_Temperature.state > 25) {
Relais8.sendCommand(ON)
}
end
1 Like

Please use the code fences when publishing code in the forum, please

Also, rules syntax documentation:


and

@Soron I edited your topic category from tutorial to the above.