Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Jarvis v3 Popup möglich?

    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

    Jarvis v3 Popup möglich?

    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Renegade 0 @MCU last edited by Renegade 0

      @mcu

      habe einen Snapshot von meiner Türklingel im Jpg Format. Diesen würde ich gerne direkt anzeigen lassen.
      Kapier die Anleitung irgendwie nicht so ganz.

      {
        "title":"Testpopup", "message":"http://SmartBox:8082/state/ring.0.doorbell_195255640.Snapshot.jpg", "state": "unread", "criticality":"info", "display":"popup"
      }
      

      jarvis_popup.PNG

      Anstatt dem Link soll da das Bild zu sehen sein und am besten unten 3 Buttons. OK(=Löschen), Live-Ansicht(Weiterleitung) und Tür öffnen(STATE setzen).

      Also das wäre das Optimum.

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

        @renegade-0 Welches Programm nutzt du denn für die Erstellung von der Notification?

        R 1 Reply Last reply Reply Quote 0
        • R
          Renegade 0 @MCU last edited by

          @mcu
          node-red

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

            @renegade-0 Dann musst du das noch mit rein nehmen.

            httpAdr = "http://SmartBox:8082/state/ring.0.doorbell_195255640.Snapshot.jpg";
            httpAdr = httpAdr.replace('"',"%22");
            httpAdr = httpAdr.replace('"',"%22");
            jarvisNotify.message= '<iFrame src='+ String(httpAdr) +' height="350" width="350" scroll=true after height="400"></iFrame>';
            
            R 1 Reply Last reply Reply Quote 0
            • R
              Renegade 0 @MCU last edited by

              @mcu sagte in Jarvis v3 Popup möglich?:

              @renegade-0 Dann musst du das noch mit rein nehmen.

              Einfach in die {} mit rein nehmen und in add notification schreiben haut nicht hin. Wie genau geht das denn?

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

                @renegade-0 Zeig mal bitte das Programm. Also die Umsetzung, mit der du in die addNotification rein schreibst.

                1 Reply Last reply Reply Quote 0
                • R
                  Renegade 0 last edited by Renegade 0

                  @mcu
                  Noch gibt es das nicht. aktuell versuche ich mir noch den passenden String zu basteln, den ich dann in addNotification schreiben kann. Zum testen setze ich den String manuell ein.

                  Würde es aber mit einer ioBroker out machen.

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

                    @renegade-0
                    Vielleicht kann @mickym dir helfen, ich kenne mich mit node-red gar nicht aus.
                    https://mcuiobroker.gitbook.io/jarvis-infos/jarvis/besonderheiten-v3/notifications-pro/synology-bild

                    @mickym : Bitte so erklären, dass ich es in die Doku mit aufnehmen kann. Vielen Dank.

                    R mickym 2 Replies Last reply Reply Quote 0
                    • R
                      Renegade 0 @MCU last edited by

                      @mcu

                      Ich brauche eigentlich nur den String, den ich manuell einfügen kann. WEnn ich es mit einem fertigen Stringg manuell hinbekomme, kann ich mir diesen dann in node-red nachbauen.

                      1 Reply Last reply Reply Quote 0
                      • mickym
                        mickym Most Active @MCU last edited by mickym

                        @mcu sagte in Jarvis v3 Popup möglich?:

                        @renegade-0
                        Vielleicht kann @mickym dir helfen, ich kenne mich mit node-red gar nicht aus.
                        https://mcuiobroker.gitbook.io/jarvis-infos/jarvis/besonderheiten-v3/notifications-pro/synology-bild

                        @mickym : Bitte so erklären, dass ich es in die Doku mit aufnehmen kann. Vielen Dank.

                        Nun ich hab einfach Deinen Code mit dem Link in eine function Node kopiert - man kann das nun natürlich auch ohne die function Node machen:

                        Sprich das Objekt, dass @Renegade-0 in sein Objekt kopieren will ist einfach das hier:

                        {
                          "title": "Es hat geklingelt",
                          "message": "<iFrame src=https://www.iobroker.net/de/media/iobroker-simple-overview.png height=\"350\" width=\"350\" scroll=true after height=\"400\"></iFrame>",
                          "state": "unread",
                          "criticality": "none",
                          "display": "popup",
                          "timeout": 180000,
                          "snackbarOrigin": {},
                          "icon": "bell-ring-outline",
                          "iconColor": "#5D5DED",
                          "backgroundColor": "black",
                          "fontColor": "white",
                          "focusTab": ""
                        }
                        

                        Ich hab aber einfach, dass was Du in dem Code machst verwendest und in eine function Node kopiert:

                        Das einzige was ich geändert habe ist, dass man das Auslesen des Datenpunktes mit der URL zu dem Bild im Flow nun vorgelagert ist und das Objekt nicht im Code stringifiziert wird, damit man ggf. noch was ändern kann. 😉

                        7ded7a92-e417-4c72-af23-f6d13c22cba4-image.png

                        Dein Code bleibt also nahezu unverändert in der function Node:

                        3c777926-5b91-43d3-b32e-6d5a78f010e2-image.png

                        Hier der Flow zum Import:

                        [
                           {
                               "id": "5ef0a4478036e523",
                               "type": "function",
                               "z": "cacb47b4dea2692d",
                               "name": "Synology-Bild in der Notification",
                               "func": "var jarvisNotify = {};\n//Beispiele\njarvisNotify.title = \"Es hat geklingelt\";\n// \"<b>Dies ist BOLD</b>\"\n// let httpAdr = getState('synology.0.SurveillanceStation.cameras.Eingang.linkMjpegHttpPath').val;\nlet httpAdr = msg.httpAdr;\n\nhttpAdr = httpAdr.replace('\"', \"%22\");\nhttpAdr = httpAdr.replace('\"', \"%22\");\njarvisNotify.message = '<iFrame src=' + String(httpAdr) + ' height=\"350\" width=\"350\" scroll=true after height=\"400\"></iFrame>';\n\njarvisNotify.state = \"unread\";          //Damit bleibt die Benachrichtigung auch nach POPUP ungelesen und wird oben angezeigt mit der Zahl\njarvisNotify.criticality = \"none\";      // error,warning,info,success\njarvisNotify.display = \"popup\";          //drawer,snackbar,popup, none für focusTab\njarvisNotify.timeout = 180000;  //5000ms -> 5 Sekunden\njarvisNotify.snackbarOrigin = {};       //\"snackbarOrigin\": { \"horizontal\": \"...\", \"vertical\": \"\" }, \n// optional, applies when display is snackbar, { horizontal: 'center' | 'left' | 'right', vertical: 'bottom' | 'top' }\njarvisNotify.icon = \"bell-ring-outline\"; //mdi Iconify\njarvisNotify.iconColor = \"#5D5DED\";\njarvisNotify.backgroundColor = \"black\";\njarvisNotify.fontColor = \"white\";\njarvisNotify.focusTab = \"\"; //focus a certain tab\n\n// setState('jarvis.0.addNotification', JSON.stringify(jarvisNotify));\nmsg.payload = jarvisNotify;\nreturn msg;",
                               "outputs": 1,
                               "noerr": 0,
                               "initialize": "",
                               "finalize": "",
                               "libs": [],
                               "x": 550,
                               "y": 340,
                               "wires": [
                                   [
                                       "5df0cada653f60d3",
                                       "c05c57a32531b7a7"
                                   ]
                               ]
                           },
                           {
                               "id": "425bdd8b537b499f",
                               "type": "ioBroker get",
                               "z": "cacb47b4dea2692d",
                               "name": "httpAdr",
                               "topic": "0_userdata.0.Test.url",
                               "attrname": "httpAdr",
                               "payloadType": "value",
                               "errOnInvalidState": "nothing",
                               "x": 320,
                               "y": 340,
                               "wires": [
                                   [
                                       "5ef0a4478036e523"
                                   ]
                               ]
                           },
                           {
                               "id": "0cc18f9ac32e84f6",
                               "type": "inject",
                               "z": "cacb47b4dea2692d",
                               "name": "",
                               "props": [
                                   {
                                       "p": "trigger",
                                       "v": "true",
                                       "vt": "bool"
                                   }
                               ],
                               "repeat": "",
                               "crontab": "",
                               "once": false,
                               "onceDelay": 0.1,
                               "topic": "",
                               "x": 170,
                               "y": 340,
                               "wires": [
                                   [
                                       "425bdd8b537b499f"
                                   ]
                               ]
                           },
                           {
                               "id": "5df0cada653f60d3",
                               "type": "debug",
                               "z": "cacb47b4dea2692d",
                               "name": "Jarvis Notification Objekt",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 810,
                               "y": 400,
                               "wires": []
                           },
                           {
                               "id": "2334bd2f27160450",
                               "type": "ioBroker out",
                               "z": "cacb47b4dea2692d",
                               "name": "",
                               "topic": "jarvis.0.addNotification",
                               "ack": "false",
                               "autoCreate": "false",
                               "stateName": "",
                               "role": "",
                               "payloadType": "",
                               "readonly": "",
                               "stateUnit": "",
                               "stateMin": "",
                               "stateMax": "",
                               "x": 1000,
                               "y": 340,
                               "wires": []
                           },
                           {
                               "id": "c05c57a32531b7a7",
                               "type": "json",
                               "z": "cacb47b4dea2692d",
                               "name": "",
                               "property": "payload",
                               "action": "",
                               "pretty": false,
                               "x": 770,
                               "y": 340,
                               "wires": [
                                   [
                                       "2334bd2f27160450",
                                       "aa76732d72377616"
                                   ]
                               ]
                           },
                           {
                               "id": "aa76732d72377616",
                               "type": "debug",
                               "z": "cacb47b4dea2692d",
                               "name": "Stringified ;)",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 970,
                               "y": 300,
                               "wires": []
                           }
                        ]
                        

                        Für die Doku langt es dieses Objekt von oben vorzugeben, das Parmetrisieren müssen die Leute innerhalb von NR selbst machen:

                        9ff10e63-85ef-41e1-b01b-6a6d11c55306-image.png

                        [
                           {
                               "id": "0be55e6a34d1b37b",
                               "type": "change",
                               "z": "cacb47b4dea2692d",
                               "name": "Jarvis Notification Objekt",
                               "rules": [
                                   {
                                       "t": "set",
                                       "p": "payload",
                                       "pt": "msg",
                                       "to": "{\t   \"title\":\"Es hat geklingelt\",\t   \"message\":payload,\t   \"state\":\"unread\",\t   \"criticality\":\"none\",\t   \"display\":\"popup\",\t   \"timeout\":180000,\t   \"snackbarOrigin\":{},\t   \"icon\":\"bell-ring-outline\",\t   \"iconColor\":\"#5D5DED\",\t   \"backgroundColor\":\"black\",\t   \"fontColor\":\"white\",\t   \"focusTab\":\"\"\t}",
                                       "tot": "jsonata"
                                   }
                               ],
                               "action": "",
                               "property": "",
                               "from": "",
                               "to": "",
                               "reg": false,
                               "x": 590,
                               "y": 540,
                               "wires": [
                                   [
                                       "96648808fea1f662"
                                   ]
                               ]
                           },
                           {
                               "id": "eed8a7e060b7edf4",
                               "type": "inject",
                               "z": "cacb47b4dea2692d",
                               "name": "Jarvis Nachricht",
                               "props": [
                                   {
                                       "p": "payload"
                                   },
                                   {
                                       "p": "topic",
                                       "vt": "str"
                                   }
                               ],
                               "repeat": "",
                               "crontab": "",
                               "once": false,
                               "onceDelay": 0.1,
                               "topic": "Jarvis Nachricht",
                               "payload": "\"<iFrame src=https://www.iobroker.net/de/media/iobroker-simple-overview.png height=\\\"350\\\" width=\\\"350\\\" scroll=true after height=\\\"400\\\"></iFrame>\"",
                               "payloadType": "str",
                               "x": 360,
                               "y": 540,
                               "wires": [
                                   [
                                       "0be55e6a34d1b37b"
                                   ]
                               ]
                           },
                           {
                               "id": "96648808fea1f662",
                               "type": "debug",
                               "z": "cacb47b4dea2692d",
                               "name": "Jarvis Notification Objekt",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 850,
                               "y": 540,
                               "wires": []
                           }
                        ]
                        

                        R 1 Reply Last reply Reply Quote 1
                        • R
                          Renegade 0 @mickym last edited by Renegade 0

                          @mickym
                          Ah OK, versteh ich das richtig, dass du quasi zuerst über JS ein Objekt erzeugst, dass dann von JSON in String konvertierst und dann ins addNotification schreibst?

                          mickym 1 Reply Last reply Reply Quote 0
                          • mickym
                            mickym Most Active @Renegade 0 last edited by mickym

                            @renegade-0 Ja du musst immer Objekte stringifizieren, wenn du sie in einen iobroker Datenpunkt schreibst. Das Originalskript macht das ja auch. Aber ich hab dir ja das Objekt bereits extrahiert, das via JS erzeugt wird, so dass du es direkt verwenden kannst.

                            R 1 Reply Last reply Reply Quote 0
                            • R
                              Renegade 0 @mickym last edited by

                              @mickym
                              Ja. das ist mir schon klar. Nur der Schritt mit dem exec war mir neu. Den finde ich durchaus interessant 🙂

                              Kann man das "Löschen", "archivieren" und "als gelesen markieren" auch ändern?

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

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              690
                              Online

                              31.9k
                              Users

                              80.2k
                              Topics

                              1.3m
                              Posts

                              3
                              17
                              783
                              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