MQTT doing strange things all of a sudden... things turning off automatically

Hi All

Ive got a sprinker that since going to 2.4 it just switches off automatically using the legacy binding. This worked fine before

08:38:06.663 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RearSprinkler' received command ON
08:38:06.663 [DEBUG] [binding.mqtt.internal.MqttItemBinding] - Publishing command ON to cmnd/sprinkler/P

8:38:36.430 [INFO ] [smarthome.event.ItemStateChangedEvent] - UPS_Battery_Runtime changed from 1395 to 1313
08:39:06.789 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RearSprinkler' received command OFF
08:39:06.789 [DEBUG] [binding.mqtt.internal.MqttItemBinding] - Publishing command OFF to cmnd/sprinkler/POWER
08:39:06.791 [INFO ] [smarthome.event.ItemStateChangedEvent] - RearSprinkler changed from ON to OFF


261 │ Active    │  80 │ 1.13.0                 │ openHAB MQTT Binding
262 │ Active    │  80 │ 1.13.0                 │ openHAB MQTT Transport Bundle

Nothing shows in the Sonoff Console for the device, its just a standard Sonoff on tasmota.

It seems it only stays on for 1 minute. Im thinking this relates to the device constantly checking a connection, potentially it looses connection and switches off. But the Access point is like 50cm away from the Sonoff it self.

Has anyone seen this?

Did you enable logging on the sonoff tasmota? Remember, we disabled it a while back.

Hi Vincent, ive turned weblog 2 on but I just see a publish off :frowning:

08:29:39 CMD: weblog 2
08:29:39 SRC: WebConsole from
08:29:39 RSL: Received Topic /weblog, Data Size 1, Data 2
08:29:39 RSL: Group 0, Index 1, Command WEBLOG, Data 2
08:29:39 MQT: stat/sprinkler/RESULT = {"WebLog":2}
08:29:46 MQT: stat/sprinkler/RESULT = {"POWER":"ON"}
08:29:46 MQT: stat/sprinkler/POWER = ON
08:30:47 MQT: stat/sprinkler/RESULT = {"POWER":"OFF"}
08:30:47 MQT: stat/sprinkler/POWER = OFF

This is internal to the sonoff.
I don’t know what setting has changed.
It may be worth resetting this one

What do you mean resetting the setting?

No, resetting the sonoff

I have an expire binding set to 1min for the gate and 1hr for the garage, could it be doing it?

/*Group Definitions for Door Sensors*/
Group:Contact:OR(OPEN, CLOSED) gDoorSensors "The doors are [%s]"
Group:DateTime:MAX gDoorsLast "The last door event was [%1$tm/%1$td %1$tH:%1$tM]"
Group:Switch:OR(ON, OFF) gDoorsTimers

/* Gates & Garage*/
Switch Gate_full "Fully" <door> [ "Lighting" ] { mqtt=">[broker:cmnd/gate/POWER1:command:*:default], <[broker:stat/gate/POWER1:state:default]", autoupdate="false" }
Switch Gate_partial  "Partial" <door> [ "Lighting" ] { mqtt=">[broker:cmnd/gate/POWER2:command:*:default], <[broker:stat/gate/POWER2:state:default]", autoupdate="false" }
Contact Gate_status "Gate Status" (gDoorSensors) [ "Switchable"]      { mqtt="<[broker:cmnd/SENSOR/POWER8:state:MAP(]" }
Contact Garage_status "Garage status" (gDoorSensors) [ "Switchable" ] { mqtt="<[broker:cmnd/2_garagedoor/POWER2:state:MAP(]" }

DateTime Gate_status_LastUpdate   "Sliding Gate Opener [%1$tm/%1$td %1$tH:%1$tM]" (gDoorsLast)
DateTime Garage_status_LastUpdate "Garage Door Opener  [%1$tm/%1$td %1$tH:%1$tM]" (gDoorsLast)
Switch Gate_status_Timer                                                          (gDoorsTimers)  { expire="1m,command=OFF" }
Switch Garage_status_Timer                                                        (gDoorsTimers)  { expire="1h,command=OFF" }

EDIT: Nup, its not the expire binding. How do I reset the sonoff?

I am sorry, mate…
OH is sending a command. It IS openHAB cuasing you trouble not the sonoff.

Please publish you items and ALL associated rules. Thanks

My Sonoff is also switching to offline and immediately to online again.
I’ve stumbled upon this issue:
As also written on github i’m not quite sure if updating OH to 2.4 (and thus maybe also updating mosquitto) or updating tasmota caused this.

Crap! just reset the config :slight_smile:

That blows away all the IP too right? oh MAN!

Oopsie daisy…

Easily done. Did you have static IPs defined for your device in your DHCP server?
If yes, then it won’t take you long to get back online.

I did, but its dropped off the network. Cant see the MAC on the router :confused:

Yes, it would, it has created it’s own Wifi access point. Connect to it with your phone and go to or
And the config of the tasmota should show up to input your wifi settings

Ive found my issue :slight_smile: and fixed it. For whatever reason, there was an EXPIRE binding on this item, f knows why. Sorry I feel so stupid. At least I learnt how to restore a sonoff hehe