I want to erase only certain values

Once in a while, a strange value appears.
Can only the strange value be erased?
Using homeassistant db, is it possible with automation?

Yes, you’ll need to learn some sql though.

Best to filter out those results though.

It looks like some kind of numeric overflow to me (max int, if I’m to make an educated guess). Might be possible to fix this at the source, but we’d need to know what this entity is and how it’s configured.