Guys, thanks for all your help its really appreciated, however i still have my original problem. From reading some of the replies, I may not have explained the problem very well so I will try and give a better explanation, as I have done some more testing.
I’ve got the Sonoff touch switch, and because my kids are always leaving the toilet light on, I want it to turn off after a pre- determined number of minutes. I have a rule for this and it intermittently. i use the word intermittently loosely, what i should say is it works under certain conditions, which will be reviled below. I have listed the specific line from my ITEMS file below (Some of you may notice some changes I have made to it. Don’t worry that it says GarageLEDS, and not ToiletLight, The GareLEDS are closer for me to test than having to walking to the toilets lights every time to check them.
Switch GarageLEDS “Garage LEDs” [ “Switchable” ] {mqtt=">[broker:cmnd/sonoff-18/power:command:OFF:0],>[broker:cmnd/sonoff-18/power:command:ON:1],<[broker:stat/sonoff-18/power:state:default]"}
Scenario 1 - OPENHAB2 UI - WORKS
Switch on
Light turns off after 60 seconds
Scenario 2 - SONOFF UI (in Web Browser) - NOT WORKING
Switch Light On with “TOGGLE” button
Light never goes out (Until Toggle button pressed again)
Scenario 3 - SONOFF SWITCH - Doesn’t Work
Switch light on with Hardware Switch
Light turns on but never goes out until switch is pressed again
For all the above scenarios, I can see MQTT messages in MQTT.fx
For all 3 scenarios the messages that come back to MQTT.fx are identical
I get a stat/sonoff-18/RESULT which is [“POWER”:“OFF”] or ON and a stat/sonoff-18/POWER OFF or ON
I think I must be missing something really simple.
I also just notice that if I tell my Amazon Echo Dot to turn the lights on, they come on and then turn off after the required time set in the RULES, now i am really baffled
Steve