moonraker icon indicating copy to clipboard operation
moonraker copied to clipboard

The ability to limit the rate MQTT messages.

Open alexrmay91 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe

When setting up objects to publish MQTT messages (specifically temperatures), messages are sent extremely rapidly and with a huge amount of decimals. Documentation states that object state is only sent if the value has changed, but with temperatures to so many decimal places, it will always change.

Describe the solution you'd like

I would like to be able to limit the rate for specific objects. Something like the following:

 status_objects:
   webhooks
   toolhead=position,print_time,homed_axes
   extruder=temperature
     rate: 1000 #ms between mesages

Alternatively, a way to round floats to a smaller number of decimals may limit the rate at which messages get published.

Describe alternatives you've considered

Using REST would be an alternative because I can specify the rate queries occur, but I prefer push communication to polling communication.

Additional information

No response

alexrmay91 avatar May 20 '22 05:05 alexrmay91

I'd like to add a +1 for this feature. After anything more than a couple of minutes publishing, I'm getting thousands of messages which seems unnecessary.

contagon avatar Sep 18 '22 00:09 contagon

I'd like to push this topic. I want to include my printer in my openHAB with MQTT. Right now this is sending lots of messages, so it's unusable, because the data will also end up in a database. In Octoprint you have the option to set a threshold for the temperature. It would be nice to have at least that option here to to limit the messages sent. Currently I get around 4 to 5 messages for the various temperatures every second. In that time the temperature has changed by 0.02 °C. That is more or less useless information.

dkneisz avatar Apr 27 '24 18:04 dkneisz