NEWS
Bei klingeln Kamerabild darstellen, 1x FotoEmail
-
Nachdem ich jetzt etwas gesucht habe und nur teile aus eizelnen Threads rauskopiert habe, möchte ich das fertige Ergebniss hier zeigen.
Vieleicht kanns ja jemand gebrauchen.Erstmal das Script ( blockly ) das aus dem Auslösen eines Tasters einen Wert setzt.
Kann sein das man den Eintrag in IOBroker erst erzeugen muss..<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="undefined" id="timeout">timeout</variable> </variables> <block type="on_ext" id="T%kdGZF|TSNFT=!eI?S:" x="163" y="-212"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=")Nd6kH~wUBD@0}X)Ln-R"> <field name="oid">default</field> </shadow> <block type="field_oid" id="y~}K9Ij!L3?TSD?|i(8l"> <field name="oid">hm-rpc.3.OEQ0099068.1.STATE</field> </block> </value> <statement name="STATEMENT"> <block type="controls_if" id="]MsKoO%~C^|nJ?Y4}e8{"> <value name="IF0"> <block type="logic_compare" id="$`^vvMGT]D#/nrlGw5uW"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="`A_?wb/o1K=QgQ,@Wq7s"> <field name="ATTR">val</field> <field name="OID">hm-rpc.3.OEQ0099068.1.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="TnaY~vau8vQSL1mHU1-~"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="E}F1COu0MnFRTNx,7+{p"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.rest.tuer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="sPI{r!~c-!OLdHO5Vlz2"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_settimeout" id="Z!u1n?8Oea^X+2RXdt~M"> <field name="NAME">timeout</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="control" id="l!5%2x*-`@KHavi9{9z@"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.rest.tuer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="IltsZ{Vw9`;FD{y#+Iow"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </next> </block> </statement> </block> </statement> </block> </xml> <xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="undefined" id="timeout">timeout</variable> </variables> <block type="on_ext" id="T%kdGZF|TSNFT=!eI?S:" x="163" y="-212"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=")Nd6kH~wUBD@0}X)Ln-R"> <field name="oid">default</field> </shadow> <block type="field_oid" id="y~}K9Ij!L3?TSD?|i(8l"> <field name="oid">hm-rpc.3.OEQ0099068.1.STATE</field> </block> </value> <statement name="STATEMENT"> <block type="controls_if" id="]MsKoO%~C^|nJ?Y4}e8{"> <value name="IF0"> <block type="logic_compare" id="$`^vvMGT]D#/nrlGw5uW"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="`A_?wb/o1K=QgQ,@Wq7s"> <field name="ATTR">val</field> <field name="OID">hm-rpc.3.OEQ0099068.1.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="TnaY~vau8vQSL1mHU1-~"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="E}F1COu0MnFRTNx,7+{p"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.rest.tuer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="sPI{r!~c-!OLdHO5Vlz2"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_settimeout" id="Z!u1n?8Oea^X+2RXdt~M"> <field name="NAME">timeout</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="control" id="l!5%2x*-`@KHavi9{9z@"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.rest.tuer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="IltsZ{Vw9`;FD{y#+Iow"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </next> </block> </statement> </block> </statement> </block> </xml>
Danach geht es weiter mit dem leicht geändertetem Script das die Hauptview auf das Kamerabild ändert. und nach 30 sekunden wieder zurück springt auf die Hauptview. Namen müssen angepasst werden.
Normales Script hier aus dem Forum:on({id: 'javascript.'+ instance + '.rest.tuer', change: "true"}, function (obj) { var instanz = getState('vis.0.control.instance').val; setState("vis.0.control.instance", instanz); setState("vis.0.control.data", 'Camerabild_view'); setState("vis.0.control.command", 'changeView'); setTimeout(function () { setState("vis.0.control.data", 'Hauptview'); setState("vis.0.control.command", 'changeView'); }, 30000); });
Danach habe ich noch ein Blockly gebaut das 2x nach 3 Sekunden ein Bild in IOBroker ablegt (
Ordner muss vorher angelegt werden mit Winscp"/opt/iobroker/ipcam") und die Fotos per Mail versendet.
Bei dem wget befehlt muss je nach Kamera noch der Zugriff eingestellt werden.
Das ist eigentlich der link wenn man ein Standbild aufruft.<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="undefined" id="timeout">timeout</variable> <variable type="undefined" id="timeout2">timeout2</variable> </variables> <block type="on" id="ue{iAe%-eNQ_HJ6.gX2?" x="62" y="-37"> <field name="OID">hm-rpc.3.OEQ0099068.1.STATE</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="3T)Q(LzW5=LAhqA~z70r"> <value name="IF0"> <block type="logic_compare" id="A,@0iDb5f(Lbr*LzRqE_"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="WC%3$?:zn:u^79IF-#!^"> <field name="ATTR">val</field> <field name="OID">hm-rpc.3.OEQ0099068.1.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="nsky`Sm3;`Ssk[kjR9`O"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="exec" id="3V@*kNYk+Z#gz4)i-)k+"> <mutation with_statement="false"></mutation> <field name="WITH_STATEMENT">FALSE</field> <field name="LOG"></field> <value name="COMMAND"> <shadow type="text" id="Z`B][wWsK0JBT)0[vY5b"> <field name="TEXT">text</field> </shadow> <block type="text" id="VlWdkj;eT1PLL#j`MDSp"> <field name="TEXT">wget --output-document /opt/iobroker/ipcam/alarm1.jpg 'http://xxxxxxIPadressexxxxxx/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=xxxxxxxxx'</field> </block> </value> <next> <block type="timeouts_settimeout" id="MM~`x]k#_pFdu24qy*Xk"> <field name="NAME">timeout</field> <field name="DELAY">3000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="exec" id="*GV}+(Th.05#@dw31fZ_"> <mutation with_statement="false"></mutation> <field name="WITH_STATEMENT">FALSE</field> <field name="LOG"></field> <value name="COMMAND"> <shadow type="text" id="j50Jkf$3XfaopXTTkT}("> <field name="TEXT">text</field> </shadow> <block type="text" id="Wi2f1f6W2]Ojug1RH1#}"> <field name="TEXT">wget --output-document /opt/iobroker/ipcam/alarm2.jpg 'http://10.0.1.14/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=gutiguti'</field> </block> </value> </block> </statement> <next> <block type="timeouts_settimeout" id="nHg:y9w+:YieQB_:5bEM"> <field name="NAME">timeout2</field> <field name="DELAY">3000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="email" id=")2nk?je(5xi1~7@/%3mS"> <field name="INSTANCE">.0</field> <field name="IS_HTML">FALSE</field> <field name="LOG"></field> <value name="TO"> <shadow type="text" id="VYk`;8$^kNwyaTp,!QuE"> <field name="TEXT"></field> </shadow> <block type="text" id="#MfOy!4Kq}H-oaG)V9)0"> <field name="TEXT">xxxx@xxxxxxxx.de</field> </block> </value> <value name="TEXT"> <shadow type="text" id="r5d0#%BvQ3luL/sGV;gv"> <field name="TEXT"></field> </shadow> <block type="text" id="Qfs;v@@GNIRSkR,%XD6X"> <field name="TEXT">klingel</field> </block> </value> <value name="SUBJECT"> <shadow type="text" id="{s^F]{Fv#nM~=u:Jeb9%"> <field name="TEXT"></field> </shadow> <block type="text" id="o3^;:Zni]81Mvb$)p#+|"> <field name="TEXT">guguck</field> </block> </value> <value name="FROM"> <block type="text" id="67Ove(x}fTi{}uPtBC+o"> <field name="TEXT">xxxxxxx@xxxxxxx.com</field> </block> </value> <value name="FILE_1"> <block type="text" id="rnT5_5vbm2JzBCP!/,XN"> <field name="TEXT">/opt/iobroker/ipcam/alarm1.jpg</field> </block> </value> <value name="FILE_2"> <block type="text" id=":~w6|@;,iYH9Y~+|b^IX"> <field name="TEXT">/opt/iobroker/ipcam/alarm2.jpg</field> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </statement> </block> </statement> </block> </xml>
Bei weiteren Fragen kann ich begrenzt behilflich sein Ich arbeite mich noch ein.
-
@fastsonic solltest vielleicht erwähnen das du eine Foscam (wenn ich mich nicht täusche) nutzt
mit einer anderen Kamera muss da was anderes rein
und
es soll keine kritik sein aber
ein view Wechsel bei grossen Views dauert zu lange.. versuchmal mit einem Dialog Widget, dass aufgeht mit dem Bild
-
Bin für jede Kritik Dankbar.
Das schau ich mir gleich heute Abend mal an.
Ich hab da noch ein schnipsel von dem Script wo dann nicht die View sondern nur ein Widget aktiviert wird, das sollte dann da passen, richtig ?
Bei dem wget befehl dachte ich es funktioniert bei allen kameras wo man über einen Http link das Standbild bekommt ?