I have had a humidity sensor in the top of one of my hives for about 2.5 years and it has survived. I have it behind a piece of 1/8" hardware cloth and the bees have not managed to completely block it yet.Any permanent sensor will be rendered useless in due time by the bees......except weight and temp. O2 would be covered in an hour.
It started in a normal lid, and about a year in I moved it to a quilt box. They have not sealed the top of the quilt box yet, so I think the sensor is still reading about right. There are ways to protect the sensor, but you have to plan ahead and not leave the sensor exposed.