Filter sensor values (only values between min and max)

my 1-wire-sensors are quity unreliable. I use them via the onewiregpio binding.
Is there any simple possibility to filter the values between a min and a max value? A temperatue of -1000°C is not possible, so I would like such a value to be deleted such that openhab doesn’t see this value.

Now I have in the items file:

    Number:Temperature onewiretemp01    "Temp [%.1f %unit%]"       <temperature> (gTemp)                         { channel="onewiregpio:sensor:onewiretemp01:temperature" }

I could write a rule to filter the values but I think there must be a shorter way. Perhaps map or transform?
(of course the best way is to have reliable sensors but this is not possible at the moment)

Use a profile:

Which one would apply in this case? The default ones do’t seem to apply. Perhaps the JS Transform profile ? Or is there something I’m missing. I’ve not used profiles yet.

Yes I think the JS one.

I cannot understand this. How can I get “no value” if the current value is outside a predifined range? I don’t want to set the value to zero, but I want to ignore the bad value; so no (new) value.

You might have to create a proxy Item and a Rule to only forward the new state to the proxy Item if it is a reasonable value.

yeah, proxy item and rule seems clear to me. But I have 10 sensors, so I need 10 proxy items and 10 rules.

But I wounder if there is any shorter solution? Such that with JS transform or something like that.

You should only need one Rule. Design Pattern: DRY, How Not to Repeat Yourself in Rules DSL.

Like the Scale Transform, JS will always return a value.

Thanks for your help. I didn’t find a solution with transormations, so I wrote rules.