Tasmotized devices slow response

Hello everyone,

If I toggle a tasmotized smart switch from the web UI the response is instantaneous as well as the state update (ON / OFF) in HA. But if I toggle the same switch from my HA dashboard there’s a bit of delay in the state update (ON / OFF) on the device’s web UI. Here’s a video on this issue:

In much of the same way, if I toggle a group of switches from my HA dashboard the first time it always takes like 4 to 5 seconds (more precisely, instead of turning on all at the same time, switches turn on one by one causing a really noticeable delay). If I turn them off and then on again the response is instantaneous. Here’s another video:

A bit of useful information:

  • I have a total of 10 smart switches, 9 of them are QS-WIFI-S03 (QS-WIFI-S03 Module Switch Module Template for Tasmota), 1 of them is a Shelly 1 (Shelly 1 Switch Module Template for Tasmota). All of them run Tasmota 9.4.0

  • I have a mesh Wi-Fi system (Asus GT-AX11000 as the main router + Asus Zen Wi-FI XT8 as a node). The node is connected to the main router via a cat6 cable (wired backhaul). The link between the node and the router is 1Gbps.

  • RPi4 running HA is wired to the node (cat6 - 1Gbps). Half of my smart switches are connected to the router (GT-AX11000), the other half are connected to the mesh node (XT8).

  • By looking at the signal strenght sensor on every smart switches from the web UI, the value is between 88% to 100%.

  • All the tasmotized switches are integrated in HA via the new Tasmota integration and the MQTT broker add-on is installed and configured with the correct username and password.

Is anyone experiencing a lag / delay similar to mine with their tasmotized lights / switches?
By the video evidences, what do you think could be the cause?

Any help is greatly appreciated!

Thanks

I bit the bullet and updated all my sonoff s2 plug sockets yesterday from a very early version of 6.1.1 to version 9.4 expecting perhaps a little less latency with the later revision of firmware but was rather less than impressed…with the very sluggish response time when turning them all on or off from group settings within Home Assistant 2021.4.6.
I hadn’t noticed the delay when controlling directly from their own Web interface so I guess there must be a problem between HA and Tasmota. I don’t use a mesh but have several AP’s around the house with different SSID’s but it worked before so like you not sure where to start looking.
I didn’t use the new Tasmota Integration as they were already setup with MQTT before the upgrade.
Also using an Rpi 4 with an SSD…

1 Like

Well, I’m sorry to hear that you are experiencing the same issue as me, but at the same time is reassuring to not be alone in this.

I remember when all my tasmotized devices were on an older firmware release (I think it was 8. something) and I had zero delay / lag issue with a less performing network setup and weaker signal strenght.

But I was also on an older HA release so I really don’t know if all of this is a Tasmota firmware issue or an HA integration issue or a combination of both.

The strange thing is that if you toggle the lights via tasmota web ui it doesn’t have any issue so I am leaning towards an mqtt broker delay within HA?

I am running the latest HA release as of today on an RPI4 4GB and an SSD too. I was hoping that I could improve the situation a little bit going from a MicroSD to an SSD but it isn’t the case.

Just a curiosity: what happens if you toggle on and off multiple times a light group? Does it perform well after being turned on the first time (like in the second video) or is it always slow/laggy?

Yes this is driving me mad…There is definitely something adrift somewhere…I have about 20 sonoff S20 switches that were running tasmota 6.1.1 without any lag at all. They were all manually configured mqtt switch entities with no discovery and they worked absolutely fine, no noticeable lag. I upgraded them all to Tasmota 9.4 Leslie 2 days ago and the lag switching them all of in a group is quite profound up to 3 seconds on some to switch off.
I have noticed from directly accessing them from a web interface they respond instantaneously but from HA the first time there is the lag and then the second time they respond a little quicker…Do you have QoS set ? Or is there some sleep mode they are going into ?..Im just reading the Tasmota blurb and adjusting some options…Have you set the Optimistic: False ?

1 Like

If you want to find where the delay is, you could use a MQTT client (like MQTT Explorer) to post MQTT message yourself. If that’s still slow the delay is in MQTT, Tasmota or your Wifi.

I have multiple Tasmota device (ranging from late 8.x to 9.3) all integrated with the “old” integration and they all respond instant.

1 Like

I was going to advise exactly the same…

I do not have the issues myself, and I did move from Tasmota to ESPHome,and in general ESPHome ‘feels’ a bit faster…but this is just a hunch :wink:

1 Like

I have MQTT Explorer but that won’t show where the lag is coming from…Unless I’m using it incorrectly…
The MQTT messages are getting to where they are supposed too just with lag

1 Like

You can post a message via MQTT Explorer to the topic of the light. The moment you hit send, the light should turn on. If you experience no delay doing it that way the delay is in HA.

1 Like

You can also turn on a light from HA, and observe when the topic is posted on the MQTT explorer topic of the light…
The moment you turn on the light on HA the message should be visible on the MQTT explorer

1 Like

Doing them individually doesn’t really flag the problem it’s when they are grouped together and turned off…Some turn off instantly others have the lag of up to a few seconds…How can you prove that in MQTT Explorer…I have switched them from HA as a group and can observe the lag in MQTT Explorer…but what is this proving…What is weird is once the group has been switched on or off the subsequent turning of them off or on is instant…Its like there is a sleep issue within tasmota 9.4. I wondered if there is an issue with QoS which I have as 1 and its re polling…It was never apparent in tasmota 6.1.1

1 Like

If there is only a delay when you turn off a group the problem isn’t in Tasmota itself. Then it’s either HA (incl MQTT) or you wifi.

You can try to switch a group and check in MQTT Explorer if the timestamp of the message to all light is the same.

1 Like

@septillion I have tried as you said and the timestamp varies by a couple of seconds for a group turn off in HA and viewing in MQTT Explorer…So what is your thinking now…All the entries within /stat and /cmnd have varying timestamps within a couple of seconds

1 Like

Than I would say Tasmota is off the hook, they can’t help it if the message comes later. But I don’t know how to check if the delay is cause by HA, MQTT or your network…

1 Like

I have just read some threads that people are having issues with Mosquitto Broker 5.1.1 and are reverting back to 5.1 I haven’t got any backups as it was some time ago now…so will have to wait to see if there is an update to this…Apparently it is causing delays in some cases…Thanks for your kind input

2 Likes

You could try to just delete the addon and install it again from scratch. I’m running 5.1.1 as well and I don’t have issues.

What is the storage of your RPi4? Mine is running from SSD (USB3). If you’re running of an SD that might be your bottleneck.

1 Like

No Im SSD too…I noticed this in Mosquitto logs…
How do yours compare

[12:41:56] INFO: Setup mosquitto configuration
[12:41:56] INFO: No local user available
[12:41:56] INFO: Initialize Home Assistant Add-on services
[12:41:56] ERROR: Can't setup Home Assistant service mqtt
[12:41:56] INFO: Initialize Home Assistant discovery
1 Like

Mm, no idea what it means by that… I just looked an I have no errors in my Mosquitto broker addon.

1 Like

Hmm…It is recommended to generate a dedicated user for MQTT use only.
image


image

1 Like

You only need to create it in one spot. Or as HA user or by specifying them under logins in the addon config.

From the doc

Because I don’t see it as part of HA I only created one in the addon, not in HA.

3 Likes

My Tasmota devices respond instantly upon taping on the HASS dashboard.

Just wondering, for those who encounter the lagging issue, do you use a dedicated MQTT broker or the HA add-on? If you are using the add-on, which one did you install?

It is recommended to use the Eclipse Mosquitto (the “Official add-ons” shown in the picture above) because the other ones are (or going to be) deprecated.

Follow this guide: MQTT Broker - Home Assistant

I am new to HA but I heavily use MQTT for home automation before migrating all my IoTs to HA. So, hope you find this info relevant.

1 Like