Auf Raspberry installieren:
Stream speichern:
-w xxx = Breite der Auflösung
-h xxx = Höhe der Auflösung
-d xx = Aufnahme in Sekunden
Bild speichern:
Blockly Beispiel Code:
Code
- <xml xmlns="http://www.w3.org/1999/xhtml">
- <variables>
- <variable type="" id="z2Iu|HFWgrZ%)}YDk?,`">zeit</variable>
- <variable type="" id="qn2yOk*O@j{hc)fID/[r">Alarm</variable>
- <variable type="undefined" id="timeout4">timeout4</variable>
- <variable type="undefined" id="timeout">timeout</variable>
- <variable type="undefined" id="timeout2">timeout2</variable>
- <variable type="undefined" id="timeout3">timeout3</variable>
- </variables>
- <block type="procedures_defcustomnoreturn" id="KYwQvdd12Hx%P:zm^]iq" x="12" y="12">
- <mutation statements="false"></mutation>
- <field name="NAME">Javascript-Funktion</field>
- <field name="SCRIPT">DQoNCg0KdmFyIHRpbWVvdXQ7DQoNCg0KdGltZW91dCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgew0KDQogIGNvbnN0IGVuYWJsZXMgPSAkKCdhbGV4YTIuMC5FY2hvLURldmljZXMuKi5Db21tYW5kcy5zcGVhaycpOw0KDQplbmFibGVzLmVhY2goZnVuY3Rpb24oaWQsIGkpIHsNCiAgIGxvZyhpZCk7DQoNCnNldFN0YXRlKGlkLCAnRWluZSBCZXdlZ3VuZyB3dXJkZSBmZXN0Z2VzdGVsbHQuIEJpdHRlIGzDpGNoZWxuIGbDvHIgZGllIGxpdmUgw5xiZXJ0cmFndW5nIGlucyBJbnRlcm5ldC4gRGFua2Ugc2Now7ZuJykNCg0KDQoNCn0pOw0KfSwgNTAwMCk7</field>
- <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
- </block>
- <block type="variables_set" id="Fvr*gq:5mQdQnt4c4%do" x="13" y="37">
- <field name="VAR" id="z2Iu|HFWgrZ%)}YDk?,`" variabletype="">zeit</field>
- <value name="VALUE">
- <block type="math_number" id="(4Xe!Qu0r+fg-:$j{}F{">
- <field name="NUM">0</field>
- </block>
- </value>
- <next>
- <block type="comment" id="=w%RkZ]QEU/af)eG~;lN">
- <field name="COMMENT">Aktivierungswort</field>
- <next>
- <block type="on" id="dH=niX3=DxDbdH7,_~/o">
- <field name="OID">Meine_Geräte.0.Hausalarm</field>
- <field name="CONDITION">any</field>
- <field name="ACK_CONDITION"></field>
- <statement name="STATEMENT">
- <block type="controls_if" id="uz{6[%Ng{N7$=1FH7)Ww">
- <mutation elseif="1"></mutation>
- <value name="IF0">
- <block type="logic_compare" id="V]1.dF/pKUuI~Y/#,cUY">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="on_source" id="!Zh}/YPpgBx}0#y!m!6{">
- <field name="ATTR">state.val</field>
- </block>
- </value>
- <value name="B">
- <block type="logic_boolean" id="@jQr_hiEO=c7-uDL~Dhp">
- <field name="BOOL">TRUE</field>
- </block>
- </value>
- </block>
- </value>
- <statement name="DO0">
- <block type="timeouts_cleartimeout" id="_ozepeYHK#KAW`_bfz_k">
- <field name="NAME">timeout4</field>
- <next>
- <block type="comment" id="%/YdTu`pY`40:VRQe?S!">
- <field name="COMMENT">Zeit bis Scharfschaltung</field>
- <next>
- <block type="timeouts_settimeout" id="Oa7Zi({.3ELKes%.4T7q">
- <field name="NAME">timeout4</field>
- <field name="DELAY">1</field>
- <field name="UNIT">min</field>
- <statement name="STATEMENT">
- <block type="variables_set" id="Z~!tDjgA^lp|%gs^q!]E">
- <field name="VAR" id="qn2yOk*O@j{hc)fID/[r" variabletype="">Alarm</field>
- <value name="VALUE">
- <block type="math_number" id=";WS?JQ:iRJ2ZIrpiOdMs">
- <field name="NUM">1</field>
- </block>
- </value>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- <value name="IF1">
- <block type="logic_compare" id="T}A{N8H#ZJJXaVYA]ECQ">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="on_source" id="@7#9p+Wvq`.=f8Sxwi^U">
- <field name="ATTR">state.val</field>
- </block>
- </value>
- <value name="B">
- <block type="logic_boolean" id="wn`6b/V/kT2P!gg^w/56">
- <field name="BOOL">FALSE</field>
- </block>
- </value>
- </block>
- </value>
- <statement name="DO1">
- <block type="timeouts_cleartimeout" id="WQ,XXmhs-jD6z,bw1:Wr">
- <field name="NAME">timeout4</field>
- <next>
- <block type="variables_set" id="z_prG|UsBR*a([+lY#NT">
- <field name="VAR" id="qn2yOk*O@j{hc)fID/[r" variabletype="">Alarm</field>
- <value name="VALUE">
- <block type="math_number" id="i58vx)(z1~dMq,#?XhIY">
- <field name="NUM">0</field>
- </block>
- </value>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </statement>
- <next>
- <block type="comment" id="MvND4lH`)vAgUdl#jE-h">
- <field name="COMMENT">Bewegungsmelder</field>
- <next>
- <block type="on_ext" id="r0Hhgi9ltXCayqk/b%s3">
- <mutation items="2"></mutation>
- <field name="CONDITION">any</field>
- <field name="ACK_CONDITION"></field>
- <value name="OID0">
- <shadow type="field_oid" id="KN`IRO-W:2PXR{DNTre}">
- <field name="oid">sonoff.0.BewegungBad.POWER1</field>
- </shadow>
- </value>
- <value name="OID1">
- <shadow type="field_oid" id="owe.IZ(,z7LiIBD)/lk8">
- <field name="oid">sonoff.0.Wohnbeweg.POWER1</field>
- </shadow>
- </value>
- <statement name="STATEMENT">
- <block type="controls_if" id="Q35n_tHaFg%,ksTV?d+(">
- <value name="IF0">
- <block type="logic_operation" id="UdvD~wcbTEjTIDkWj+dK">
- <field name="OP">AND</field>
- <value name="A">
- <block type="logic_compare" id="_Rr~%Xjl:QSqrK.L$sWE">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="variables_get" id="LTOzvt{D)RjS]Q+0-4kj">
- <field name="VAR" id="z2Iu|HFWgrZ%)}YDk?,`" variabletype="">zeit</field>
- </block>
- </value>
- <value name="B">
- <block type="math_number" id="Qi5hkKpY2Ht3dLLQ%Da7">
- <field name="NUM">0</field>
- </block>
- </value>
- </block>
- </value>
- <value name="B">
- <block type="logic_operation" id="Z{E//WNbLb5udI%KmENw">
- <field name="OP">AND</field>
- <value name="A">
- <block type="logic_compare" id="E[@`_8(V:oaS09P|@Low">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="on_source" id="(i_RzK#8G`/3UnPgKz.U">
- <field name="ATTR">state.val</field>
- </block>
- </value>
- <value name="B">
- <block type="logic_boolean" id="BC;m-d@/+FT4alYyL~xc">
- <field name="BOOL">FALSE</field>
- </block>
- </value>
- </block>
- </value>
- <value name="B">
- <block type="logic_compare" id="?9p`(}?h)^|TP|CK;?D1">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="variables_get" id="eQbc=B{[gHYfR28:9B/R">
- <field name="VAR" id="qn2yOk*O@j{hc)fID/[r" variabletype="">Alarm</field>
- </block>
- </value>
- <value name="B">
- <block type="math_number" id="{#,{3B8.ac!j^,Tvtl9@">
- <field name="NUM">1</field>
- </block>
- </value>
- </block>
- </value>
- </block>
- </value>
- </block>
- </value>
- <statement name="DO0">
- <block type="variables_set" id="N:gKuCwFVt9Y0m9zWgMI">
- <field name="VAR" id="z2Iu|HFWgrZ%)}YDk?,`" variabletype="">zeit</field>
- <value name="VALUE">
- <block type="math_number" id="8@yA+;z~mDcD-SPKO-PN">
- <field name="NUM">1</field>
- </block>
- </value>
- <next>
- <block type="timeouts_settimeout" id="u6nKmcD7G8+sE8,v()L7">
- <field name="NAME">timeout</field>
- <field name="DELAY">65</field>
- <field name="UNIT">sec</field>
- <statement name="STATEMENT">
- <block type="variables_set" id="gNQ4$G?UkjrFAxNnlWFc">
- <field name="VAR" id="z2Iu|HFWgrZ%)}YDk?,`" variabletype="">zeit</field>
- <value name="VALUE">
- <block type="math_number" id="gFwmNFei_c4o|3$uxcAG">
- <field name="NUM">0</field>
- </block>
- </value>
- </block>
- </statement>
- <next>
- <block type="timeouts_settimeout" id="X)93J?zuT,!YApFpfT4M">
- <field name="NAME">timeout2</field>
- <field name="DELAY">3</field>
- <field name="UNIT">sec</field>
- <statement name="STATEMENT">
- <block type="comment" id="6:E9:-4Ri)p*ZqrMCqZc">
- <field name="COMMENT">Alexa spricht</field>
- <next>
- <block type="control" id="cokzF%IUz_?j5$PUa|gI">
- <mutation delay_input="false"></mutation>
- <field name="OID">alexa2.0.Echo-Devices.G000RA08848204QA.Commands.speak</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="text" id="Npjy.#LjF==G{4Z))v-M">
- <field name="TEXT">Eine Bewegung wurde festgestellt. Bitte lächeln für die live Übertragung ins Internet. Danke schön</field>
- </block>
- </value>
- <next>
- <block type="comment" id="R3U?lo:GWHbLx*tyLc0E">
- <field name="COMMENT">Alle Alexa sprechen</field>
- <next>
- <block type="procedures_callcustomnoreturn" id="RPe:BinW-#Vkq;Bwxi-g" disabled="true">
- <mutation name="Javascript-Funktion"></mutation>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- <next>
- <block type="comment" id="B^;`]ikr{S7lB*kMc[oU">
- <field name="COMMENT">Gesamte Beleuchtung an</field>
- <next>
- <block type="control" id="#.d;kCVEs,%~[,nD5zo+">
- <mutation delay_input="false"></mutation>
- <field name="OID">alexa2.0.Smart-Home-Devices.1aca576b-55c0-41bf-b6c0-d2e1c6c2c1fb.powerState</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="logic_boolean" id="1ht]/e(^*)R8S*2Ebvc|">
- <field name="BOOL">TRUE</field>
- </block>
- </value>
- <next>
- <block type="comment" id="4ZGOh.Lkbe~?WxV^Q?|D">
- <field name="COMMENT">Alexa sendet an Smartphone</field>
- <next>
- <block type="control" id="dE]-_7z1+_^a`4%xzanD">
- <mutation delay_input="false"></mutation>
- <field name="OID">alexa2.0.Echo-Devices.G000RA08848204QA.Commands.notification</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="text" id="A:$O_a))|:2Q]TqgvtCp">
- <field name="TEXT">Eine Bewegung wurde festgestellt</field>
- </block>
- </value>
- <next>
- <block type="comment" id="3RCpOFNWcMInH~@Rzri$">
- <field name="COMMENT">Film speichern</field>
- <next>
- <block type="exec" id="h#oLI=Y)/*WsaP(KUTvj">
- <mutation with_statement="false"></mutation>
- <field name="WITH_STATEMENT">FALSE</field>
- <field name="LOG"></field>
- <value name="COMMAND">
- <shadow type="text" id="XQV|2W]ekQ!@#QhA+qu(">
- <field name="TEXT">openRTSP -w 1920 -h 1080 -4 -d 60 -t -b 100000 rtsp://benutzername:passwort@192.168.188.74:554/onvif1 > /home/pi/Video/Wohnzimmer-`date +%Y%m%d%H%M`.mp4</field>
- </shadow>
- </value>
- <next>
- <block type="comment" id="f%A94[@_VHE}.m]xqd9x">
- <field name="COMMENT">Bild speichern</field>
- <next>
- <block type="exec" id="UAyzrx]69y}!)DS7+T9:">
- <mutation with_statement="false"></mutation>
- <field name="WITH_STATEMENT">FALSE</field>
- <field name="LOG"></field>
- <value name="COMMAND">
- <shadow type="text" id="w^%~mB/aw01PQh?PnU9@">
- <field name="TEXT">ffmpeg -loglevel fatal -i rtsp://benutzername:passwort@192.168.188.74:554/onvif1 -vframes 1 -y -r 1 /home/pi/Video/Wohnzimmer.jpg</field>
- </shadow>
- </value>
- <next>
- <block type="timeouts_settimeout" id="m9e],#-;v,/+mb%bnMtU">
- <field name="NAME">timeout3</field>
- <field name="DELAY">10</field>
- <field name="UNIT">sec</field>
- <statement name="STATEMENT">
- <block type="comment" id="64r1cI0WuTL3USe85#J#">
- <field name="COMMENT">E-Mail mit Bild senden</field>
- <next>
- <block type="email" id="hjBEY~GG#$Dh{v#D,_K.">
- <field name="INSTANCE"></field>
- <field name="IS_HTML">FALSE</field>
- <field name="LOG"></field>
- <value name="TO">
- <shadow type="text" id="8NP7.jgbXXyEhS1h4B*L">
- <field name="TEXT">deine@email.adresse</field>
- </shadow>
- </value>
- <value name="TEXT">
- <shadow type="text" id="t,=u3T=(gYYTm8mnfR?v">
- <field name="TEXT">Hausalarm Screen</field>
- </shadow>
- </value>
- <value name="SUBJECT">
- <shadow type="text" id="[49@%m8LLSJ{(O*6QwK6">
- <field name="TEXT">Hausalarm Screen</field>
- </shadow>
- </value>
- <value name="FILE_1">
- <block type="text" id="A7iE8,ccl!e,PTmzF)Dl">
- <field name="TEXT">/home/pi/Video/Wohnzimmer.jpg</field>
- </block>
- </value>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </next>
- </block>
- </xml>