From 9bbfb008651c7530dfdb9feba45a90b8bdebc08d Mon Sep 17 00:00:00 2001 From: Aljaz Ogrin Date: Mon, 9 Sep 2024 21:32:21 +0200 Subject: [PATCH] Reduced "signal" MQTT messages --- EleksTubeHAX_pio/src/Mqtt_client_ips.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EleksTubeHAX_pio/src/Mqtt_client_ips.cpp b/EleksTubeHAX_pio/src/Mqtt_client_ips.cpp index 45ce712..e6d0360 100644 --- a/EleksTubeHAX_pio/src/Mqtt_client_ips.cpp +++ b/EleksTubeHAX_pio/src/Mqtt_client_ips.cpp @@ -618,7 +618,8 @@ void MqttReportPowerState() { void MqttReportWiFiSignal() { char signal[5]; int SignalLevel = WiFi.RSSI(); - if (SignalLevel != LastSentSignalLevel) { + // ignore deviations smaller than 3 dBm + if (abs(SignalLevel - LastSentSignalLevel) > 2) { sprintf(signal, "%d", SignalLevel); sendToBroker("report/signal", signal); // Reports the signal strength LastSentSignalLevel = SignalLevel;