Hallo
Seit gestern wird nichts von Alexa vom Logparser 2.4.0 geloggt.
Einstellungen sind identisch wie vorher.
Was kann da hängen?
[image: 1762365722744-b265638c-f0f7-4b6d-8c82-2fc33dd4b92f-image.png]
[image: 1762365740536-a5b4c176-808e-413c-8d65-4963801abb79-image-resized.png]
/******************************************************************************************************
* JavaScript Adapter Script for Log-Parser-Adapter: https://github.com/Mic-M/ioBroker.logparser
* --------------------------------------------------------------
* Purpose: Get the history of all spoken Alexa commands into the log
* Required: Alexa adapter - https://github.com/Apollon77/ioBroker.alexa2
* Source: https://github.com/Mic-M/ioBroker.logparser
* Autor: Mic-M (Github) | Mic (ioBroker)
* --------------------------------------------------------------------------------------
* Change Log:
* 1.0.0 ciddi89 * Added try/catch to fix error
* 1.0.0 Mic-M * Adoption to Log Parser Adapter
* 0.1.0 Mic-M * Initial release (for Log Script - https://github.com/Mic-M/iobroker.logfile-script).
******************************************************************************************************/
/******************************************************************************************************
* Script Settings
******************************************************************************************************/
// **Capitalize First Letters**
// The spoken command to Alexa is being returned in lowercase, like "turn on kitchen light".
// With this option set to true, the output will be "Turn On Kitchen Light" (so capitalized first letter of each word)
const g_capFirstLetters = true;
/******************************************************************************************************
* End of Script Settings. Please do not change anything below here.
******************************************************************************************************/
main();
function main() {
// All Alexa adapter instances, so alexa2.0.History.json, alexa2.1.History.json, alexa2.2.History.json, etc.
on({ id: /^alexa2\.\d\.History\.json$/, change: 'any' }, function (obj) {
try {
// obj.state.val: JSON string of oject.
// Like: {"name":"Alexa Flur","serialNumber":"xxxxxxxxxx","summary":"Wohnlicht an","creationTime":1582843794820, ... }
let objHistory = JSON.parse(obj.state.val);
// ignore alexa keywords or empty value.
if (!['', 'alexa', 'echo', 'computer', 'ziggy'].includes(objHistory['summary'])) {
// ignore "sprich mir nach"
if (!objHistory['summary'].includes('sprich mir nach ')) {
log('[Alexa-Log-Script] ##{"message":"' + formatAlexaSummary(objHistory['summary']) + '", "from":"' + objHistory['name'] + '"}##');
}
}
} catch (error) {
log(error);
}
});
}
/**
* Formats the Alexa summary text accordingly.
* @param {string} summaryText The summary text
* @return {string} the formatted summary
*/
function formatAlexaSummary(summaryText) {
if (g_capFirstLetters) summaryText = summaryText.replace(/(^|\s)\S/g, (l) => l.toUpperCase()); // Capitalize if set. https://stackoverflow.com/questions/2332811/
return summaryText;
}
EDIT: komisch, nachdem ich den Adapter auf Debug und wieder retour auf Info stellte, gehts wieder