Hi, please help
I have OPENHAB2 MQTT working on PI3
A SONOFF switch is connected to the Biler, the switch works on ON and OFF everything is OK, and now I want to set a timer for half an hour, and after 30 minutes the switch will switch OFF.
I realized that I have to set the RULES, but I do not know how.
Don’t forget that the expire part doesn’t actually turn anything else on or off, all that happens is it will change the item state to = ON or = OFF which might work for you day 1 but you may need more logic behind it, ie only switch it on if it is daytime and you are home…to do this you will need to create rules to actually do something else.
So, you need to create a rule that does something when the item state = ON and then another one when the state = OFF:
rule "do something when hot water item state changes"
Item MyHotWaterItem changed
// do something
// do something else
In this case the rule will run when the state changes, if it is ON then it will ‘do something’ otherwise, (and logic says it will be OFF), it will ‘do something else’
Using expire=, you can specify if you would like it to perform a command or a state update at expiry time.
If a command, it will be acted on just the same as a command from a rule or UI, i.e. it will get sent to any bound devices.