Sonoff basic (tasmota) turns on automatically after power outage regardless of PowerOnState

Hello,

Getting a weird issue with 1 of my sonoff devices. All sonoff devices were flashed with tasmota 9.2.0 but there is an issue only with this one. Compared settings with another sonoff device which behaves well, but all is same except for the mqtt topic.

Device with issue:
UID: mqtt:topic:398e2a4556:0ea1eb5e86
label: Sonoff Basic 01 (flashed with tasmota 9.2.0)
id: SonoffBasic01
stateTopic: stat/tasmota-15845D/POWER

Issue:
After power outage, when power comes back on, this sonoff tasmota turns on automatically. In the logs, openhab (v3) shows it as an itemstatechanged event. But there are no rules that trigger this device. I have other rules that trigger other devices, which work fine.

Sonoff configuration:

Tried PowerOnState 0 and 3, same result.

Toggle on to off manually:
> 2022-01-05 19:57:29.111 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SonoffBasic01_SonoffBasic01' changed from OFF to ON
> 2022-01-05 19:57:31.754 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SonoffBasic01_SonoffBasic01' changed from ON to OFF
Reboot device. Topic turns offline, then online, then automatically turns on:
> 2022-01-05 19:57:35.585 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:398e2a4556:0ea1eb5e86' changed from ONLINE to OFFLINE
> 2022-01-05 19:58:19.962 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:398e2a4556:0ea1eb5e86' changed from OFFLINE to ONLINE
> 2022-01-05 19:58:34.979 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SonoffBasic01_SonoffBasic01' changed from OFF to ON

On the console of tasmota:

00:00:43 MQT: tele/tasmota-15845D/LWT = Online (retained)
00:00:43 MQT: cmnd/tasmota-15845D/POWER = 
00:00:43 MQT: tele/tasmota-15845D/INFO1 = {"Module":"Sonoff Basic","Version":"9.2.0(tasmota)","FallbackTopic":"cmnd/DVES_15845D_fb/","GroupTopic":"cmnd/tasmotas/"}
00:00:43 MQT: tele/tasmota-15845D/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota-15845D-1117","IPAddress":"192.168.X.X"}
00:00:43 MQT: tele/tasmota-15845D/INFO3 = {"RestartReason":"Software/System restart"}
00:00:43 MQT: stat/tasmota-15845D/RESULT = {"POWER":"OFF"}
00:00:43 MQT: stat/tasmota-15845D/POWER = OFF
00:00:58 MQT: stat/tasmota-15845D/RESULT = {"POWER":"ON"}
00:00:58 MQT: stat/tasmota-15845D/POWER = ON
00:03:18 MQT: Attempting connection...
00:03:33 MQT: Connect failed to 192.168.X.X:1883, rc -4. Retry in 10 sec
00:03:54 MQT: Attempting connection...
00:03:54 MQT: Connected
00:03:54 MQT: tele/tasmota-15845D/LWT = Online (retained)
00:03:54 MQT: cmnd/tasmota-15845D/POWER = 
00:03:54 MQT: stat/tasmota-15845D/RESULT = {"POWER":"ON"}
00:03:54 MQT: stat/tasmota-15845D/POWER = ON

Any ideas to point in the right troubleshooting direction?

Thanks

I would guess it’s a tasmota problem or better it’s caused by tasmota.
My first guess was a PoerOnState 5, but you obviously checked that. The 15 seconds between intial stat mesage after booting up and the (automotiv) switch ON makes me wonder. 15 seconds in both posted logs!

I had the same problem with one of my devices.
There was a retain message stuck somewhere in the mqtt broker.
This Video helped me to get rid of that weird behavior.

4 Likes

Thanks! That video helped :smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.