Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Mail wenn es neue Updates gibt

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Mail wenn es neue Updates gibt

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

      Moin zusammen,

      ich wollte mir ein einfaches Script schreiben, dass mich per Mail darüber informiert, wenn es neue Updates für den ioBroker gibt. Leider kommen keine Mails bei mir an, auch wenn es neue Updates gibt.

      Findet jemand den Fehler?

      758ee84d-79aa-4f7e-992f-594eaedc0c21-grafik.png

      Homoran FredF sigi234 3 Replies Last reply Reply Quote 0
      • M
        myssv last edited by

        Ich hatte auch schon "Falls Objekt wurde geändert". Hat auch nicht geklappt.

        So hat es in der Theorie den Vorteil, dass ich eine Mail bekomme, wenn neue Updates kommen (Wert wird größer) aber nicht, wenn ich Updates installiere (Wert wird wieder kleiner) ...

        1 Reply Last reply Reply Quote 0
        • Homoran
          Homoran Global Moderator Administrators @myssv last edited by

          @myssv was sagt denn das debug log?

          1 Reply Last reply Reply Quote 0
          • FredF
            FredF Most Active Forum Testing @myssv last edited by

            @myssv
            Versuch es mal so:
            586d935d-ceed-4869-8241-09927ac0c707-grafik.png

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

              Das Log ist schwierig, da ja nicht ständig Updates kommen.

              Ich habe mal ein neues Test-Script gemacht um zu schauen, ob es am Mail-Part liegt:

              fdc3d504-c7e5-439b-92a0-4809c015a626-grafik.png

              funktioniert (hatte auch nichts anderes erwartet)

              2476f081-ea68-4887-a8c1-efa7392d0884-grafik.png

              Funktioniert nicht bzw. es kommen keine Mails an. Laut dem Log lief das Script ja durch ...

              Scheinbar funktioniert "JSON nach Objekt" nicht so wie ich es mir wünsche ...

              1 Reply Last reply Reply Quote 0
              • sigi234
                sigi234 Forum Testing Most Active @myssv last edited by sigi234

                @myssv

                Ich habe das JS Skript:

                //  Adapter Update Notification Script
                /*
                *   @author Moritz Heusinger <moritz.heusinger@gmail.com>
                *   The scripts checks for adapter upgrades, everyday at 06:00 p.m., if there 
                *   are upgrades available it will send an E-Mail to the configured receiverMail.
                *
                *   Requirement: Running instance of the E-Mail adapter; Admin >= 3.6
                *
                *   logging:        if true, information will be logged
                *   senderMail:     mail address of the sender
                *   receiverMail:   target mail address
                */
                
                const logging = true;
                
                const senderMail = 'xxxxxxxxx';
                const receiverMail = 'xxxxxxxxx';
                
                on({id: 'admin.0.info.updatesJson', ack: true, change: 'ne'}, (obj) => {
                    if(!getState('admin.0.info.newUpdates').val) return;
                    if (logging) log('New adapter updates are available', 'info');
                    let upgradeable = JSON.parse(obj.state.val);
                    let text = 'Die folgenden Adapter sind aktualisierbar:\n';
                    for (let adapter in upgradeable) {
                        text += 'Adapter ' + JSON.stringify(adapter) + ' kann von ' + 
                            upgradeable[adapter].installedVersion + ' auf ' + 
                            upgradeable[adapter].availableVersion + ' aktualisiert werden.\n';
                    } // endFor
                    sendTo('email', {
                            from:    senderMail,
                            to:      receiverMail,
                            subject: 'Es sind neue Adapter Updates für deinen ioBroker verfügbar',
                            text:    text
                    });
                });
                
                1 Reply Last reply Reply Quote 0
                • M
                  myssv last edited by

                  @sigi234 sagte in Mail wenn es neue Updates gibt:

                  Ich habe das JS Skript:

                  Danke, ich habe es mal mit eingebaut und warte auf das nächste verfügbare Update!

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

                    uih ... gerade kam ein neues Update und beide Scripts haben mit eine Mail gesendet!!

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

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    854
                    Online

                    32.0k
                    Users

                    80.4k
                    Topics

                    1.3m
                    Posts

                    4
                    8
                    364
                    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