Sonoff Tasmota creating a rule

When posting code, please use the code tags ( selectable by the icon</>)

As posted earlier, use the conversion “as Number”!

rule “Heat Transfer Fan on/off”
when
Item Sonoff_TH16_3_temperature changed
then
if((Sonoff_TH16_3_temperature.state as Number)> 20){
SoPow1_SW_ON_OFF.sendCommand(ON)
}

end

When testing own rules, using the “logInfo” lines you can check wether the rule is run over that line or exited before and you can display the actual value of a variable, value or item.state.

great thanks for the assistance,

now if I wanted to add a “and” to the “if” would it look like the following ?

if((Sonoff_TH16_3_temperature.state as Number)> 25) && ((so2_temp.state as Number)<17){

I’d put additional brackets around the total if statement.

Hi! I have setting a generic module with 2 switch and one relay.
Switch1 on relay 1 and switch 2 indipendent. She work, but when I turn off the server mqtt, relay 2 work on relay 1. Can you Help me!

Welcome to the openHAB Forum!

Please explain what you do here, it sounds as if you are turning off the MQTT BROKER, however without the broker you can not switch any relay.

Yes I have the mqtt server disabled. but the relay and the buttons are on the same esp. the ESP being a microcontroller should be able to act even without Mqtt server. I imagine that mqtt is indispensable when I have to reach a relay or a button on another esp.

Please post your complete Setup.
Which Hardware, which Software.

Remember this thread was about the use of a Sonoff device flashed with Tasmota. If your question doesn’t fit in there consider to start an own threat!

My config is on NodeMCu with tasmota 6.6.0.1

So it has neither to do with Sonoff nor with creating a rule. You are better off with a new thread which should have nodeMCU and Tasmota in the topic. That way it may catch the eye of a person with knowledge in those topics.