Platform: Openhab 3 on ubuntu 20.04 on raspberry pi 4
Sonoff basic running Tasmota 9.2.0 by Theo Arends
Hello all,
I’ve been noticing some lag lately in some of my sonoff devices running tasmota.
Firing an on/off event from openhab mobile app or web app triggers the switch on openhab immediately:
2022-01-31 22:34:08.621 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'SonoffBasic22_SonoffBasic22' received command ON
2022-01-31 22:34:08.622 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'SonoffBasic22_SonoffBasic22' predicted to become ON
2022-01-31 22:34:08.634 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SonoffBasic22_SonoffBasic22' changed from OFF to ON
But actually the lights turn on after 4-5 seconds.
Is there any settings that can help reduce this lag? I tried to change mqtt broker qos from 0 to 1 but this does not seem to have any effect.
Thanks @hafniumzinc anything specific to look for in mqtt explorer?
I noticed below in the particular topic. Also noticed that the lag does not happen every single time - when turning it on/off repeatedly. the lag happens approximately 1 out of 8 times.
cmnd
tasmota-FBD17F
POWER = ON ----> this turns on immediately
stat
tasmota-FBD17F
RESULT = {"POWER":"ON"} ----> this remains off and turns on when the light turns on after 4-5 seconds
POWER = ON
The behavior is as below when checking on tasmota console.
Turn on lights:
Immediately on openhab:
2022-02-01 09:50:12.503 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'SonoffBasic22_SonoffBasic22' received command ON
2022-02-01 09:50:12.505 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'SonoffBasic22_SonoffBasic22' predicted to become ON
2022-02-01 09:50:12.513 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SonoffBasic22_SonoffBasic22' changed from OFF to ON
After 4-5 seconds, on tasmota console when the lights turn on:
Can you set the date of your tasmota device correctly? I don’t know much about what’s going on in MQTT in the background, but it could be that you have problems since the time/date of your broker and your device are not really in sync.
openHAB and the broker are in 2022, your tasmota device is in the 70s
Lol true. I’ve changed it but it seems that a reboot/powercut defaults it back to the 70s
After changing the time, timezone and ntpserver as below, it seems to be better but I did get the lag a couple of times. I’m currently facing some power cuts and can’t test more extensively, will try and reproduce the lag tomorrow and feedback.
Thanks, I updated this. Will test and feedback tomorrow. It was set to 0 - you think the reason for the lag might be that the sonoff and wifi network gets “disconnected”?
I had the same problem. After watching the LWT status from my devices i saw that they disconect from time to time just for a few seconds.
Since i set SetOption41 to 30 everything is working as expected.
I’m getting other issues now following the power cuts and am researching on tasmota forums - basically around 6 out of 20 sonoff devices (including 22 on which I was testing) did not come up after the multiple outages and they are not responding, as in:
no effect of tripping the breaker to cause it to reboot again
no led lights on the device light up
pressing the button on the sonoff does not do anything (on the other hand on the working sonoff devices, pressing the button turns on/off the lights connected to it
As for the lag, for now I’ve reconfigured all the sonoff devices that are up (local ntpserver for correct time + SetOption41 30) and the response time observed is definitely much better
I have a Sonoff Basic in a similar state. I’m pretty sure it does power up (I am able to reflash it, for example) but I think something with the WiFi is broken. On first boot up it no longer presents as an access point. Are you sure yours are definitely dead, rather than just not connecting with WiFi?
Not sure, I think it’s unlikely that 5-6 devices drop dead (hope not )
I’ll have to check whether it’s drawing power before taking it out. Now am trying to find out ways to reset it without taking it out of the circuit and flashing through serial connection like I did originally using tasmotizer.
How are you reflashing it by the way?
Hold the button (Button1) down, if available, for 40 seconds. After that the device should reset and reboot. Fully cycle power after that is done to make sure everything is starting from scratch.
Or this?
Cut power from the device completely for 30 seconds
Power the device on and off six times with intervals lower than 10 seconds and leave it on after seventh time
Fast power cycle device recovery should activate and the device should be reset to firmware defaults
In that case i took the devices out of the circuit and reflashed via USB to TTL and VisualStudioCode and Platformio.
With that software i compile also my own binary files.
If you do so and you have to powercycle your device, it connects directly to your wifi network.
Oh, I actually mean properly reflashing with a new Tasmota using the USB to serial adaptor I have. Yeah, like you, no combination of startup voodoo made the thing come to apparent life!