Hi,
I notice that HA has difficulties to publish or read messages from MQTT…
According to some blogs, the size of the DB may cause issues, but mine is barely 650MB… and I don’t see how a large DB is causing delays for new events being read/published…
Would performance increase with an external DB ?
When I turn of a plug, it takes at least 10-15 seconds before I see the message being put in MQTT…
Anyone has a clue?
(FYI, my HA runs on a Raspberry Pi 3B, booting from a 32GB USB3 USB drive)
I can provided evidences, but I don’t know which ones at this stage… so shoot if you need any.
I did one easy trace… publishing ON & OFF state for a plug and checking when HA receives it…
As clocks are synchronized over NTP I can use the timestamps to compare.
I see the following in the HA debug log:
2021-01-06T20:42:57.564250000Z 2021-01-06 21:42:57 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on home/unassigned/spare-plug/STATE: b'{"Time":"2021-01-06T21:42:30","Uptime":"0T03:23:26","UptimeSec":12206,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"Titi-2.4","BSSId":"C4:XX:XX:XX:4B:YY","Channel":11,"RSSI":82,"Signal":-59,"LinkCount":1,"Downtime":"0T00:00:17"}}'
HA time: 21:42:57
Msg time: 21:42:30
Diff: 27 sec
As you can see, it took HA 27sec to read the message from HA, while the plug fetched it immediatly and reacted…
CPU is not overloaded and there is memory left as well. But my Pi is freaking slow due to HA…
