Hi folks,
i live in a house in the countryside and want me or friends to get notified about people walking around on my property when i am away for a longer time.
Idea was to post a webcam snapshot to a Telegram group. Normally only me and my girlfriend are group members but we invite friends to the group when we are in holidays or away for some days so they can have a look when strange things are going on.
Implementation was very easy and straightforward and i like to share the basic setup here. If you have any questions about details, feel free to contact me:
Components used:
- openHAB2 running on Ubuntu 18.04 LTS
- openHAB Telegram Actions AddOn
- Homematic binding using CCU2 and HM-Sen-MDIR-O Motion detector but any other motion detector should work also.
- IP Webcam (Vivotek IP8633 ) but any webcam delivering a MJPG stream should work also.
Item for motion detection:
Switch Bewegung_Eingang "Bewegung Eingang" <motion> (gSecurity) {channel="homematic:HM-Sen-MDIR-O:LEQ0245225:KEQ0195256:1#MOTION"}
Rule that grabs a single image and posts it to Telegram group
rule "Send webcam snapshot when motion detected"
when
Item Bewegung_Eingang changed from OFF to ON
then
executeCommandLine("/usr/bin/ffmpeg -y -i http://<webcamIP here>/video2.mjpg -vframes:v 1 /tmp/eingang.jpg", 10000)
sendTelegramPhoto("group", "file:///tmp/eingang.jpg", "Bewegung Eingangsbereich entdeckt")
end