Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Info erhalten, wenn ein Adapter gelb wird

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Info erhalten, wenn ein Adapter gelb wird

    This topic has been deleted. Only users with topic management privileges can see it.
    • crunchip
      crunchip Forum Testing Most Active @mcBirne last edited by

      @mcbirne in dem du den alive DP abfragst, z.b system.adapter.admin.0.alive
      hatte mal sowas laufen, ignore list , ist dann für Adapter mit cron

      function CreateNotification(NotificationText) {
      sendTo("telegram.0", "send", { text: NotificationText });
      }
       
      on({id: /^system\.adapter\..+\.alive$/, change: 'ne', val: false}, 
      function(dp) {
      var id = dp.id.split('.');
      id = 'system.adapter.' + id[2] + '.' + id[3];
      var instance = getObject(id);
      var ignoreList= ["tankerkoenig.0 alive",'coronavirus-statistics.0 alive','meteoalarm.0 alive','radar2.0 alive','tr-064.0 alive','ble.0 alive','iqontrol.0 alive',"feiertage.0 alive","tvspielfilm.0 alive","dwd.0 alive","ical.0 alive","ical.1 alive","daswetter.0 alive","weatherunderground.0 alive"];
       
      if ( !ignoreList.includes(dp.common.name)) {
      if(instance.common.enabled) {
      CreateNotification(dp.common.name);
      }
      }});
      
      1 Reply Last reply Reply Quote 1
      • mcBirne
        mcBirne @paul53 last edited by

        @paul53
        Hm, gibt es sowas auch als Blockly?

        paul53 1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @mcBirne last edited by paul53

          @mcbirne sagte: gibt es sowas auch als Blockly?

          Blockly hat kein getObject(id).

          Versuche es mal so:

          Bild_2021-08-11_170147.png

          JS-Funktion getCommon(id):

          return getObject(id).common;
          

          Objekt ID und Name:

          Blockly_DP_Props.JPG

          mcBirne 1 Reply Last reply Reply Quote 0
          • mcBirne
            mcBirne @paul53 last edited by mcBirne

            @paul53
            Vielen Dank!
            Es funktioniert!

            mcBirne 1 Reply Last reply Reply Quote 0
            • mcBirne
              mcBirne @mcBirne last edited by

              @mcbirne
              leider funktioniert es nur für einen Adapter, der Rot ist. Einen der Gelb ist, also nicht verbunden mit Geräten oder Diensten erkenne ich so nicht.
              2f8aa711-0549-4be1-b12d-8e8512e8bf5f-image.png

              Hat jemand eine Idee, wie man sowas erkennt?

              arteck paul53 2 Replies Last reply Reply Quote 0
              • arteck
                arteck Developer Most Active @mcBirne last edited by

                @mcbirne in objeten unter system->adapter->hue-extended

                entweder alive oder connected

                mcBirne 1 Reply Last reply Reply Quote 0
                • mcBirne
                  mcBirne @arteck last edited by

                  @arteck
                  Leider bleibt beides true. im Adapter gibt es noch syncing. Das wird false,, aber das gibt es nicht bei allen Adaptern.

                  1 Reply Last reply Reply Quote 0
                  • paul53
                    paul53 @mcBirne last edited by

                    @mcbirne sagte: Hat jemand eine Idee, wie man sowas erkennt?

                    Datenpunkt "hue-extended.0.info.connection"?

                    mcBirne 1 Reply Last reply Reply Quote 0
                    • mcBirne
                      mcBirne @paul53 last edited by

                      @paul53

                      @paul53 said in Info erhalten, wenn ein Adapter gelb wird:

                      @mcbirne sagte: Hat jemand eine Idee, wie man sowas erkennt?

                      Datenpunkt "hue-extended.0.info.connection"?

                      Der bleibt true. Es ändert sich der Datenpunkt hue-extended.0.info.syncing. Der wird in dem Fall false.

                      paul53 1 Reply Last reply Reply Quote 0
                      • paul53
                        paul53 @mcBirne last edited by paul53

                        @mcbirne sagte: Es ändert sich der Datenpunkt hue-extended.0.info.syncing. Der wird in dem Fall false.

                        Dann benötigt dieser Adapter eine Sonderbehandlung.

                        Bild_2021-08-12_151319.png

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

                          @mcbirne Ich habe für alle Adapter ein Alias eingerichtet. Damit kannst dann je nach Instanz entscheiden, welchen Datenpunkt Du als Indikator nehmen willst:

                          d1648ba5-b335-496c-a8bd-df751450cf68-image.png

                          Hatte zwar noch einen anderen Hintergrund - aber war ein nützlicher Nebeneffekt.

                          paul53 1 Reply Last reply Reply Quote 1
                          • paul53
                            paul53 @mickym last edited by paul53

                            @mickym sagte: Alias eingerichtet. Damit kannst dann je nach Instanz entscheiden, welchen Datenpunkt Du als Indikator nehmen willst:

                            Sehr gute Idee 👍
                            Mit folgender Struktur folder.device.channel.state enthält der Kanalname die Instanz:

                            Bild_2021-08-12_163356.png

                            on({id: /^alias\.0\.instances\..+\.isOK$/, change: 'lt'}, function(dp) {
                                log('Problem mit Instanz ' + dp.channelName);
                            });
                            

                            Geräte und Kanäle habe ich manuell von "instances" aus erstellt, die Datenpunkte per Skript.

                            mcBirne 1 Reply Last reply Reply Quote 1
                            • mcBirne
                              mcBirne @paul53 last edited by

                              @paul53
                              OK, dann gönne ich dem Adapter die Sonderbehandlung.

                              Danke für die Hilfe.

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

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              423
                              Online

                              32.0k
                              Users

                              80.5k
                              Topics

                              1.3m
                              Posts

                              5
                              17
                              583
                              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