MQTT sensor how to use timestamp for data

I have mqtt sensor which reports temp data into MQTT. It works fine. I have in HA enable autodiscovery, so sensor is found automatically. But I have small issue, when sensor is offline, the value of temp is still the same until it changes in mqtt again.
You can see it in picture.

What can I add to mqtt values so it doesnt show when offline, would timestamp help? basically I just want to see a gap in there. i dont see like timestamp value in mqtt sensor doku.


Not sure what this means. What do you want to see? “unknown”

Well, yea probably. Anything that would break showing it in graph.

OK, I found it. I need LWT and availability_topic . Seems now it works.