Rule is not working

rules
Tags: #<Tag:0x00007fe054e75dd8>

(Jan) #1

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.


(CM6.5 H102) #2

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

(Vincent Regaud) #3

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

Also, rules syntax documentation:


and


(CM6.5 H102) #4

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