Hi there,
I am currently using home assistant (running on a docker container) with one MQTT switch, properly configured into my YAML files.
I have experienced when i turn on the switch in the frontend lovelace interface, this not always responds with the same timing: it looks like it enters a sort of “stand-by mode” when it doesn’t receive an input for a certain amount of time (for example 15 minutes).
Typical scenario: the switch hasn’t been toggled for a while.
- I toggle it via the frontend;
- The physical switch actually responds after 5 to 10 seconds.
- I toggle it again on the frontend and now it’s responding as fast as i expect (but only if not too much time has passed since last action on it).
So, when my switch is already warmed up it’s physically responding nearly synchronously with the frontend UI.
If too much time elapses between one command and another, the new command will take an annoying amount of extra time to actually propagate to the physical switch.
I don’t know the technical specs of mqtt protocol and i’d understand if the session between the broker and the subscriber ends after a certain timeout. This pushes me to think about an automation script which could revive every mqtt connection before the timeout expires…or maybe i am interpreting everything wrong so the real issue is elsewhere.
Anyway, my objective is to fix this issue and/or to find a workaround to avoid that excessive extra delay between the frontend command and the actual physical switching operation. I am sure and pretty confident it can be done somehow!
Is there anyone who already knew a similar issue or maybe a practical motivation to such kind of behaviour? Any advice to fix this in a suitable way?