Reduce Frequency of MQTT Publish Events #10520
-
Hello, I am using Tasmota 9.2.0 with about 20 switches (mostly Shellys) and another 20 sensor nodes. All those nodes are linked to a Homeassistant installation running a mosquitto MQTT broker on a Raspberrry Pi. From the MQTT broker I am currently feeding the sensor data via Node-RED into a mariaDB database for further longterm evaluation. This setup works just fine and the stability of the Tasmota powered devices is amazing!! 👍 Nevertheless I see that the nodes are are publishing updates multiple times per minute and if I channel all these updates directly into the database it grows very big in a short period of time. And since the pressure or the outside temperature do change in much longer intervals this is not necessary. I can filter the input via Node-RED but I think the better way would be to reduce the frequency of sensor data updates published to the MQTT broker - since this would reduce traffic and power consumption. I saw the topic #10323 dealing with a setup of Domoticz and read about the TelePeriod parameter but this does not solve my issue - I guess - because it sets the maximum time interval for an update as far as I understand. Ideally I would like to achieve something like "send only if the value changed by X or if the last publish is at least Y seconds ago". But even a fixed update period would be OK for me. What am I missing? Or is it necessary to publish only via rule? Suggestions are much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
"Multiple times per minute" sounds like you have a lower TelePeriod than the default of 5 minutes (which generally makes sense for environment sensors). What value do you have? |
Beta Was this translation helpful? Give feedback.
-
It might also be that your sensors are reporting changes in readings that often. This could be due to the resolution setting (number of decimal places) which means even a thousandth difference could generate a telemetry update. For some sensors there are delta thresholds you can set. As @sfromis mentioned, check your |
Beta Was this translation helpful? Give feedback.
-
Thanks for the very quick answers!
These are the defaults I guess. BUT, looking at the log and trying to figure the exact interval I probably saw my error: I am deriving the values from the STATUS10 / StatusSNS from the stat-topics. These get updated approx. every 8s. The tele/SENSOR topic follows the TelePeriod interval - I changed it and works as expected. Sorry for being so blind... BTW: Is there a possibility to reduce the frequency of publishing the stat-topics as well? |
Beta Was this translation helpful? Give feedback.
-
Are you running TasmoAdmin? |
Beta Was this translation helpful? Give feedback.
-
Yes, I do run TasmoAdmin....and that is the source for the demands barbudor mentions. |
Beta Was this translation helpful? Give feedback.
Are you running TasmoAdmin?