Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. [Gelöst] JavaScript für Jarvis Benachrichtigung

    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

    [Gelöst] JavaScript für Jarvis Benachrichtigung

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

      Hallo Zusammen,

      mir fehlt hier leider das Wissen um weiterzukommen.
      Derzeit leite ich eine URL an Jarivs weiter, wo eine Benachrichtigung aufploppt. Das funktioniert. Nun will ich die URL gegen einen Dateipfad vom ioBroker tauschen...

      var jarvisNotify = {};
      //Beispiele
      jarvisNotify.title = "Es hat geklingelt";
      // "<b>Dies ist BOLD</b>"
      httpAdr = "http://raspberrypi:8082/ring.0/ring_0_doorbell_609102320_HDSnapshot.jpg"
      httpAdr = httpAdr.replace('"',"%30");
      httpAdr = httpAdr.replace('"',"%30");
      jarvisNotify.message= '<img src='+ String(httpAdr) +' height="100%" width="100%"></img>';
      //jarvisNotify.message= '<iFrame src='+ String(httpAdr) +' height="1000" width="100%"></iFrame>';
       
      jarvisNotify.state = "read";          //Damit bleibt die Benachrichtigung auch nach POPUP ungelesen und wird oben angezeigt mit der Zahl
      jarvisNotify.criticality = "none";      // error,warning,info,success
      jarvisNotify.display ="popup";          //drawer,snackbar,popup, none für focusTab
      jarvisNotify.timeout= 60000;  //5000ms -> 5 Sekunden
      //jarvisNotify.timeout= 180000;  //5000ms -> 5 Sekunden
      jarvisNotify.snackbarOrigin = {};       //"snackbarOrigin": { "horizontal": "...", "vertical": "" }, 
                                              // optional, applies when display is snackbar, { horizontal: 'center' | 'left' | 'right', vertical: 'bottom' | 'top' }
      jarvisNotify.icon = "bell-ring-outline"; //mdi Iconify
      jarvisNotify.iconColor = "#5D5DED";
      jarvisNotify.backgroundColor = "black";
      jarvisNotify.fontColor = "white";
      jarvisNotify.focusTab = ""; //focus a certain tab
      setState('jarvis.0.addNotification',JSON.stringify(jarvisNotify));
      

      nun würde gerne den Inhalt von httpAdress durch folgenden internen Raspipfad bzw. ist auch ein Datenpunkt tauschen.

      a8f17836-d0c1-42db-b1ef-3150a986dd1b-image.png

      /opt/iobroker/iobroker-data/files/ring.0/doorbell_609102320/HDsnapshot609102320_1736440114187.jpg (Die zahlen ändern sich)
      

      funktioniert das irgendwie?

      Bin absoluter Anfänger in JavaScript...

      Danke Schonmal 🙂

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @firechumper last edited by MCU

        @firechumper Wie lautet der DP? ring.0....file

        let dpFile = 'ring.0.doorbell_609102320.HD_Snapshot.file
        let valueFile = getState(dpFile).val.replace('/opt/iobroker/iobroker-data/files','')
        let httpAdr = "http://raspberrypi:8082" + valueFile
        
        F 1 Reply Last reply Reply Quote 0
        • F
          firechumper @MCU last edited by

          @mcu
          ring.0.doorbell_609102320.HD Snapshot.file

          F 1 Reply Last reply Reply Quote 0
          • F
            firechumper @firechumper last edited by

            @firechumper said in JavaScript für Jarvis Benachrichtigung:

            ring.0.doorbell_609102320.HD Snapshot.file

            Das war die Lösung! 1000 Dank ❤

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

            Support us

            ioBroker
            Community Adapters
            Donate

            788
            Online

            31.7k
            Users

            79.9k
            Topics

            1.3m
            Posts

            2
            4
            157
            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