Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Vis-Commands

    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

    Vis-Commands

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

      Hallo zusammen,

      ich hätte eine Frage zu den vis-Commands, wie in der GitHub Seite von vis angegeben.

      Dort ist u.a. zu lesen:
      ` > Commands:

      alert - show alert window in vis. "control.data" has following format "message;title;jquery-icon". Title and jquery-icon are optional. Icon names can be found here. To show icon "ui-icon-info" write Message;;info.

      changeView - switch to desired view. "control.data" must have name of view. You can specify project name too as "project/view". Default project is "main".

      refresh - reload vis, for instance after project is changed to reload on all browsers.

      reload - same as refresh.

      dialog - Show dialog window. Dialog must exist on view. One of:

      "static - HTML - Dialog",

      "static - Icon - Dialog",

      "container - HTML - view in jqui Dialog",

      "container - ext cmd - view in jqui Dialog",

      "container - Icon - view in jqui Dialog",

      "container - Button - view in jqui Dialog".

      "control.data" must have id of dialog widget, e.g. "w00056".

      popup - opens a new browser window. Link must be specified in "control.data", e.g. http://google.com

      playSound - play sound file. The link to file is specified in "control.data", e.g. http://www.modular-planet.de/fx/marsian … ansrev.mp3. You can upload your own file in vis and let it play as for instance "/vis.0/main/img/myFile.mp3". `
      Leider ist mir nicht klar wie ich das einsetzen kann? Kann mir hier mal jemand auf die Sprünge helfen?

      Besonders interessieren würde mich hier der alert-dialog oder das dialog-window.

      Wenn ich das von einem Widget aus benutzen will, kann ich ja als Objekt-ID z.B. auswählen "vis.0.control.command". Wenn ich dann bei Wert "alert" angebe, wird auch das alert window aufgemacht. Aber wie kann ich definieren wie dieses window sich verhält?

      Vielen Dank im Voraus.

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

        @Stmiko:

        Hallo zusammen,

        ich hätte eine Frage zu den vis-Commands, wie in der GitHub Seite von vis angegeben.

        Dort ist u.a. zu lesen:
        ` > Commands:

        alert - show alert window in vis. "control.data" has following format "message;title;jquery-icon". Title and jquery-icon are optional. Icon names can be found here. To show icon "ui-icon-info" write Message;;info.

        changeView - switch to desired view. "control.data" must have name of view. You can specify project name too as "project/view". Default project is "main".

        refresh - reload vis, for instance after project is changed to reload on all browsers.

        reload - same as refresh.

        dialog - Show dialog window. Dialog must exist on view. One of:

        "static - HTML - Dialog",

        "static - Icon - Dialog",

        "container - HTML - view in jqui Dialog",

        "container - ext cmd - view in jqui Dialog",

        "container - Icon - view in jqui Dialog",

        "container - Button - view in jqui Dialog".

        "control.data" must have id of dialog widget, e.g. "w00056".

        popup - opens a new browser window. Link must be specified in "control.data", e.g. http://google.com

        playSound - play sound file. The link to file is specified in "control.data", e.g. http://www.modular-planet.de/fx/marsian … ansrev.mp3. You can upload your own file in vis and let it play as for instance "/vis.0/main/img/myFile.mp3". `
        Leider ist mir nicht klar wie ich das einsetzen kann? Kann mir hier mal jemand auf die Sprünge helfen?

        Besonders interessieren würde mich hier der alert-dialog oder das dialog-window.

        Wenn ich das von einem Widget aus benutzen will, kann ich ja als Objekt-ID z.B. auswählen "vis.0.control.command". Wenn ich dann bei Wert "alert" angebe, wird auch das alert window aufgemacht. Aber wie kann ich definieren wie dieses window sich verhält?

        Vielen Dank im Voraus. `
        Du solltest einen Dialog Widget erzeugen, z.B. "jqui - HTML- dialog"

        [
          {
            "tpl": "tplJquiDialog",
            "data": {
              "visibility-cond": "==",
              "visibility-val": 1,
              "html": "Test",
              "title": "My dialog",
              "html_dialog": "Dialog HTML",
              "preload": false,
              "persistent": true,
              "closeOnClick": true
            },
            "style": {
              "left": "390px",
              "top": "218px",
              "width": "46px",
              "height": "25px",
              "border-width": "1px"
            },
            "widgetSet": "jqui"
          }
        ]
        

        Danach im "vis"-Runtime-Mode, über Script senden:

                   // Data muss widget ID haben.
                   setState("vis.0.control.command", '{"instance": "FFFFFFFF", "command": "dialog", "data": "w00002"}');
                   // oder
                   //setState("vis.0.control.instance", 'FFFFFFFF');
                   //setState("vis.0.control.data",     'w00002');
                   //setState("vis.0.control.command",  'dialog'); // muss immer als letzte sein
        
        

        Man kann auch zum Testen über Admin den Zustand von "vis.0.control.command" auf {"instance": "FFFFFFFF", "command": "dialog", "data": "w00002"} setzten-

        1 Reply Last reply Reply Quote 0
        • S
          Stmiko last edited by

          Hallo Bluefox,

          Danke für die Hinweise….so klappt es mit dem dialog.

          Ist es möglich das dialog window noch weiter zu konfigurieren, z.b. mit Ja/Nein Buttons oder so was in der Art?

          Das wäre perfekt 😄

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

            Willst du Bestätigung für setState oder überhaupt "ja"/nein?

            1 Reply Last reply Reply Quote 0
            • S
              Stmiko last edited by

              Naja, je nach Einsatzzweck des Dialog-Windows, dehalb wäre es super wenn man das konfigurieren könnte.

              Entweder als

              • Hinweis dialog, dann einen Ok-button zum Schliessen des Dialogs, oder als

              • Confirmation dialog mit Ja/Nein (oder Ok/Cancel).

              Ist das so realisierbar?

              Ich habe den Confirmation dialog bisher über ein "view in widget" realisiert, aber so wäre es einfacher und man wäre flexibler.

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

              Support us

              ioBroker
              Community Adapters
              Donate

              521
              Online

              31.9k
              Users

              80.1k
              Topics

              1.3m
              Posts

              2
              5
              4046
              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