Possibility to ignore state "unknown"

I would love to be able to ignore the unknown state for an entity when looking at the “last_changed” information.

A good usage case is for motion sensors / magnet sensors which shows when someone last triggered them, if I do a restart of HA, or deconz or other components which makes them unavailable for a few seconds, the “last_changed” state is refreshed to 0, and it looks like the sensor was triggered.

Not sure how this would be implemented or even possible, but it’s a suggestion to make the whole HA experience a bit nicer.

Old thread bump…
I can’t believe this has not been added yet. This is a most useful suggestion.
If “unavailable” could be included as well.