Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten

    This topic has been deleted. Only users with topic management privileges can see it.
    • bergjet
      bergjet @ticaki last edited by

      @ticaki sagte in [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten:

      hab eine 1.0.11 hochgeladen. Die prüft ob der State existiert.

      Danke, der Fehler ist weg.

      1 Reply Last reply Reply Quote 0
      • Nashra
        Nashra Most Active Forum Testing @ticaki last edited by Nashra

        @ticaki sagte in [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten:

        @nashra
        Wenn ich bei mir auf commands.alexa klicke kommt eine Sprachausgabe. Gerade eben iobroker und raspi auf den neusten Stand gebracht.

        Glaube den Fehler gefunden zu haben, ich hatte mal bei Alexa eine Grupp für alle angelegt.
        Diese jetzt gelöscht und commands angeklickt, der Ring ist kurz teilweise weiß aber da kommt nichts,
        vielleicht weil keine Nachrichten vorhanden sind?
        Warte mal bis eine Warnung vorliegt.

        bergjet T 2 Replies Last reply Reply Quote 0
        • bergjet
          bergjet @Nashra last edited by

          @nashra sagte in [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten:

          vielleicht weil keine Nachrichten vorhanden sind?

          Bei mir liegt auch keine Warnmeldung vor. Wenn den command Alexa Button anklicke kommt "Alle Warnmeldungen wurden aufgehoben".

          1 Reply Last reply Reply Quote 0
          • T
            ticaki Developer @MartyBr last edited by ticaki

            @martybr
            Ich glaube nicht das ich da was machen kann. Der Fehler sagt das der Server die Verbindung zurück setzt. Hab ich auch, finde aber nix mit dem ich das weg bekomme. Und kommt auch nicht jedesmal.

            @Nashra
            sicher das du nicht den Ton auf stumm gestellt hast? Das Skript kommt auch mit Gruppen klar. Aber ich weiß aktuell nicht wie alles funktioniert, gib mir dafür nochmal etwas mehr Zeit.

            M 1 Reply Last reply Reply Quote 0
            • M
              MartyBr @ticaki last edited by

              @ticaki
              Danke für die Prüfung. Das war nur irritierend.

              1 Reply Last reply Reply Quote 0
              • T
                ticaki Developer @Nashra last edited by ticaki

                @nashra

                Teste mal folgendes:

                Gib in diesem Datenpunkt einen Text ein, der sollte dann ausgegeben werden. Geht es, liegt es am Skript, wenn nicht an Alexa

                musst deine Serial eingeben.

                alexa2.0.Echo-Devices.---deine serial---.Commands.announcement
                
                Nashra 1 Reply Last reply Reply Quote 0
                • Nashra
                  Nashra Most Active Forum Testing @ticaki last edited by Nashra

                  @ticaki sagte in [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten:

                  @nashra

                  Teste mal folgendes:

                  Gib in diesem Datenpunkt einen Text ein, der sollte dann ausgegeben werden. Geht es, liegt es am Skript, wenn nicht an Alexa

                  musst deine Serial eingeben.

                  alexa2.0.Echo-Devices.---deine serial---.Commands.announcement
                  

                  Hi @ticaki
                  habs erst jetzt gesehen, sorry. Also in dem DP steht seit vorhin eine Warnung drin

                  Amtliche WARNUNG vor FROST des DWD für Honolulu  gültig vom 3 Dezember  22:00 Uhr bis 4 Dezember  09:00 Uhr.  Insgesamt eine aktive Warnung.
                  

                  Im Log kommt folgendes

                  Heute 14:17	info	javascript.0	[3 Einträge] info: Sendwarnings manuell uPushdienst: 32
                  

                  Aber Alexa bleibt stumm. Verstehe das nicht, es ist nie was am Skript oder sonst geändert worden.
                  Achja, habe die Tage Alexa Adapter auf 3.23.1 angehoben, aber mit dem alten ging es ja auch nicht.

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    ticaki Developer @Nashra last edited by

                    @nashra
                    Dieser DP wird vom Script beschrieben. Da keine Ausgabe erfolgt stimmt was mit dem Alexa Adapter nicht. Oder Lautstärke ist auf 0

                    Nashra 1 Reply Last reply Reply Quote 0
                    • Nashra
                      Nashra Most Active Forum Testing @ticaki last edited by

                      @ticaki sagte in [Script] DWD/UWZ/NINA Warnungen als Push/Sprachnachrichten:

                      @nashra
                      Dieser DP wird vom Script beschrieben. Da keine Ausgabe erfolgt stimmt was mit dem Alexa Adapter nicht. Oder Lautstärke ist auf 0

                      Hi @ticaki
                      Lautstärke steht auf 50. Es mußte aber einiges am Alexa Adapter geändert worden da Amazon viele gesperrt hatte
                      wegen zu vieler Anfragen. Momentan installiert ist die 3.23.2 von Alexa.

                      1 Reply Last reply Reply Quote 0
                      • Andreas67 0
                        Andreas67 0 last edited by

                        21:47:28.789	error	javascript.0 (1644) script.js.common.Unwetterwarnung: Error: Function "extendObject" is not allowed. Use adapter settings to allow it.
                        21:47:28.791	error	javascript.0 (1644) at addWarncell (script.js.common.Unwetterwarnung:3247:15)
                        21:47:28.791	error	javascript.0 (1644) at Object.init (script.js.common.Unwetterwarnung:976:17)
                        
                        Andreas67 0 1 Reply Last reply Reply Quote 0
                        • Andreas67 0
                          Andreas67 0 @Andreas67 0 last edited by

                          @andreas67-0 Bekomm beim starten de Scripts immer dies Fehler

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            TT-Tom @Andreas67 0 last edited by

                            @andreas67-0

                            kann sein das in deinen Einstellungen der Instanz etwas fehlt. Ist "Exec" und "setObject" erlaubt?

                            Andreas67 0 1 Reply Last reply Reply Quote 1
                            • Andreas67 0
                              Andreas67 0 @TT-Tom last edited by

                              @tt-tom Danke für die Info, ist zumindest ein Problem gelöst

                              1 Reply Last reply Reply Quote 0
                              • Andreas67 0
                                Andreas67 0 last edited by Andreas67 0

                                aktuell scheitere an diesem Problem:
                                Script geht immer auf stop
                                Hat ja laut Script was mit dem Nachrichtigen versand zu tun

                                23:14:23.766	info	javascript.0 (2170) script.js.common.Unwetterwarnung: info: Fehler in CreateStates #5
                                23:14:23.767	info	javascript.0 (2170) script.js.common.Unwetterwarnung: info: TypeError: Cannot read properties of null (reading 'val')
                                23:14:23.921	info	javascript.0 (2170) Stop script script.js.common.Unwetterwarnung
                                23:14:23.923	info	javascript.0 (2170) script.js.common.Unwetterwarnung: info: Skripts gestoppt: ID:993.1927840622801
                                
                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  TT-Tom @Andreas67 0 last edited by

                                  @andreas67-0

                                  ich kenne das Script nicht, aber es hat ein Problem in "CreateStates" und damit vermutlich als Folgefehler den TypeError. du musst mal die Funktion "CreateStates" suchen und auf Fehler prüfen.

                                  Das wäre jetzt mein Ansatz.

                                  Andreas67 0 1 Reply Last reply Reply Quote 0
                                  • Andreas67 0
                                    Andreas67 0 @TT-Tom last edited by

                                    @tt-tom Glaube mein Problem ist das der DP mainStatePath config.manuell nicht erzeugt wird, weis leider nicht warum
                                    Glaub das der Fehler irgendwo in diesem Bereich des Scripts liegt

                                        try {
                                            // MODE änderung über Datenpunkte string
                                            await createStateCustomAsync(configModeState, '', { read: true, write: true, desc: "Modusauswahl DWD, UWZ, Nina oder Zamg", type: "string"});
                                    
                                            on({ id: configModeState, change: 'ne', ack: false }, function(obj) {
                                                if (obj.state.val && typeof obj.state.val === 'string' &&
                                                    (obj.state.val.toUpperCase().includes('DWD') || obj.state.val.toUpperCase().includes('UWZ') || obj.state.val.toUpperCase().includes('NINA') || obj.state.val.toUpperCase().includes('ZAMG'))) {
                                                    //setState(configModeState, MODE, true)
                                                    let mode = 0;
                                                    if (firstRun) return;
                                                    for (let a = 0; a < MODES.length; a++) mode |= obj.state.val.toUpperCase().includes(MODES[a].text) ? MODES[a].mode : 0;
                                                    if (MODE != mode) {
                                                        ticaLog(4, 'Modus wird geändert von: ' + mode + ' String:' + obj.state.val);
                                                        changeMode(mode);
                                                    } else {
                                                        changeMode(MODE);
                                                    }
                                                } else {
                                                    changeMode(MODE);
                                                }
                                            });
                                    
                                            // MODE änderung über Datenpunkte Boolean
                                            for (let a = 0; a < MODES.length; a++) {
                                                let tok = MODES[a].text.toLowerCase();
                                                let id = mainStatePath + 'config.' + tok;
                                                if (!await existsStateAsync(id)) {
                                                    let mi = !!(MODE & MODES[a].mode);
                                                    await createStateCustomAsync(id, mi, { read: true, write: true, desc: "Aktivere " + tok.toUpperCase() + '.', type: "boolean" });
                                                }
                                                on({ id: id, change: 'ne', ack: false }, function(obj) {
                                                    let arr = obj.id.split('.');
                                                    let tok = arr[arr.length - 1].toUpperCase();
                                                    let mode = MODES[MODES.findIndex(function(j) { return j.text == tok })].mode;
                                                    let oldMode = MODE;
                                                    oldMode = switchFlags(oldMode, mode, obj.state.val);
                                                    ticaLog(4, 'Modus wird geändert von: ' + MODE);
                                                    changeMode(oldMode);
                                                });
                                                MODE = switchFlags(MODE, MODES[a].mode, getState(id).val);
                                    
                                            }
                                            // Automodus ein und ausschalten
                                            let id = mainStatePath + 'config.auto.on';
                                            await createStateCustomAsync(id, true, { read: true, write: true, desc: "Aktivere automatischen Push bei eintreffen der Warnungen.", type: "boolean" });
                                    
                                            autoSendWarnings = getState(id).val;
                                            await setStateAsync(id, !!(autoSendWarnings), true);
                                    
                                            for (let a = 0; a < configObj.length; a++) {
                                                if (onStopped) return;
                                                let p = mainStatePath + 'config.' + configObj[a].id
                                                if (!await existsStateAsync(p)) {
                                                    let n = configObj[a].name !== undefined ? configObj[a].name : configObj[a].id;
                                                    let def = configObj[a].def;
                                                    await createStateAsync(p, {read:true, write:true, def: def, type:configObj[a].typ, name:n});
                                                }
                                                if (scriptOverrides) {
                                                    await configObj[a].setObj();
                                                } else {
                                                    const v = await getStateAsync(p);
                                                    configObj[a].on({id:p, state:{val:v.val}});
                                                }
                                                on(p, configObj[a].on);
                                            }
                                            // Nachrichtenversand per Click States/ config. und auto . erzeugen und subscript
                                            for (let a = 0; a < konstanten.length; a++) {
                                                if ((uPushdienst & konstanten[a].value) != 0) {
                                                    if (!await existsStateAsync(mainStatePath + 'commands.' + konstanten[a].name)) {
                                                        await createStateAsync(mainStatePath + 'commands.' + konstanten[a].name, { read: true, write: true, desc: "Gebe Warnungen auf dieser Schiene aus", type: "boolean", role: "button", def: false });
                                                    }
                                                    if (!await existsStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_short')) {
                                                        await createStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_short', { read: true, write: true, desc: "Gebe Kurzwarnungen auf dieser Schiene aus", type: "boolean", role: "button", def: false });
                                                    }
                                                    if (!await existsStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_long')) {
                                                        await createStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_long', { read: true, write: true, desc: "Gebe lange Warnungen auf dieser Schiene aus", type: "boolean", role: "button", def: false });
                                                    }
                                                    if (!await existsStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_veryshort')) {
                                                        await createStateAsync(mainStatePath + 'commands.' + konstanten[a].name + '_veryshort', { read: true, write: true, desc: "Gebe sehr kurze Warnungen auf dieser Schiene aus", type: "boolean", role: "button", def: false });
                                                    }
                                                    for (let x = 0; x < MODES.length; x++) {
                                                        let oid = mainStatePath + 'config.auto.' + MODES[x].text.toLowerCase() + '.' + konstanten[a].name;
                                                        await createStateCustomAsync(oid, true, { read: true, write: true, desc: "Schalte Autopushmöglichkeiten ein / aus", type: "boolean" });
                                                        setConfigKonstanten(oid, getState(oid).val, true);
                                    
                                                        oid = mainStatePath + 'config.manuell.' + MODES[x].text.toLowerCase() + '.' + konstanten[a].name;
                                                        await createStateCustomAsync(oid, true, { read: true, write: true, desc: "Schalte Manuellepushmöglichkeiten ein / aus", type: "boolean" });
                                                        setConfigKonstanten(oid, getState(oid).val, false);
                                                        // letzer fund von Create Custom
                                                    }
                                                }
                                            }
                                            ticaLog(0, 'Abonniere Konfigurationsdatenpunkte')
                                            subscribeStates();
                                            setWeekend();
                                            activateSchedule();
                                            ticaLog(0, 'Setzte Modus, Inialisiere Datenbank, starte Datenabruf(asynchron)')
                                            if (firstRun) changeMode(MODE)
                                            ticaLog(0, 'Initialisierung abgeschlossen')
                                        } catch(error) {
                                            ticaLog(0,'Fehler in CreateStates #5');
                                            ticaLog(0,error);
                                            stopScript();
                                        }
                                    
                                    Andreas67 0 1 Reply Last reply Reply Quote 0
                                    • Andreas67 0
                                      Andreas67 0 @Andreas67 0 last edited by

                                      UWZuZ.JPG

                                      T 1 Reply Last reply Reply Quote 0
                                      • T
                                        TT-Tom @Andreas67 0 last edited by

                                        @andreas67-0

                                        hast du mal den Datenbaum komplett gelöscht und das Script neu gestartet?

                                        ich muss jetzt die Augen zu machen, bis morgen 😴

                                        Andreas67 0 1 Reply Last reply Reply Quote 0
                                        • Andreas67 0
                                          Andreas67 0 @TT-Tom last edited by

                                          @tt-tom Ja hab ich schon 3 mal Probiert

                                          T 1 Reply Last reply Reply Quote 0
                                          • T
                                            ticaki Developer @Andreas67 0 last edited by ticaki

                                            @andreas67-0
                                            Hallo,

                                            wird basisconfiguration komplett erstellt?

                                            Hab das Skript mal mit anderem mainstatepath gestartet. Kein Fehler.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            940
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            53
                                            1521
                                            492141
                                            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