I used the clever mounting mechanism of mdkendalls model and put it into a little case. This model uses two parts, 1st is the mentioned case for the sensor and the 2nd is the stationary mount on the railing fixed with zipties.
I constructed it like this, so that the sensor could be detached for changing batteries while no new zip-ties needs to be on hand. The little lever on top can be pushed so that the case can slide out on the top.
I've printed it in PETG.
The author remixed this model.