I have a VL53L0x that gives me a value of .06 meters when the garage door is closed and a value of “unknown” when the garage door is open (because there is nothing for the laser to reflect off of). It works great.
I wonder whether it might be better to not flood HA with sensor data. Is there some lambda I can add to the yaml so the sensor value is only sent to HA upon the state change? Say, if the state changes from “a numerical value between .04m and .10m” to a state of “unknown”, and vice versa?