Make value 0 if unavailable

Use it all the time. It’ll show the sensor value when it can be evaluated as a number.

It’s possible your original sensor can be set up to solve this for you, but as you’ve omitted to provide any details I can’t tell.