Instead of switch ON, it does ON, OFF, ON

I wonder why this happens:

    2019-11-15 22:42:16.320 [ome.event.ItemCommandEvent] - Item 'sonoff4chR2L1_2mans' received command ON

    2019-11-15 22:42:16.333 [nt.ItemStatePredictedEvent] - sonoff4chR2L1_2mans predicted to become ON

    2019-11-15 22:42:16.357 [vent.ItemStateChangedEvent] - sonoff4chR2L1_2mans changed from OFF to ON

    2019-11-15 22:42:16.364 [vent.ItemStateChangedEvent] - sonoff4chR2L1_2mans changed from ON to OFF

    2019-11-15 22:42:16.489 [vent.ItemStateChangedEvent] - sonoff4chR2L1_2mans changed from OFF to ON


Switch sonoff4chR2L1_2mans	"Releu 2"	<sonoff>	(sonoff,lights)	{ channel="mqtt:topic:sonoff4chR2L1:power2", channel="mqtt:topic:sonoff4chR2L1:power2_tele", expire="10m" }

Please post your item definition, thanks

I added it to the original post

Why do you have two channels linked to the same item?
Remove the tele one. it is not needed.
Your expire definition don’t look right either:

Switch sonoff4chR2L1_2mans	"Releu 2"	<sonoff>	(sonoff,lights)	{ channel="mqtt:topic:sonoff4chR2L1:power2",  expire="10m,command=OFF" }

An explanation

In your case, the two channels are probably fighting in addition to the usual autoupdate dithering.

That is a valid configuration by the way, but probably doesn’t do what you expect. 10 minutes after the last command or update, it will set your Item’s state to UNDEF. The binding(s) won’t do anything about sending that to the device.

autoupdate=off is the right solution for my case, thank you!

the 2 channels do not fight over the status, as the tele channel only runs once in a while.
I do use expire=“10m” exactly because I want the status to be UNDEF if tele stops working.
this way I know the thing has a problem and went offline. As tele runs every 5min, the 10min expire time never gets activated.

1 Like