Window sensor that senses how far a window is open?

Can anyone give a recommendation for a sensor that tells me whether a window is open more than a few cm? This is a window that opens to the outside, and I want to know if it sticks out too far to lower the roller shutter. Regular open/close sensors look like they would detect ‘open’ if I set the window on the latched ‘ventilation’ setting. In that setting, the window is a few cm open, which I considere ‘closed’ for the roller shutter. I have no prior experience with window sensors so maybe there is enough room to tune them?
I would very much prefer a wireless sensor (no power wiring either), and if it would be compatible with ZHA (zigbee) it would be best
Thanks!

Depending on what you mean by a few cm, you might still be able to work with a door/window sensor.

The smaller part of these is just a magnet. Replacing this part with a powerful enough neodymium magnet should be enough to still detect the window as closed if it’s a couple of cm open. Buy a few different sized ones and experiment with different placements - they’re cheap enough so even if they don’t work, it’s not a major loss.

I’m assuming your window swings outward from a top pivot?

If that’s the case, simply mount the regular contact sensor at an appropriate location up the side of the window such that it still “sees” the magnet when the window is in the ‘ventilation’ position, but loses the connection shortly afterwards.

2 Likes

Some vibration sensors also register tilt angles. I have read about the Aqara DJT11LM, for example.

Or maybe this on: Tuya ZG-103Z control via MQTT | Zigbee2MQTT

1 Like

Shelly Blu Door and Window has magnetic switch and tilt sensor.

Wouldn’t the tilt sensor solution depend on if his window hinges are at the top/bottom, or whether they’re on the sides though?

Yes. Tilt sensor is only good for vertical opening. What OP has we don’t know.

I also have a Shely Blu Door/Window sensor (Bluetooth/BTHome), like @Karosm, and they got an angle detection (for vertical angle detection) and a separate magnet detection (for horizontal and vertical detection, open/closed).
afbeelding

BTW, they function very nice and are reasonably inexpensive!

EDIT: approximately 7 degrees (b/c) in my example is a top gap of +/- 15 cm (a) on a windowheight of +/- 115 cm (c) .
Check calculation HERE
Actual setup:
Screenshot_20240910_171203

EDIT2: For adding the sensor to your Home Assistant you could use an ESP32 M5Stack Atom Lite, which is easy to config on the ESPHome site by the Ready-made Bluetooth proxy project and can also be used for other several bluetooth sensors/actuators, like i.e. the Shelly BLU motion sensor or BLU button.

I hope this helps… :wink:

1 Like

I do something very similar in my house, and my solution ended up being using a standard window/door sensor (Fibaro in my case because they are quite small) and then buying a pack of really cheap hard wired sensors just to stick the magnets at the “ventilation” position. It doesn’t say how far it’s open but if it moves between those two for even a split second I get notified, so it serves my purpose of knowing if either a closed window or a ventilation window has been opened or closed in any way.

1 Like

Hi, thanks for all your answers. I should have specified indeed that it swings horizontally, not vertically. It is closed or put to ‘vent’ mode with a lock like this one
I like the suggestion that perhaps just mounting the sensor closer to the pivot point might be enough. I will get one of the sensors and try it out, perhaps play a bit with other magnet. I’ll report back once I’ve found something that works!

When I suggested this, I probably also should have suggested a second variant of this. Since these sensors are cheap, you could in fact mount one close to the mid point of the window to detect the ventilation position and another at the end of the window for the fully closed position. Then using a template sensor you can have and entity that switches between all three states: closed, ventilation and open. If both sensors detect their magnets, the window is closed, if only the centre one detects then the window is in ventillation position and if neither detects then it must be fully open.

image