Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Bild von URL abrufen und per Mail senden

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Bild von URL abrufen und per Mail senden

    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pxstd last edited by

      Hey zusammen,

      ich suche eine Möglichkeit wie ich via Blockly Script ein Bild meiner Foscam FI9900 abrufen und per Mail senden kann.

      Die URL sieht so aus:

      http://10.1.15.98:88/cgi-bin/CGIProxy.f … d=password

      Jemand eine Idee?

      1 Reply Last reply Reply Quote 0
      • P
        ple last edited by

        So aus dem Stehgreif könntest du hier was ableiten

        http://forum.iobroker.net/viewtopic.php?f=21&t=9949

        statt Telegram dann halt den Email Adapter.

        Gruß

        1 Reply Last reply Reply Quote 0
        • P
          pxstd last edited by

          @ple:

          So aus dem Stehgreif könntest du hier was ableiten

          http://forum.iobroker.net/viewtopic.php?f=21&t=9949

          statt Telegram dann halt den Email Adapter.

          Gruß `

          Schade, als Blockly gibt's sowas nicht, oder?

          Ich schau's mir aber trotzdem mal an. Danke! 🙂

          1 Reply Last reply Reply Quote 0
          • E
            el-lutschi last edited by

            Ich hätte auch Interesse an einer Lösung in Blockly.

            Alles was ich gefunden habe funktioniert irgendwie nicht.

            EDIT: Habe eine Lösung gefunden. Ist zwar in meiner Alarmanlage und mit telegram eingebaut, sollte sich aber auch genauso auf den mail Adapter anwenden lassen.

            Der exec Code ist:

            sudo wget --output-document /opt/iobroker/ipcam/alarm.jpg 'http://Snapshot Pfad der IP Cam'
            

            Der Ordner ipcam muss noch angelegt werden, mit 777 Zugriffsrechten.

            Der Block- Export

            ! ````
            <xml xmlns="http://www.w3.org/1999/xhtml"><block type="on" id="Z~@*8vu@9I-[[#w;f];G" x="-337" y="-262"><field name="OID">hm-rpc.0.OEQ0431381.1.STATE</field>
            <field name="CONDITION">true</field>

            <statement name="STATEMENT"><block type="controls_if" id="2Q%S5E.oLx|5/z/rv,tC"><value name="IF0"><block type="logic_compare" id="7qBF|SN%ab1`h2O*9hq%"><field name="OP">EQ</field>
                    <value name="A"><block type="get_value" id="9O(#Q_J(or3%5xwr@MRd"><field name="ATTR">val</field>
                        <field name="OID">javascript.0.Eigene_Variablen.Automationen.Alarmanlage</field></block></value> 
                    <value name="B"><block type="logic_boolean" id="YYolh+Ph/F7klI9,zWI-"><field name="BOOL">TRUE</field></block></value></block></value> 
                <statement name="DO0"><block type="control" id="^E7uyr|_KhkOCNa=I{7J"><mutation delay_input="false"></mutation>
                    <field name="OID">telegram.0.communicate.response</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE"><block type="text" id="|qT.(6]+7~zxE1:w/w*}"><field name="TEXT">Wohnungstür wurde unerlaubt geöffnet</field></block></value> 
                    <next><block type="timeouts_settimeout" id="7~%K8Fnhl=W*zRx40EbR"><field name="NAME">timeout2</field>
                        <field name="DELAY">2</field>
                        <field name="UNIT">sec</field>
                        <statement name="STATEMENT"><block type="exec" id="6ve1s?L9JhgN{tV6IN[-"><mutation with_statement="false"></mutation>
                            <field name="WITH_STATEMENT">FALSE</field>
            
                            <value name="COMMAND"><shadow type="text" id="S[Pt+}glZiu^L4:C%p!o"><field name="TEXT">sudo wget --output-document /opt/iobroker/ipcam/alarm-flur.jpg 'http://10.22.22.104:8080/shot.jpg'</field></shadow></value> 
                            <next><block type="timeouts_settimeout" id="_TE4I[f#gW0r+jto`k_J"><field name="NAME">timeout</field>
                                <field name="DELAY">2</field>
                                <field name="UNIT">sec</field>
                                <statement name="STATEMENT"><block type="telegram" id="+@#O2y0-{V_yxv)9aCz0"><field name="INSTANCE">.0</field>
            
                                    <value name="MESSAGE"><shadow type="text" id="oo9N{ZDyR+iD;|*3KGr}"><field name="TEXT">/opt/iobroker/ipcam/alarm-flur.jpg</field></shadow></value></block></statement></block></next></block></statement></block></next></block></statement></block></statement></block></xml> 
            
            [3950_telegram.png](/assets/uploads/files/3950_telegram.png)
            1 Reply Last reply Reply Quote 0
            • M
              Marcelinho1692 last edited by

              Hallo,

              ich hab ein Problem:

              Wenn ich den Befehl über das Terminal eingebe, speichert es ein Bild ab. Wenn ich es im Script ausführe, wird kein Bild abgespeichert.

              Anbei bei Code:

              function foto_senden() {
                timeout = setTimeout(function () {
                  exec('sudo wget --output-document /opt/iobroker/ipcam/alarm.jpg \'http://192.168.0.76:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=admin&pwd=\'');
                  timeout2 = setTimeout(function () {
                    sendTo("telegram", "send", {
                        text: '/opt/iobroker/ipcam/alarm.jpg'
                    });
                  }, 1000);
                }, 1000);
              }
              
              1 Reply Last reply Reply Quote 0
              • P
                pxstd last edited by

                @Marcelinho1692:

                Hallo,

                ich hab ein Problem:

                Wenn ich den Befehl über das Terminal eingebe, speichert es ein Bild ab. Wenn ich es im Script ausführe, wird kein Bild abgespeichert.

                Anbei bei Code:

                function foto_senden() {
                  timeout = setTimeout(function () {
                    exec('sudo wget --output-document /opt/iobroker/ipcam/alarm.jpg \'http://192.168.0.76:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=admin&pwd=\'');
                    timeout2 = setTimeout(function () {
                      sendTo("telegram", "send", {
                          text: '/opt/iobroker/ipcam/alarm.jpg'
                      });
                    }, 1000);
                  }, 1000);
                }
                ```` `  
                

                Moin! Vermutlich fehlt deinem iobroker das Exec Recht auf deine Salatschüssel.

                Schau mal in den Javascript Adapter Einstellungen ob der Exec Haken gesetzt ist.

                1 Reply Last reply Reply Quote 0
                • M
                  msiemers last edited by

                  Ich habe das gleiche Problem. Das Exec Recht ist im Adapter vorhanden. Auch bei mir funktioniert ein ähnliches Beispiel nicht.

                  2957_2018-12-30_15_55_57-javascript_-_iobroker.png

                  1 Reply Last reply Reply Quote 0
                  • S
                    saeft_2003 Most Active last edited by

                    @msiemers und @Marcelinho1692

                    ich habe das selbe Problem habt ihr eine Lösung dafür gefunden?

                    1 Reply Last reply Reply Quote 0
                    • metaxa
                      metaxa last edited by

                      Ich habe mich gerade auch damit beschäftigen müssen.
                      Nimm das "sudo" bei 'sudo wget --output-document /opt/iobroker/ipcam/alarm.jpg '.......... weg.
                      Ich vermute, dass der "Install-Fixer" von @AlCalzone daran beiteiligt ist oder war.

                      Den Lösungsansatz fand ich hier: https://github.com/ioBroker/ioBroker.javascript/issues/292

                      Wie auch immer, bei mir gehts jetzt.

                      FRYYYYYY created this issue in ioBroker/ioBroker.javascript

                      closed exec funktioniert nicht bei shell script #292

                      AlCalzone 1 Reply Last reply Reply Quote 0
                      • AlCalzone
                        AlCalzone Developer @metaxa last edited by

                        @metaxa sagte in Bild von URL abrufen und per Mail senden:

                        Ich vermute, dass der "Install-Fixer" von @AlCalzone daran beiteiligt ist oder war.

                        Richtig vermutet. Der User iobroker hat jetzt immer Vollzugriff aufs Installationsverzeichnis. Damit ist sudo nicht mehr nötig und sollte nicht verwendet werden.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        778
                        Online

                        31.8k
                        Users

                        79.9k
                        Topics

                        1.3m
                        Posts

                        8
                        10
                        2091
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo