MQTT Sensor - "time since last update"

I have BLE sensors that send updates via MQTT. The configuration is pretty simple and looks like this:

#my mqtt sensors
sensor 2:
  - platform: mqtt
    name: "HazelTemp"
    state_topic: "/g/g/c3be0687522e/TMP"
    unit_of_measurement: '°F'

When I click on a sensor tag in the UI, it provides info like “10 minutes ago”. This seems to be the time the sensor value was last changed, rather than when the MQTT topic was last published and updated.


So, if the temperature stays exactly the same for 40 minutes, the info would say “40 minutes ago”, even though the sensor has been publishing the same sensor value every 3 minutes for the last 40 minutes.

Is it possible to get the “minutes ago” text to show not when the last change in value was seen, but when the last MQTT topic was last published?


1 Like

The force_update parameter causes the database to be updated on every message. I assume this updates the front end as well.

1 Like