Tasmota smart plugs briefly unavailable

I have a couple of Local Bytes smartplugs. According to the HA logbook, the devices become unavailable then, one second later, are available again. This behaviour only impacted me once I’d set up an automation to turn off one plug after it had been on for some set duration. The issue has the effect that the ON duration is reset and therefore the trigger that turns off the plug never occurs.
What might cause these drops? Both plugs are affected yet one has significantly better wifi reception than the other. What factors, other than wifi, might cause this?

Quick follow up to my original post. Some of the unavailable events seemed to coincide with dhcp renewal. Extending the lease time (from 2h to 24h) mitigates at least some of these drops.

I had the same thing going on with my tuya smart plugs.
But since I transformed them to ESPHome firmware (and also gave them a static IP), this is no longer the case.

1 Like

When I ran a packet capture, I noticed a packet in wireshark, from MQTT server to tasmota device, described as ‘MQTT Ping’. This appears occassionally to not receive a response. The related TCP stream remains open (i.e. sequence number stays the same). This event also seems associated with the device unavailable status. Whilst MQTT is supposed to be designed/tolerant of this sort of thing, seems the change of status in HA causes some automations to not work as expected. I have now changed the automation to use a timer rather than time elapsed since the ON event.