NEWS
Mail wenn es neue Updates gibt
-
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?
-
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) ...
-
@myssv was sagt denn das debug log?
-
@myssv
Versuch es mal so:
-
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:
funktioniert (hatte auch nichts anderes erwartet)
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 ...
-
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 }); });
-
@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!
-
uih ... gerade kam ein neues Update und beide Scripts haben mit eine Mail gesendet!!