Roller shutter and window contacts - repohub/fhem GitHub Wiki

Roller shutter and window contacts

This is the description of my main module and the actual reason of the project. On the market there are several solutions available but the most of them are wireless because most people can only refurbish there settings and do not start from scratch.

(TODO)

Technical information about the roller shutter board

As shown we built our own relay boards to put behind the roller shutter switch. The relays are locked against each other to prevent errors. The sketch looked likes this:

In our setting we put a 4-wire telephone cable from the distribution cabinet to each roller shutter switch. With this setup it is possible to control from a central point every roller shutter. For caution we added an emergency contact (the 'Notkontakt') which will be applied to doors. If this contact is open, the roller shutter can not be started remotely or stops action.

The second step are several 8 Channel RS485 MODBUS RTU relay boards type R421A08 to control them from the Raspberry Pi. For the helper function I used the module from Erriez / R421A08-rs485-8ch-relay-board.

Technical information about the window sensors

To observe the window state we added window contacts on all windows. From the roller shutter switch socket another thin wire was added to above the window. We used selfmade contacts (PIC PMC-1001TH Reed-Kontakt 1 Schließer 180 V/DC, 130 V/AC 0.7 A 10 W) with 3D printed shells. This is connected to the port window contact ('Fensterkontakt'). To signal the state of the window contacts we used the 4th wire to trigger a gpio port. To trigger the contacts are triggered by neodym magnets glued to the window frame.

Raspberry Pi integration

Roller shutter

Connection is done via RS485 using the modbus protocol. The RS485 module is directly connected to the serial pins TXD0/GPIO14 and RXD0/GPIO15.

Window contacts

The Raspberry Pi 1B has only 15 GPIO ports without the serial ports on the main P1 header as seen here. Therefore I added the P5 header as well to get four more GPIO ports an other 5V, 3.3V and two GNDs.

The 24V signal is galvanic separated to the 3.3V Raspberry GPIO via opto couplers as shown below

Helper scripts

The helper script is very simple. It is just an infinity loop which sends every state change to a mqtt.

Fhem

FTUI

If a window is open fhem changes the background in the rollershutter FTUI page to red otherwise it is stays grey. FTUI rollershutter page