Remove last value from unavailable device

Hello.
I got eps01 with dht22 sensor with mqtt server.
The config looks like that:

  - sensor:
      name: "Temperature bedroom"
      state_topic: "myhome/floor2/badroom1/dht22/temperature"
      suggested_display_precision: 3
      unit_of_measurement: "°C"
      unique_id: dht22_temperature1
  - sensor:
      name: "Humidity bedroom"
      state_topic: "myhome/floor2/badroom1/dht22/humidity"
      unit_of_measurement: "%"
      unique_id: dht22_humidity1

So, the problem is, when the device is unavailable for some time, it still shows the last value on graphs, and I did not like that behavior, graphs look unclear for me. How to change that and make Home Assistant not show unavailable devices in graphs ?

You need to set up LWT on the device: MQTT - Home Assistant