Filter out "unavailable" in history

Hello the community !

I have some AUESS sensor that i use to know when a door is open, and even if my garden robot is out cutting the grass or at home reloading battery.

I use WIFI sensor, and as they’re passive (connected to Tuya cloud, can’t have them work with local tuya because of the short period they’re online), i used an automation to reload the devices to make them forced updates.

It works great, I got updated results after the reload, but during the process the devices became “unavailable”, for a very short period.

That could be fine except I want to produce statistique how long my robot is out etc… and I would like to remove the unavailable status if they’re under 1 minute.

Is there any way, maybe before the automation, during the automation or just after, to force the previous status before becoming unavailable ?

Thank you for your help, please ask me any further information if needed

Here the details of the device log (because I can’t post with multiple screens)

TLDR : I would love to remove those little vertical lines in my log to have clean log only having “open” and “close” unless the unavailable status exceed 1-2 minutes.

Device reload each hours, and become unavailable durin 2-5 seconds

You might be able to do it with a template sensor using triggers. E.g., use to: unavailable with for: "00:02:00", and then not_to: unavailable for all the other states.