NEWS
Neuer Alexa-Skill "iobroker.assistant"
-
Hallo,
durch die Anleitung hat die Umstellung grundsätzlich gut funktioniert. Ich habe aber drei Probleme:
-
Ich habe eine Szene die ich steuern möchte (true / false) und habe auch den Typ auf "Szene" gestellt. Leider passiert nichts wenn man die Szene via Alexa triggert. Wenn ich den Typ umstelle auf Steckdose kann bekommt man nur False geschaltet". Woran kann das liegen?
-
Manchmal kommt egal bei welchem Gerät"der damit verknüpfte Skill ist nicht verbunden". Im IOT Adapter unter "Alexa-Geräte" habe ich die Geräte nicht gelöscht aber in der Alexa App. Woran kann das liegen?
-
In der Alexa App unter Einstellungen-> Geräteeinstellungen tauchen nur die Geräte welche über V3 verbunden sind auf, gleiches gilt über den Weg Alexa App->Geräte. Bearbeite ich aber eine Gruppe oder will eine neue Gruppe erstellen tauchen die Geräte doppelt auf (also V1 und V3). Woran kann das liegen?
-
-
Das mit dem IOT Adapter hat alles gut funktioniert und läuft mit 5.0.7 stabil.
Ich hatte aber ein paar Sprachausgaben wie zB Anrufer Namen die ich an die Alexa schicken konnte.
Sprich Telefon klingelt, Alexa sagt" Anruf von XYZ".
Wie setze ich das nun um? -
Das mit dem IOT Adapter hat alles gut funktioniert und läuft mit 5.0.7 stabil.
Ich hatte aber ein paar Sprachausgaben wie zB Anrufer Namen die ich an die Alexa schicken konnte.
Sprich Telefon klingelt, Alexa sagt" Anruf von XYZ".
Wie setze ich das nun um?@Bavarian Das geht über den Alexa2 Adapter und hat nichts mit dem iot zu tun.
-
Hallo,
ich habe das Problem, daß ich den ioBoker.assistant-Skill nicht aktivieren kann, bzw, nicht mit dem iobroker.pro-Konto verknüpfen kann, da es zu einer Fehlermeldung "Konten konnten nicht verknüpft werden"
Ich bin echt ratlos, es war ein weiter Weg bis hier.-Da einige Pakete nicht mehr zur Verfügung standen habe ich den ganzen Pi auf Debian 13 neu aufgebaut.
-Backupdaten gelesen und alle Adapter aktualisiert.
-iobroker.pro abo ist aktuell und Zugangsdaten i.O. (sogar nochmal neues PW angelegt)
-alten Skill deaktiviert, neuer Skill auf Handy wegen alten Android nicht möglich(Alexa-App gelöscht), also über Tablet versucht anzumelden.
-Instanz iot ist verbunden, alte Alexa V1 deaktiviert , unter Alexa-Geräte V3 sind alle alten Geräte vorhanden
-mehrfach den Botton"IOT-Anmeldeinformationen neu erstellen" gedrückt und Instanzen neu gestartet, ohne Erfolg
![Screenshot_20260111-164140[1].png](/assets/uploads/files/1768150764833-screenshot_20260111-164140-1.png)
Wo steckt hier das Problem ???Vielen Dank im Vorraus
Grüße
Andreas
-
Hallo,
wenn ich in der Instanz auf "Services und FITTT" gehe, dort einen neuen Dienst in die whitelist eintrage, wird in der Objekte Strucktur alles richtig angelegt.
Wenn ich nun den Link adaptiere und im Browser teste, bekomme ich {"result":"OK"} aber im DP steht leider noch immer "null"
Bei iobroker.pro wird auch der Zähler in der Diagnose für die verwendeten Befehle erhöht. Der Inhalt es links wird nicht übertragen an den IOB.
Gibt es dazu einen Workaround?Erledigt: ein reload des IOB brachte die Lösung
-
Servus, kann man die Schaltbefehle des Alexa Adapters irgendwie überprüfen oder nachvollziehen? Ich habe seit letzter Woche das Problem, daß jeden Abend eine Meldung von iobroker.info kommt, daß die 50 limitierten Schaltbefehle überschritten sind. Habe aber keine Ahnung woher... Ich benutze es eigentlich nur um den Fernseher ein und aus zu schalten. Ich habe auch nichts am Adapter verändert.
-
Hallo,
ich habe das Problem, daß ich den ioBoker.assistant-Skill nicht aktivieren kann, bzw, nicht mit dem iobroker.pro-Konto verknüpfen kann, da es zu einer Fehlermeldung "Konten konnten nicht verknüpft werden"
Ich bin echt ratlos, es war ein weiter Weg bis hier.-Da einige Pakete nicht mehr zur Verfügung standen habe ich den ganzen Pi auf Debian 13 neu aufgebaut.
-Backupdaten gelesen und alle Adapter aktualisiert.
-iobroker.pro abo ist aktuell und Zugangsdaten i.O. (sogar nochmal neues PW angelegt)
-alten Skill deaktiviert, neuer Skill auf Handy wegen alten Android nicht möglich(Alexa-App gelöscht), also über Tablet versucht anzumelden.
-Instanz iot ist verbunden, alte Alexa V1 deaktiviert , unter Alexa-Geräte V3 sind alle alten Geräte vorhanden
-mehrfach den Botton"IOT-Anmeldeinformationen neu erstellen" gedrückt und Instanzen neu gestartet, ohne Erfolg
![Screenshot_20260111-164140[1].png](/assets/uploads/files/1768150764833-screenshot_20260111-164140-1.png)
Wo steckt hier das Problem ???Vielen Dank im Vorraus
Grüße
Andreas
-
@drloksoft
Seit wann genau tritt das Problem auf und mit welcher Version vom iot-Adapter? -
@drloksoft
Seit wann genau tritt das Problem auf und mit welcher Version vom iot-Adapter?@Samson71 Hi,
Ich habe den "CREATE IOT CREDENTIALS ANEW" button gedrückt UND beim Login in der Alexa App nicht den voreingestellten Login genommen, sondern die Daten erneut manuell eingegeben. Dann ging es beim dritten Mal heute Nacht und ich habe meine 42 Geräte gefunden und konfiguriert.Heute morgen sagt mir allerdings mein Echo und die Alexa App, dass die Geräte nicht erreichbar sind. In der Instanz sieht alles gut aus und auch die Alexa App sagt im Skill, dass alles konfiguriert ist.
Einen echten troubeshooting Ansatz finde ich nicht. Hast du eine Idee?
-
Okay, 24 Stunden später scheinen nun magisch die Geräte wieder verfügbar zu sein. Allerdings funktionieren die Rolladen nicht mehr. Ich habe Rolladenaktoren von Shelly verbaut, die mir im Datenpunkt "Cover0.Position" exakt die prozentuale Position angeben. Diesen Datenpunkt habe ich mit einem Alexa Gerät verbunden und ihm den Typ "Window Blind" gegeben. In der Alexa App sehe ich auch Buttons mit Prozentualen Angaben in 20er Schritten (0-100). Bei egal welchen Button ich drücke, geht das Rollo immer auf 0%.

Selbst wenn ich im IO Adapter "Silly" logging einstelle, spuckt der Log nichts sachdienliches zum Troubleshooting aus. Hat noch jemand eine Idee? -
Okay, 24 Stunden später scheinen nun magisch die Geräte wieder verfügbar zu sein. Allerdings funktionieren die Rolladen nicht mehr. Ich habe Rolladenaktoren von Shelly verbaut, die mir im Datenpunkt "Cover0.Position" exakt die prozentuale Position angeben. Diesen Datenpunkt habe ich mit einem Alexa Gerät verbunden und ihm den Typ "Window Blind" gegeben. In der Alexa App sehe ich auch Buttons mit Prozentualen Angaben in 20er Schritten (0-100). Bei egal welchen Button ich drücke, geht das Rollo immer auf 0%.

Selbst wenn ich im IO Adapter "Silly" logging einstelle, spuckt der Log nichts sachdienliches zum Troubleshooting aus. Hat noch jemand eine Idee?exakt die prozentuale Position angeben.
Echte Prozent?
Oder zB. 0.6 von max 1 -
exakt die prozentuale Position angeben.
Echte Prozent?
Oder zB. 0.6 von max 1@Homoran
Das ist etwas verrückt. In der Alexa App geht es gar nicht einen ordentlichen Stand des Rollos auszuwählen. Somit kann ich Alexa-basierte Szenen schon mal nicht erstellen. Ich habe aktuell ein kleines Script geschrieben, welches mir die Zustände spiegelt. Damit sowohl actual als auch set in die Config ordentlich übernommen werden. Wenn ich nun die Datenpunkte des Scriptes nehme, dann kann ich zumindest per Spracheingabe "Alexa, setze Wohnzimmer Rollo rechts auf 50|40|30(etc)" das Rollo halb hoch fahren. Richtig elegant ist das nicht, funktioniert aber für's erste.Du bringst mich aber auf eine Idee. Wenn die Alexa App keine Prozentwerte, sondern dezimalwerte übergibt, geht es natürlich so gut wie immer auf 0. Ich teste mal, ob ich irgendwas schlaues mitloggen kann.
/************************************************************ * Shelly Cover -> Alexa V3 Alias (SET / ACTUAL) * Debug-Version mit ausführlichem Logging ************************************************************/ const CONFIG = { name: 'Wohnzimmer_Rollo_Rechts', SHELLY_ACTUAL_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.Position', SHELLY_WRITE_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.TargetPosition', BASE_PATH: '0_userdata.0.Alexa.blinds.Wohnzimmer_Rollo_Rechts', LOG: true, DEBUG: true }; const DP = { SET: `${CONFIG.BASE_PATH}.set`, ACTUAL: `${CONFIG.BASE_PATH}.actual`, INFO: `${CONFIG.BASE_PATH}.info.lastCommand`, DEBUG: `${CONFIG.BASE_PATH}.info.lastRawEvent` }; let suppressActualEchoUntil = 0; let lastForwardedTarget = null; let lastForwardedTs = 0; function logx(msg, level = 'info') { if (CONFIG.LOG) log(`[AlexaBlind] ${msg}`, level); } function debugLog(msg) { if (CONFIG.DEBUG) log(`[AlexaBlind][DEBUG] ${msg}`, 'info'); } function clampPercent(val) { let n = Number(val); if (isNaN(n)) return null; if (n < 0) n = 0; if (n > 100) n = 100; return Math.round(n); } function fmtState(obj) { if (!obj || !obj.state) return 'kein state'; return JSON.stringify({ val: obj.state.val, ack: obj.state.ack, from: obj.state.from, ts: obj.state.ts, lc: obj.state.lc, user: obj.state.user, q: obj.state.q }); } // States anlegen createState(DP.SET, 0, { name: `${CONFIG.name} SET`, type: 'number', role: 'level.blind', read: true, write: true, unit: '%', min: 0, max: 100, def: 0, desc: 'Sollwert für Alexa / Blind' }, async () => { createState(DP.ACTUAL, 0, { name: `${CONFIG.name} ACTUAL`, type: 'number', role: 'value.blind', read: true, write: false, unit: '%', min: 0, max: 100, def: 0, desc: 'Istwert für Alexa / Blind' }, async () => { createState(DP.INFO, '', { name: `${CONFIG.name} Last Command`, type: 'string', role: 'text', read: true, write: false, def: '' }, async () => { createState(DP.DEBUG, '', { name: `${CONFIG.name} Last Raw Event`, type: 'string', role: 'text', read: true, write: false, def: '' }, init); }); }); }); function init() { logx(`Initialisierung für "${CONFIG.name}" gestartet`); logx(`SET-State: ${DP.SET}`); logx(`ACTUAL-State: ${DP.ACTUAL}`); logx(`SHELLY_WRITE_ID: ${CONFIG.SHELLY_WRITE_ID}`); logx(`SHELLY_ACTUAL_ID: ${CONFIG.SHELLY_ACTUAL_ID}`); // Initialen ACTUAL-Wert vom Shelly übernehmen const current = getState(CONFIG.SHELLY_ACTUAL_ID); if (current && current.val !== null && current.val !== undefined) { const pos = clampPercent(current.val); if (pos !== null) { setState(DP.ACTUAL, pos, true); setState(DP.SET, pos, true); logx(`Initialposition übernommen: ${pos}%`); } } else { logx(`Warnung: ACTUAL-State nicht lesbar: ${CONFIG.SHELLY_ACTUAL_ID}`, 'warn'); } /******************************************************** * MONITOR: Alles loggen, was auf dem SET-State passiert ********************************************************/ on({ id: DP.SET, change: 'any' }, obj => { const oldVal = obj.oldState ? obj.oldState.val : undefined; const newVal = obj.state ? obj.state.val : undefined; const msg = `RAW EVENT auf SET: alt=${oldVal}, neu=${newVal}, ack=${obj.state.ack}, from=${obj.state.from}, user=${obj.state.user}, ts=${obj.state.ts}, lc=${obj.state.lc}, q=${obj.state.q}`; debugLog(msg); setState(DP.DEBUG, msg, true); }); /******************************************************** * AKTION: Jede echte Wertänderung auf SET verarbeiten * Wichtig: erstmal OHNE Filter ack:false ********************************************************/ on({ id: DP.SET, change: 'ne' }, obj => { const target = clampPercent(obj.state.val); debugLog(`Trigger auf DP.SET(change:ne) -> ${fmtState(obj)}`); if (target === null) { logx(`Ungültiger SET-Wert empfangen: ${obj.state.val}`, 'warn'); return; } // Endlosschleifen vermeiden: // Wenn wir selbst eben genau diesen Wert bestätigt haben, nicht nochmal schreiben const now = Date.now(); if ( obj.state.ack === true && lastForwardedTarget === target && (now - lastForwardedTs) < 5000 ) { debugLog(`Ignoriere Echo auf SET (${target}%), weil es sehr wahrscheinlich von uns selbst kommt.`); return; } suppressActualEchoUntil = now + 3000; lastForwardedTarget = target; lastForwardedTs = now; logx(`SET empfangen: ${target}% | ack=${obj.state.ack} | from=${obj.state.from} -> schreibe an Shelly (${CONFIG.SHELLY_WRITE_ID})`); setState(DP.INFO, `SET ${target}% | ack=${obj.state.ack} | from=${obj.state.from} @ ${new Date().toISOString()}`, true); // SET-State bestätigt zurückschreiben, aber nur wenn noch nicht ack=true if (obj.state.ack !== true) { setState(DP.SET, target, true); } // An Shelly schreiben setState(CONFIG.SHELLY_WRITE_ID, target); }); /******************************************************** * Shelly meldet echte Position zurück -> ACTUAL aktualisieren ********************************************************/ on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'ne' }, obj => { const actual = clampPercent(obj.state.val); debugLog(`Shelly ACTUAL Event -> ${fmtState(obj)}`); if (actual === null) { logx(`Ungültiger ACTUAL-Wert vom Shelly: ${obj.state.val}`, 'warn'); return; } setState(DP.ACTUAL, actual, true); // optional den SET-State nachziehen, aber nur wenn gerade kein frischer Fahrbefehl läuft if (Date.now() > suppressActualEchoUntil) { setState(DP.SET, actual, true); } logx(`Shelly ACTUAL aktualisiert: ${actual}%`); }); /******************************************************** * Optional: Direktes Logging des Shelly-Target-States ********************************************************/ on({ id: CONFIG.SHELLY_WRITE_ID, change: 'any' }, obj => { debugLog(`Shelly WRITE/TARGET Event -> ${fmtState(obj)}`); }); logx(`Fertig initialisiert.`); } -
@Homoran
Das ist etwas verrückt. In der Alexa App geht es gar nicht einen ordentlichen Stand des Rollos auszuwählen. Somit kann ich Alexa-basierte Szenen schon mal nicht erstellen. Ich habe aktuell ein kleines Script geschrieben, welches mir die Zustände spiegelt. Damit sowohl actual als auch set in die Config ordentlich übernommen werden. Wenn ich nun die Datenpunkte des Scriptes nehme, dann kann ich zumindest per Spracheingabe "Alexa, setze Wohnzimmer Rollo rechts auf 50|40|30(etc)" das Rollo halb hoch fahren. Richtig elegant ist das nicht, funktioniert aber für's erste.Du bringst mich aber auf eine Idee. Wenn die Alexa App keine Prozentwerte, sondern dezimalwerte übergibt, geht es natürlich so gut wie immer auf 0. Ich teste mal, ob ich irgendwas schlaues mitloggen kann.
/************************************************************ * Shelly Cover -> Alexa V3 Alias (SET / ACTUAL) * Debug-Version mit ausführlichem Logging ************************************************************/ const CONFIG = { name: 'Wohnzimmer_Rollo_Rechts', SHELLY_ACTUAL_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.Position', SHELLY_WRITE_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.TargetPosition', BASE_PATH: '0_userdata.0.Alexa.blinds.Wohnzimmer_Rollo_Rechts', LOG: true, DEBUG: true }; const DP = { SET: `${CONFIG.BASE_PATH}.set`, ACTUAL: `${CONFIG.BASE_PATH}.actual`, INFO: `${CONFIG.BASE_PATH}.info.lastCommand`, DEBUG: `${CONFIG.BASE_PATH}.info.lastRawEvent` }; let suppressActualEchoUntil = 0; let lastForwardedTarget = null; let lastForwardedTs = 0; function logx(msg, level = 'info') { if (CONFIG.LOG) log(`[AlexaBlind] ${msg}`, level); } function debugLog(msg) { if (CONFIG.DEBUG) log(`[AlexaBlind][DEBUG] ${msg}`, 'info'); } function clampPercent(val) { let n = Number(val); if (isNaN(n)) return null; if (n < 0) n = 0; if (n > 100) n = 100; return Math.round(n); } function fmtState(obj) { if (!obj || !obj.state) return 'kein state'; return JSON.stringify({ val: obj.state.val, ack: obj.state.ack, from: obj.state.from, ts: obj.state.ts, lc: obj.state.lc, user: obj.state.user, q: obj.state.q }); } // States anlegen createState(DP.SET, 0, { name: `${CONFIG.name} SET`, type: 'number', role: 'level.blind', read: true, write: true, unit: '%', min: 0, max: 100, def: 0, desc: 'Sollwert für Alexa / Blind' }, async () => { createState(DP.ACTUAL, 0, { name: `${CONFIG.name} ACTUAL`, type: 'number', role: 'value.blind', read: true, write: false, unit: '%', min: 0, max: 100, def: 0, desc: 'Istwert für Alexa / Blind' }, async () => { createState(DP.INFO, '', { name: `${CONFIG.name} Last Command`, type: 'string', role: 'text', read: true, write: false, def: '' }, async () => { createState(DP.DEBUG, '', { name: `${CONFIG.name} Last Raw Event`, type: 'string', role: 'text', read: true, write: false, def: '' }, init); }); }); }); function init() { logx(`Initialisierung für "${CONFIG.name}" gestartet`); logx(`SET-State: ${DP.SET}`); logx(`ACTUAL-State: ${DP.ACTUAL}`); logx(`SHELLY_WRITE_ID: ${CONFIG.SHELLY_WRITE_ID}`); logx(`SHELLY_ACTUAL_ID: ${CONFIG.SHELLY_ACTUAL_ID}`); // Initialen ACTUAL-Wert vom Shelly übernehmen const current = getState(CONFIG.SHELLY_ACTUAL_ID); if (current && current.val !== null && current.val !== undefined) { const pos = clampPercent(current.val); if (pos !== null) { setState(DP.ACTUAL, pos, true); setState(DP.SET, pos, true); logx(`Initialposition übernommen: ${pos}%`); } } else { logx(`Warnung: ACTUAL-State nicht lesbar: ${CONFIG.SHELLY_ACTUAL_ID}`, 'warn'); } /******************************************************** * MONITOR: Alles loggen, was auf dem SET-State passiert ********************************************************/ on({ id: DP.SET, change: 'any' }, obj => { const oldVal = obj.oldState ? obj.oldState.val : undefined; const newVal = obj.state ? obj.state.val : undefined; const msg = `RAW EVENT auf SET: alt=${oldVal}, neu=${newVal}, ack=${obj.state.ack}, from=${obj.state.from}, user=${obj.state.user}, ts=${obj.state.ts}, lc=${obj.state.lc}, q=${obj.state.q}`; debugLog(msg); setState(DP.DEBUG, msg, true); }); /******************************************************** * AKTION: Jede echte Wertänderung auf SET verarbeiten * Wichtig: erstmal OHNE Filter ack:false ********************************************************/ on({ id: DP.SET, change: 'ne' }, obj => { const target = clampPercent(obj.state.val); debugLog(`Trigger auf DP.SET(change:ne) -> ${fmtState(obj)}`); if (target === null) { logx(`Ungültiger SET-Wert empfangen: ${obj.state.val}`, 'warn'); return; } // Endlosschleifen vermeiden: // Wenn wir selbst eben genau diesen Wert bestätigt haben, nicht nochmal schreiben const now = Date.now(); if ( obj.state.ack === true && lastForwardedTarget === target && (now - lastForwardedTs) < 5000 ) { debugLog(`Ignoriere Echo auf SET (${target}%), weil es sehr wahrscheinlich von uns selbst kommt.`); return; } suppressActualEchoUntil = now + 3000; lastForwardedTarget = target; lastForwardedTs = now; logx(`SET empfangen: ${target}% | ack=${obj.state.ack} | from=${obj.state.from} -> schreibe an Shelly (${CONFIG.SHELLY_WRITE_ID})`); setState(DP.INFO, `SET ${target}% | ack=${obj.state.ack} | from=${obj.state.from} @ ${new Date().toISOString()}`, true); // SET-State bestätigt zurückschreiben, aber nur wenn noch nicht ack=true if (obj.state.ack !== true) { setState(DP.SET, target, true); } // An Shelly schreiben setState(CONFIG.SHELLY_WRITE_ID, target); }); /******************************************************** * Shelly meldet echte Position zurück -> ACTUAL aktualisieren ********************************************************/ on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'ne' }, obj => { const actual = clampPercent(obj.state.val); debugLog(`Shelly ACTUAL Event -> ${fmtState(obj)}`); if (actual === null) { logx(`Ungültiger ACTUAL-Wert vom Shelly: ${obj.state.val}`, 'warn'); return; } setState(DP.ACTUAL, actual, true); // optional den SET-State nachziehen, aber nur wenn gerade kein frischer Fahrbefehl läuft if (Date.now() > suppressActualEchoUntil) { setState(DP.SET, actual, true); } logx(`Shelly ACTUAL aktualisiert: ${actual}%`); }); /******************************************************** * Optional: Direktes Logging des Shelly-Target-States ********************************************************/ on({ id: CONFIG.SHELLY_WRITE_ID, change: 'any' }, obj => { debugLog(`Shelly WRITE/TARGET Event -> ${fmtState(obj)}`); }); logx(`Fertig initialisiert.`); }Was ist SlatPos für ein Datenpunkt ?
Der steht bei dir bei Actual im Screenshot . -
Was ist SlatPos für ein Datenpunkt ?
Der steht bei dir bei Actual im Screenshot .@haselchen Gute Frage. Den Datenpunkt übernimmt der IOT Adapter "SlatPos" automatisch, wenn man nur "position" angibt. Mit meinen neuen Datenpunkten übernimmt der IOT Adapter nur den Set Datenpunkt:

Unabhängig davon stelle ich fest, dass bei der Auswahl über die Alexa-App wird immer
0auf den SET-State geschrieben wird, während ich per Spracheingabe tatsächlich numerische Werte bekomme.Der aus der Alexa-App kommende Wert ist nicht 0.5, 0.6 oder ein anderer Dezimalwert, sondern tatsächlich numerisch 0.
Hier mein Debug Script:
/************************************************************ * Shelly Cover -> Alexa V3 Alias (SET / ACTUAL) * MAX DEBUG VERSION ************************************************************/ const CONFIG = { name: 'Wohnzimmer_Rollo_Rechts', SHELLY_ACTUAL_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.Position', SHELLY_WRITE_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.TargetPosition', BASE_PATH: '0_userdata.0.Alexa.blinds.Wohnzimmer_Rollo_Rechts', LOG: true, DEBUG: true }; const DP = { SET: `${CONFIG.BASE_PATH}.set`, ACTUAL: `${CONFIG.BASE_PATH}.actual`, INFO: `${CONFIG.BASE_PATH}.info.lastCommand`, DEBUG: `${CONFIG.BASE_PATH}.info.lastRawEvent` }; let suppressActualEchoUntil = 0; let lastForwardedTarget = null; let lastForwardedTs = 0; function logx(msg, level = 'info') { if (CONFIG.LOG) log(`[AlexaBlind] ${msg}`, level); } function debugLog(msg) { if (CONFIG.DEBUG) log(`[AlexaBlind][DEBUG] ${msg}`, 'info'); } function clampPercent(val) { let n = Number(val); if (isNaN(n)) return null; if (n < 0) n = 0; if (n > 100) n = 100; return Math.round(n); } function describeValue(val) { return `value=${JSON.stringify(val)} | typeof=${typeof val} | Number()=${Number(val)} | parseFloat=${parseFloat(val)}`; } function fmtState(obj) { if (!obj || !obj.state) return 'kein state'; return JSON.stringify({ val: obj.state.val, valJson: JSON.stringify(obj.state.val), typeOfVal: typeof obj.state.val, numberVal: Number(obj.state.val), parseFloatVal: parseFloat(obj.state.val), ack: obj.state.ack, from: obj.state.from, ts: obj.state.ts, lc: obj.state.lc, user: obj.state.user, q: obj.state.q, c: obj.state.c }); } function logObjectInfo(id) { try { const obj = getObject(id); if (!obj) { debugLog(`getObject(${id}) -> kein Objekt gefunden`); return; } debugLog(`Objektinfo ${id}: ${JSON.stringify({ type: obj.type, common: obj.common, native: obj.native })}`); } catch (e) { logx(`Fehler bei getObject(${id}): ${e}`, 'warn'); } } // States anlegen createState(DP.SET, 0, { name: `${CONFIG.name} SET`, type: 'number', role: 'level.blind', read: true, write: true, unit: '%', min: 0, max: 100, def: 0, desc: 'Sollwert für Alexa / Blind' }, async () => { createState(DP.ACTUAL, 0, { name: `${CONFIG.name} ACTUAL`, type: 'number', role: 'value.blind', read: true, write: false, unit: '%', min: 0, max: 100, def: 0, desc: 'Istwert für Alexa / Blind' }, async () => { createState(DP.INFO, '', { name: `${CONFIG.name} Last Command`, type: 'string', role: 'text', read: true, write: false, def: '' }, async () => { createState(DP.DEBUG, '', { name: `${CONFIG.name} Last Raw Event`, type: 'string', role: 'text', read: true, write: false, def: '' }, init); }); }); }); function init() { logx(`Initialisierung für "${CONFIG.name}" gestartet`); logx(`SET-State: ${DP.SET}`); logx(`ACTUAL-State: ${DP.ACTUAL}`); logx(`SHELLY_WRITE_ID: ${CONFIG.SHELLY_WRITE_ID}`); logx(`SHELLY_ACTUAL_ID: ${CONFIG.SHELLY_ACTUAL_ID}`); logObjectInfo(DP.SET); logObjectInfo(DP.ACTUAL); logObjectInfo(CONFIG.SHELLY_WRITE_ID); logObjectInfo(CONFIG.SHELLY_ACTUAL_ID); const current = getState(CONFIG.SHELLY_ACTUAL_ID); if (current && current.val !== null && current.val !== undefined) { const pos = clampPercent(current.val); if (pos !== null) { setState(DP.ACTUAL, pos, true); setState(DP.SET, pos, true); logx(`Initialposition übernommen: ${pos}%`); } } else { logx(`Warnung: ACTUAL-State nicht lesbar: ${CONFIG.SHELLY_ACTUAL_ID}`, 'warn'); } /******************************************************** * 1) GLOBAL DEBUG auf ganzen Alexa-Zweig ********************************************************/ on({ id: new RegExp('^' + CONFIG.BASE_PATH.replace(/\./g, '\\.') + '\\..*'), change: 'any' }, obj => { const oldVal = obj.oldState ? obj.oldState.val : undefined; const newVal = obj.state ? obj.state.val : undefined; const msg = `BRANCH EVENT | id=${obj.id} | ` + `old=${JSON.stringify(oldVal)} | new=${JSON.stringify(newVal)} | ` + `typeof=${typeof newVal} | Number=${Number(newVal)} | parseFloat=${parseFloat(newVal)} | ` + `ack=${obj.state.ack} | from=${obj.state.from} | user=${obj.state.user} | ` + `ts=${obj.state.ts} | lc=${obj.state.lc} | q=${obj.state.q} | c=${obj.state.c}`; debugLog(msg); if (obj.id === DP.SET) { setState(DP.DEBUG, msg, true); } }); /******************************************************** * 2) Speziell DP.SET überwachen ********************************************************/ on({ id: DP.SET, change: 'any' }, obj => { debugLog(`SET RAW -> ${fmtState(obj)}`); }); /******************************************************** * 3) Jede echte Wertänderung auf SET verarbeiten ********************************************************/ on({ id: DP.SET, change: 'ne' }, obj => { debugLog(`SET Trigger(change:ne) -> ${fmtState(obj)}`); debugLog(`SET Detail -> ${describeValue(obj.state.val)}`); const target = clampPercent(obj.state.val); if (target === null) { logx(`Ungültiger SET-Wert empfangen: ${JSON.stringify(obj.state.val)}`, 'warn'); return; } const now = Date.now(); if ( obj.state.ack === true && lastForwardedTarget === target && (now - lastForwardedTs) < 5000 ) { debugLog(`Ignoriere Echo auf SET (${target}%), vermutlich von uns selbst.`); return; } suppressActualEchoUntil = now + 3000; lastForwardedTarget = target; lastForwardedTs = now; logx(`SET empfangen: ${target}% | raw=${JSON.stringify(obj.state.val)} | ack=${obj.state.ack} | from=${obj.state.from} -> schreibe an Shelly (${CONFIG.SHELLY_WRITE_ID})`); setState(DP.INFO, `SET ${target}% | raw=${JSON.stringify(obj.state.val)} | ack=${obj.state.ack} | from=${obj.state.from} @ ${new Date().toISOString()}`, true); if (obj.state.ack !== true) { setState(DP.SET, target, true); } setState(CONFIG.SHELLY_WRITE_ID, target); }); /******************************************************** * 4) Shelly ACTUAL ********************************************************/ on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'any' }, obj => { debugLog(`Shelly ACTUAL Event -> ${fmtState(obj)}`); }); on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'ne' }, obj => { const actual = clampPercent(obj.state.val); if (actual === null) { logx(`Ungültiger ACTUAL-Wert vom Shelly: ${JSON.stringify(obj.state.val)}`, 'warn'); return; } setState(DP.ACTUAL, actual, true); if (Date.now() > suppressActualEchoUntil) { setState(DP.SET, actual, true); } logx(`Shelly ACTUAL aktualisiert: ${actual}%`); }); /******************************************************** * 5) Shelly WRITE/TARGET ********************************************************/ on({ id: CONFIG.SHELLY_WRITE_ID, change: 'any' }, obj => { debugLog(`Shelly WRITE/TARGET Event -> ${fmtState(obj)}`); }); logx(`Fertig initialisiert.`); } -
@haselchen Gute Frage. Den Datenpunkt übernimmt der IOT Adapter "SlatPos" automatisch, wenn man nur "position" angibt. Mit meinen neuen Datenpunkten übernimmt der IOT Adapter nur den Set Datenpunkt:

Unabhängig davon stelle ich fest, dass bei der Auswahl über die Alexa-App wird immer
0auf den SET-State geschrieben wird, während ich per Spracheingabe tatsächlich numerische Werte bekomme.Der aus der Alexa-App kommende Wert ist nicht 0.5, 0.6 oder ein anderer Dezimalwert, sondern tatsächlich numerisch 0.
Hier mein Debug Script:
/************************************************************ * Shelly Cover -> Alexa V3 Alias (SET / ACTUAL) * MAX DEBUG VERSION ************************************************************/ const CONFIG = { name: 'Wohnzimmer_Rollo_Rechts', SHELLY_ACTUAL_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.Position', SHELLY_WRITE_ID: 'shelly.0.shellyplus2pm#e86beae602b0#1.Cover0.TargetPosition', BASE_PATH: '0_userdata.0.Alexa.blinds.Wohnzimmer_Rollo_Rechts', LOG: true, DEBUG: true }; const DP = { SET: `${CONFIG.BASE_PATH}.set`, ACTUAL: `${CONFIG.BASE_PATH}.actual`, INFO: `${CONFIG.BASE_PATH}.info.lastCommand`, DEBUG: `${CONFIG.BASE_PATH}.info.lastRawEvent` }; let suppressActualEchoUntil = 0; let lastForwardedTarget = null; let lastForwardedTs = 0; function logx(msg, level = 'info') { if (CONFIG.LOG) log(`[AlexaBlind] ${msg}`, level); } function debugLog(msg) { if (CONFIG.DEBUG) log(`[AlexaBlind][DEBUG] ${msg}`, 'info'); } function clampPercent(val) { let n = Number(val); if (isNaN(n)) return null; if (n < 0) n = 0; if (n > 100) n = 100; return Math.round(n); } function describeValue(val) { return `value=${JSON.stringify(val)} | typeof=${typeof val} | Number()=${Number(val)} | parseFloat=${parseFloat(val)}`; } function fmtState(obj) { if (!obj || !obj.state) return 'kein state'; return JSON.stringify({ val: obj.state.val, valJson: JSON.stringify(obj.state.val), typeOfVal: typeof obj.state.val, numberVal: Number(obj.state.val), parseFloatVal: parseFloat(obj.state.val), ack: obj.state.ack, from: obj.state.from, ts: obj.state.ts, lc: obj.state.lc, user: obj.state.user, q: obj.state.q, c: obj.state.c }); } function logObjectInfo(id) { try { const obj = getObject(id); if (!obj) { debugLog(`getObject(${id}) -> kein Objekt gefunden`); return; } debugLog(`Objektinfo ${id}: ${JSON.stringify({ type: obj.type, common: obj.common, native: obj.native })}`); } catch (e) { logx(`Fehler bei getObject(${id}): ${e}`, 'warn'); } } // States anlegen createState(DP.SET, 0, { name: `${CONFIG.name} SET`, type: 'number', role: 'level.blind', read: true, write: true, unit: '%', min: 0, max: 100, def: 0, desc: 'Sollwert für Alexa / Blind' }, async () => { createState(DP.ACTUAL, 0, { name: `${CONFIG.name} ACTUAL`, type: 'number', role: 'value.blind', read: true, write: false, unit: '%', min: 0, max: 100, def: 0, desc: 'Istwert für Alexa / Blind' }, async () => { createState(DP.INFO, '', { name: `${CONFIG.name} Last Command`, type: 'string', role: 'text', read: true, write: false, def: '' }, async () => { createState(DP.DEBUG, '', { name: `${CONFIG.name} Last Raw Event`, type: 'string', role: 'text', read: true, write: false, def: '' }, init); }); }); }); function init() { logx(`Initialisierung für "${CONFIG.name}" gestartet`); logx(`SET-State: ${DP.SET}`); logx(`ACTUAL-State: ${DP.ACTUAL}`); logx(`SHELLY_WRITE_ID: ${CONFIG.SHELLY_WRITE_ID}`); logx(`SHELLY_ACTUAL_ID: ${CONFIG.SHELLY_ACTUAL_ID}`); logObjectInfo(DP.SET); logObjectInfo(DP.ACTUAL); logObjectInfo(CONFIG.SHELLY_WRITE_ID); logObjectInfo(CONFIG.SHELLY_ACTUAL_ID); const current = getState(CONFIG.SHELLY_ACTUAL_ID); if (current && current.val !== null && current.val !== undefined) { const pos = clampPercent(current.val); if (pos !== null) { setState(DP.ACTUAL, pos, true); setState(DP.SET, pos, true); logx(`Initialposition übernommen: ${pos}%`); } } else { logx(`Warnung: ACTUAL-State nicht lesbar: ${CONFIG.SHELLY_ACTUAL_ID}`, 'warn'); } /******************************************************** * 1) GLOBAL DEBUG auf ganzen Alexa-Zweig ********************************************************/ on({ id: new RegExp('^' + CONFIG.BASE_PATH.replace(/\./g, '\\.') + '\\..*'), change: 'any' }, obj => { const oldVal = obj.oldState ? obj.oldState.val : undefined; const newVal = obj.state ? obj.state.val : undefined; const msg = `BRANCH EVENT | id=${obj.id} | ` + `old=${JSON.stringify(oldVal)} | new=${JSON.stringify(newVal)} | ` + `typeof=${typeof newVal} | Number=${Number(newVal)} | parseFloat=${parseFloat(newVal)} | ` + `ack=${obj.state.ack} | from=${obj.state.from} | user=${obj.state.user} | ` + `ts=${obj.state.ts} | lc=${obj.state.lc} | q=${obj.state.q} | c=${obj.state.c}`; debugLog(msg); if (obj.id === DP.SET) { setState(DP.DEBUG, msg, true); } }); /******************************************************** * 2) Speziell DP.SET überwachen ********************************************************/ on({ id: DP.SET, change: 'any' }, obj => { debugLog(`SET RAW -> ${fmtState(obj)}`); }); /******************************************************** * 3) Jede echte Wertänderung auf SET verarbeiten ********************************************************/ on({ id: DP.SET, change: 'ne' }, obj => { debugLog(`SET Trigger(change:ne) -> ${fmtState(obj)}`); debugLog(`SET Detail -> ${describeValue(obj.state.val)}`); const target = clampPercent(obj.state.val); if (target === null) { logx(`Ungültiger SET-Wert empfangen: ${JSON.stringify(obj.state.val)}`, 'warn'); return; } const now = Date.now(); if ( obj.state.ack === true && lastForwardedTarget === target && (now - lastForwardedTs) < 5000 ) { debugLog(`Ignoriere Echo auf SET (${target}%), vermutlich von uns selbst.`); return; } suppressActualEchoUntil = now + 3000; lastForwardedTarget = target; lastForwardedTs = now; logx(`SET empfangen: ${target}% | raw=${JSON.stringify(obj.state.val)} | ack=${obj.state.ack} | from=${obj.state.from} -> schreibe an Shelly (${CONFIG.SHELLY_WRITE_ID})`); setState(DP.INFO, `SET ${target}% | raw=${JSON.stringify(obj.state.val)} | ack=${obj.state.ack} | from=${obj.state.from} @ ${new Date().toISOString()}`, true); if (obj.state.ack !== true) { setState(DP.SET, target, true); } setState(CONFIG.SHELLY_WRITE_ID, target); }); /******************************************************** * 4) Shelly ACTUAL ********************************************************/ on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'any' }, obj => { debugLog(`Shelly ACTUAL Event -> ${fmtState(obj)}`); }); on({ id: CONFIG.SHELLY_ACTUAL_ID, change: 'ne' }, obj => { const actual = clampPercent(obj.state.val); if (actual === null) { logx(`Ungültiger ACTUAL-Wert vom Shelly: ${JSON.stringify(obj.state.val)}`, 'warn'); return; } setState(DP.ACTUAL, actual, true); if (Date.now() > suppressActualEchoUntil) { setState(DP.SET, actual, true); } logx(`Shelly ACTUAL aktualisiert: ${actual}%`); }); /******************************************************** * 5) Shelly WRITE/TARGET ********************************************************/ on({ id: CONFIG.SHELLY_WRITE_ID, change: 'any' }, obj => { debugLog(`Shelly WRITE/TARGET Event -> ${fmtState(obj)}`); }); logx(`Fertig initialisiert.`); }sondern tatsächlich numerisch 0.
Möglicherweise ist das ein 0/1 für false/true
-
sondern tatsächlich numerisch 0.
Möglicherweise ist das ein 0/1 für false/true
-
sondern tatsächlich numerisch 0.
Möglicherweise ist das ein 0/1 für false/true
Nope, da kommt immer 0 raus. Egal, ob ich 0, 20,40,60,80,100 drücke.
Nope, da kommt immer 0 raus
Ja und?
Das kann trotzdem false bedeuten.Ich weiß ja nicht was die Dame versteht
-
Nope, da kommt immer 0 raus
Ja und?
Das kann trotzdem false bedeuten.Ich weiß ja nicht was die Dame versteht
-
@Homoran Von Alexa kommt 0 bei Iobroker als Zahl an.
Ich bin mir nicht sicher, ob der IOT Skill irgendetwas falsch umrechnet.Von Alexa kommt 0 bei Iobroker als Zahl an
Das habe ich verstanden!
Könnte an der implizite Typumwandlung liegen -
Von Alexa kommt 0 bei Iobroker als Zahl an
Das habe ich verstanden!
Könnte an der implizite Typumwandlung liegen
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden