NEWS
Telegram sendet mit Überwachungsbilder doppelt.
-
Hallo zusammen,
habe eine Überwachungskamera an der Türe, die mit dem Klingelsignal ein Bild vom Besucher macht und es mir dann, dank eines Blockly Skripts (hier aus dem Forum), über den TelegramAdapter aufs Handy sendet. Dieses soll es zweimal tun, mit einem Abstand von 4500ms. Das klappt auch genauso. Doch kommen die Bilder jeweils immer doppelt an (Habe dann also insgesamt 4 Bilder). Leider habe ich keine Erklärung dafür. Kann mal einer bitte über das Skript schauen? Vielleicht steckt hier ein Fehler drin, den ich immer übersehe. Ich habe zwei Instanzen laufen, eine für mich und eine für meine Frau. Nehme ich eine vom Netz, bekomme ich immer noch zwei Bilder gesendet. Nur an die ausgeschaltete Instanz natürlich dann nicht.<xml> <variables> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="timeout2">timeout2</variable> <variable type="timeout" id="timeout3">timeout3</variable> </variables> <block type="on_ext" id="jj8??y8i*v{!Fb0^jZ!*" x="-587" y="-1188"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="XEKh|+XF~3OC@EHY5{8{"> <field name="oid">hm-rpc.0.CUX2801006.4.STATE</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="xXlCTj)t?n*Gg:j44f#Y"> <value name="IF0"> <block type="logic_compare" id="pMPW|b)g/=L3!yP`vsW6"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="5c7%aB|)K}(rNJ)#Jzd1"> <field name="ATTR">val</field> <field name="OID">hm-rpc.0.CUX2801006.4.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="Lhj]yTw*W`/`leEqri.g"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="eogMqz*f:xk9TWEY/!4#"> <field name="COMMENT">Speichert das erste Bild bei Klingelauslösung</field> <next> <block type="exec" id="BEjD=u,#e-;T;d-e9D;r"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation> <field name="WITH_STATEMENT">FALSE</field> <field name="LOG"></field> <value name="COMMAND"> <shadow type="text" id="p+g^=?Sl15wP.0/4C~~B"> <field name="TEXT">wget --output-document /opt/iobroker/ipcam/alarm.jpg 'http://192.168.178.63/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=Gabisch1970'</field> </shadow> </value> <next> <block type="comment" id="qm0bnl/,Dq4PjA`4!8ao"> <field name="COMMENT">Es wird 2500ms gewartet um dieses speichern auszuführen</field> </block> </next> </block> </next> </block> </statement> <next> <block type="timeouts_settimeout" id="e=c#~E)j;S+#onaowS77"> <field name="NAME">timeout</field> <field name="DELAY">2500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="comment" id="cLfsL/.hZGyA%n?O!-:5"> <field name="COMMENT">Hier wird das Bild versendet</field> <next> <block type="telegram" id="FbkrL,IGK%]5xBi#Yj,="> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="wXLWD;.*8||`3_5J8(UB"> <field name="TEXT">/opt/iobroker/ipcam/alarm.jpg</field> </shadow> </value> <next> <block type="telegram" id="z*q?qG}t*QDu?P*LF4X("> <field name="INSTANCE">.1</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="D~~O3A?{8PZGe$JaAr;q"> <field name="TEXT">/opt/iobroker/ipcam/alarm.jpg</field> </shadow> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="Fu=MNqw/7gDC_n{i|=UN"> <field name="COMMENT">Nach dem ersten Bild wird nach 4500ms das nächste Bild gespeichert</field> <next> <block type="timeouts_settimeout" id="f55+L@!5F9d*i7)8.z}-"> <field name="NAME">timeout2</field> <field name="DELAY">4500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="exec" id="d~FCu]aLbH_s[eN3oB3H"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation> <field name="WITH_STATEMENT">FALSE</field> <field name="LOG"></field> <value name="COMMAND"> <shadow type="text" id="q^pJl9(1bxjm4FLFJFlT"> <field name="TEXT">wget --output-document /opt/iobroker/ipcam/alarm.jpg 'http://192.168.178.63/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=Gabisch1970'</field> </shadow> </value> <next> <block type="comment" id="KW^QIsb%Axd:Sp^9@vZ%"> <field name="COMMENT">Es wird 2500ms gewartet um dieses speichern auszuführen</field> <next> <block type="timeouts_settimeout" id="kqLD0XWHPVb*R%96uP;%"> <field name="NAME">timeout3</field> <field name="DELAY">2500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="comment" id="Vo3{l~+:~RYcTronq]q*"> <field name="COMMENT">Und hier wird es versendet</field> <next> <block type="telegram" id="3p`vo?Dq*N;FLI4BR{`q"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="GsAgr]aq}s-1MR0mg|-W"> <field name="TEXT">/opt/iobroker/ipcam/alarm.jpg</field> </shadow> </value> <next> <block type="telegram" id=":)#;4p=xF88#(C-u4bod"> <field name="INSTANCE">.1</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="TnW]1mw{Z`x#IqAK%:8c"> <field name="TEXT">/opt/iobroker/ipcam/alarm.jpg</field> </shadow> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="ma^~d4aFY-ahr*7)hhQy"> <field name="COMMENT">ab hier so oft wiederholen wie man es möchte</field> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
Danke und Gruß Dirk
-
@dirkheider
Ändere den Trigger auf "ist größer als letztes". Dann kann auch der falls-Block oben entfallen.
Bau stattdessen eine Sperre gegen wiederholtes Klingeln ein (timeout2).