MQTT Sensor Update Limiting

Hi all

I would like to propose a new configurable property onto the “MQTT Sensor” platform, namely:

update_limit_seconds: 30

I am currently making use of the MQTT Sensor to track data submitted by the MQTT plugin for OctoPrint (rather than using https://www.home-assistant.io/components/octoprint/) and it is spamming over MQTT causing a lot of data being recorded.

It would be great if I could limit the interval that the sensor would update to something more meaningful to me, like every 30 seconds / 1 min.

If this property is present HASS would ignore updates from the MQTT channel until the cooldown has elapsed.

  - platform: mqtt
    state_topic: "octoprint/temperature/bed"
    unit_of_measurement: 'c'
    value_template: '{{ value_json.actual }}'
    name: "Bed"
    update_limit_seconds: 30

Just an idea, it may be useful to others who only want\need a value less frequently

I think the effect you want can be achieved using the throttle tool in the Filter sensor.

Then exclude the MQTT sensor from the database to stop it saving too much data.

1 Like